Jump to content
Luft08

Can I pass a function that take an argument to setWaypointStatements?

Recommended Posts

I want to execute a function after units reach their given waypoint but the function takes an argument. I wanted to use setWaypointStatements but the argument is in a private variable and it is not possible to place the argument into a global variable because the function gets executed by many AI units that require the argument have different values.

 

Is there any way to do this?

Share this post


Link to post
Share on other sites

Try using setVariable on the units to store the value of the private variable, and then recall it when calling your function.

 

When you define your private variable:

TAG_unit setVariable ["TAG_myPrivateArgument", _privateVar];

 

When the unit completes the waypoint:

[(TAG_unit getVariable "TAG_myPrivateArgument")] call TAG_fnc_myFunction;

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×