Jump to content
Sign in to follow this  
masterfulninja

Creating a troop transport script with respawn

Recommended Posts

Ive already got a re-spawn script working that i found online, Ive modified it so there is a 4th troop behavior that I've verified is firing via hints already but its not acting the way its supposed to. The intended function is that a troop transport picks up a squad and drives them to a drop off location then the truck returns. The troops respawn when they die and (should) get back in the waiting troop transport for round two over and over until the transport itself is destroyed. They respawn and the hints fire but no luck on the right activity. Here is the code im using, any help is greatly appreciated I'm not so hot with scripting.

hint "transport1";
for "_i" from 0 to (4 + (floor (random 4))) do
{
private ["_wp", "_newPos"];

_newPos = getMarkerpos "loadmarker";

Sleep 1;
//_prevPos = _newPos;

_wp = _grp addWaypoint [_newPos, 0];
_wp setWaypointType "GETIN NEAREST";

//Set the group's speed and formation at the first waypoint.
if (_i == 0) then
{
	_wp setWaypointSpeed "FULL";
	_wp setWaypointFormation "LINE";
};
};
sleep 1;
hint "Transport2";
[_grp, 0] synchronizeWaypoint [ [_drivergrp1, 1] ];
_drivergrp1 setCurrentWaypoint [_drivergrp1, 1];

the drivers last waypoint is a hold, so when they respawn he is in the same spot where loadmarker is located. its supposed to kick driver back to waypoint 1 and sync that to the get in nearest command to make the loop. it isnt.

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  

×