Jump to content
Sign in to follow this  
Wolfenswan

Waypoints, "On Activation" and limited execution

Recommended Posts

As I remember it, a waypoint's "on act" field would execute once for the group completing the waypoint. As it is currently it is executed once per group member. Am I mis-remembering or is this a bug?

My issue is, I can't figure out a straightforward way to restrict this execution to only happen once, as the only dynamic arguments are this for the group leader and thislist for the units of the group, but no reference to the specific unit in the group which the "on act" is executed for.

Share this post


Link to post
Share on other sites

Odd, I've never experienced the behavior you describe. Are you certain it triggers once for each member? Definitely a bug if so.

Share this post


Link to post
Share on other sites

I have not tested it on a dedicated yet but it's easy enough to test on local. A systemchat in the on activation field will appear times the number of units in the group.

Edit:

It seems it's caused by calling a function from the on activation field. If I put only a systemchat in the onAct it fires once, but with a function-call beforehand the systemchat shows times group members.

Spawning a function does not cause this behavior.

Edited by Wolfenswan

Share this post


Link to post
Share on other sites
As I remember it, a waypoint's "on act" field would execute once for the group completing the waypoint. As it is currently it is executed once per group member. Am I mis-remembering or is this a bug?

My issue is, I can't figure out a straightforward way to restrict this execution to only happen once, as the only dynamic arguments are this for the group leader and thislist for the units of the group, but no reference to the specific unit in the group which the "on act" is executed for.

1) The waypoint is meant to only 'on act' once for the whole group.

2) Another way to make an action happen is to use a trigger. For the trigger, you can set it as "once" or "repeated" (you want it at once obviously). You can also set the condition: _unit in thislist; . You replace the "_unit" for the name of the only unit the trigger will activate for (rather than setting it as any BLUEFOR, OPFOR, INDI, etc.)

Share this post


Link to post
Share on other sites

No need for the trigger if it would work how it should.

Anyway, I found the cause for my problem: Setting the new current WP for the group using setCurrentWaypoint from the onAct field causes things to break. E.g. this will prompt the "activated" message several times:

wp = (group this) addWaypoint [(position this),10]; (group this) setCurrentWaypoint wp;systemchat "activated";

Setting a new waypoint from a scheduled environment does not cause any issues, it's only calls or putt the code into the onAct field directly.

2) Another way to make an action happen is to use a trigger. For the trigger, you can set it as "once" or "repeated" (you want it at once obviously). You can also set the condition: _unit in thislist; . You replace the "_unit" for the name of the only unit the trigger will activate for (rather than setting it as any BLUEFOR, OPFOR, INDI, etc.)

I can just group a unit to a trigger and set the on-activation to whole group/any group member. What I wanted to know though is why my waypoints stopped working as they used to ;)

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
Sign in to follow this  

×