Jump to content
Sign in to follow this  

Recommended Posts

Hi! I'm new to scripting and need your help :)

I'm trying to make a simple script that will alow me to set a waypoint to existing units by clicking on the map using repeated radio trigger to activate the script. After some searching, I've came up with this:

onMapSingleClick { 
_waypoint = patrol1 addWaypoint [[_pos select 0, _pos select 1, 0], 0, 1];  //patrol1 is created in init.sqf
_waypoint setWaypointStatements ["true", "deleteWaypoint [patrol1, 1]"];
}; 

This works fine - I can click on the map and the units will go there :).

But I have a problem if I modify the script to define waypoint type. The units will not move at all.

onMapSingleClick { 
_waypoint = patrol1 addWaypoint [[_pos select 0, _pos select 1, 0], 0, 1];
_waypoint setWaypoint "MOVE";     // NOT WORKING !
_waypoint setWaypointStatements ["true", "deleteWaypoint [patrol1, 1]"];
}; 

What's wrong with that? Any help is appreciated. :)

Share this post


Link to post
Share on other sites
onMapSingleClick { 
_waypoint = patrol1 addWaypoint [[_pos select 0, _pos select 1, 0], 0, 1];
_waypoint [color="#FF0000"]setWaypointType[/color] "MOVE";     // [color="#FF0000"]Should work.[/color]
_waypoint setWaypointStatements ["true", "deleteWaypoint [patrol1, 1]"];
};

Share this post


Link to post
Share on other sites

LOL epic failure. Thank you :)

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  

×