Jump to content
Sign in to follow this  
Deg

scripted waypoint trouble

Recommended Posts

Hi all im having a little trouble with my script im trying to delete this group after it reaches the second waypoint and im not quit sure how to add in deleteVehicle do i need to use setWaypointStatements? ive been searching around but still cant figure it out.

grp = [getMarkerPos "Spawn1",side player, (configFile >> "CfgGroups" >> "West" >> "USMC" >> "Infantry" >> "USMC_InfSquad")] call BIS_fnc_spawnGroup; 
wp = grp addwaypoint [getMarkerPos "s1",0];  
wp setWaypointType "SAD";
wp setWaypointCombatMode "RED";
wp setWaypointSpeed "FULL";
wp setWaypointBehaviour "AWARE";
wp1 = grp addwaypoint [getMarkerPos "s2",0];  
wp1 setWaypointType "MOVE";
wp1 setWaypointCombatMode "RED";
wp1 setWaypointSpeed "FULL";
wp1 setWaypointBehaviour "AWARE";

Any help will be appreciated, thanks in advanced :)

Deg

Share this post


Link to post
Share on other sites

this will delete any vehicle and units in the group wich has the waypoints.

wp1 setWaypointStatements ["true", "deletevehicle (vehicle this); {deleteVehicle _x} forEach units group this;"];

Share this post


Link to post
Share on other sites

That kind of worked, but when the first guy reached the waypoint he deleted and the rest of the group just stayed there. Thanks

Deg

---------- Post added at 12:57 AM ---------- Previous post was at 12:43 AM ----------

Thanks i got it to work i just didnt use ''deletevehicle (vehicle this)''; and they all deleted when the squad leader reached the waypoint. One other question how would i add a sleep delay to that so it will give a chance for all squad members to reach the waypoint before they get deleted?

---------- Post added at 01:56 AM ---------- Previous post was at 12:57 AM ----------

duh setwaypointtimeout :o. Thanks for your help

Share this post


Link to post
Share on other sites

you can use spawn to use sleep functions, like this:

wp1 setWaypointStatements ["true", "_null = this spawn {sleep 30; {deleteVehicle _x} forEach units group _this;};"];

there is also distance that can be used in a waituntil instead of sleep 30;

waitUntil {{(_x distance (getWPPos wp1)) < 50 OR !alive _x} count units group _this};

basically, spawn allows you to create a script without physically having a script file in your mission, thus alowing you to use all script commands not easily used in setWaypointStatements without it.

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  

×