Jump to content
Sign in to follow this  
zectbumo

Scripting Guard Waypoint

Recommended Posts

I can't seem to figure out how to script a guard waypoint. I think I'm having trouble with synchronizing the trigger with the waypoint. I am trying this:

private _trigger = createTrigger ["EAST G", getMarkerPos "guard_1"];

{
  if (side _x == east) then {
    private _wp = _x addWaypoint [position leader _x, 0];
    _wp setWaypointType "GUARD";
    _trigger synchronizeWaypoint [_wp];
  };
} forEach allGroups;

The units do not seem to guard the marker position. If I manually create this using the editor and I synchronize the waypoint with a trigger made in the editor then it works fine. But I need to make this work solely in a script.

 

Share this post


Link to post
Share on other sites
private _trigger = createTrigger ["EAST G", getMarkerPos "guard_1"];

Never seen createTrigger get used like that, might be wrong but I don't think thats how you create a trigger.

 

I create triggers like this,

_trigger = createTrigger ["EmptyDetector", getMarkerPos "guard_1"];

and then use setTriggerActivation and setTriggerStatements to set the activation and statements.

 

But might be wrong, if this is new, why didn't I know about this earlier?

 

 

Did you check if the trigger works?

Share this post


Link to post
Share on other sites

Adding on what Jasper said, you need to use setTriggerType to set it to "EAST G" after creating the trigger (using EmptyDetector).

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  

×