Jump to content
Sign in to follow this  
clydefrog

How do you script the onact of a waypoint?

Recommended Posts

Hi, I'm using Norrins vehicle respawn with waypoints script, and this is my script file for the waypoints for a vehicle:

_unit = _this select 0;
_group = group _unit;

_waypoint0 = _group addwaypoint[getmarkerpos"WP1",0];
_waypoint0 setwaypointtype"Move"; 

_waypoint1 = _group addwaypoint[getmarkerpos"WP2",0];
_waypoint1 setwaypointtype"Move";

_waypoint2 = _group addwaypoint[getmarkerpos"WP3",0];
_waypoint2 setwaypointtype"Move"; 

_waypoint3 = _group addwaypoint[getmarkerpos"WP4",0];
_waypoint3 setwaypointtype"Move"; 

_waypoint4 = _group addwaypoint[getmarkerpos"WP5",0];
_waypoint4 setwaypointtype"Move"; 

_waypoint5 = _group addwaypoint[getmarkerpos"WP6",0];
_waypoint5 setwaypointtype"Move"; 

_waypoint6 = _group addwaypoint[getmarkerpos"WP7",0];
_waypoint6 setwaypointtype"Move"; 

_waypoint7 = _group addwaypoint[getmarkerpos"WP8",0];
_waypoint7 setwaypointtype"Move"; 

_waypoint8 = _group addwaypoint[getmarkerpos"WP9",0];
_waypoint8 setwaypointtype"Move"; 

_waypoint9 = _group addwaypoint[getmarkerpos"WP10",0];
_waypoint9 setwaypointtype"Cycle"; 

How do I script the waypoint onAct part so I can have something happen to the vehicle (I want to delete it which I already know how to do) when it reaches waypoint 9? I can't find anything about scripting that part of a waypoint anywhere. Thanks

Share this post


Link to post
Share on other sites

You could do a work around.

By setting the init of the vehicle when it reaches that waypoint.

_unit WaitUntil {_unit Distance WP10 < 20};

_unit setvehicleinit "_unit deletevehicle";

Or along those lines

Or check this out

http://www.kylania.com/ex/?p=44

Edited by BangaBob

Share this post


Link to post
Share on other sites

The following should do the trick, have not tested.

_unit = _this select 0;
_group = group _unit;

for "_i" from 1 to 9 do {
_wp = _group addwaypoint [getMarkerPos(format["WP%1",_i]),0];
_wp setwayPointType "Move";
if (_i == 9) then {
	_wp setWaypointStatements ["true","deleteVehicle (vehicle this); {deleteVehicle _x} foreach units group this"];
};
};

Edited by Kempco
Typo (thx F2K)

Share this post


Link to post
Share on other sites

There is a typo at the end of the setWaypointstatements, remove the last }

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  

×