Jump to content
Sign in to follow this  
smacker909

help with positioning for unit during playmove animation

Recommended Posts

Hi, A few questions regarding the code. Trying to get my repair guy to jump out of his truck and do the repair, but facing the vehicle.. sometimes he does other times not so much :( I could only get him close enough to the vehicle using attachTo. Is there another way? Lastly, using the attachTo command below.. sometimes he's a little off the ground other times he's a ankle deep in the mud. Is there a better way to deal with his ground clearance if using attachTo? Thanks!

unassignVehicle _repairGuy;
doGetOut _repairGuy;
_repairGuy move getPos _brokenVehicle;
waitUntil {unitReady _repairGuy};

hintSilent "Standby. The repair should't too take long.";

_repairGuy attachTo [_brokenVehicle,[0,3,-1.7]]; 
_dir = getDir _brokenVehicle;
if (_dir < 180) then {_dir = _dir + 360};
_dir = _dir - 180;
_repairGuy setDir _dir;
_repairGuy switchMove "AmovPercMstpSnonWnonDnon";
_repairGuy switchMove "Repairingkneel";

while {(getDammage _brokenVehicle) > 0} do {
hintSilent format ["Dammage is %1",getDammage _brokenVehicle];
_brokenVehicle setDamage ((getDammage _brokenVehicle) - .010);
sleep 1;
};
_brokenVehicle setVehicleAmmo 1; 
_brokenVehicle setFuel 1;

hintSilent "Vehicle is repaired and resuplied. Have a nice day!";

_repairGuy switchMove "AmovPercMstpSnonWnonDnon";
detach _repairGuy; 

[_repairGuy]joinSilent _repairGrp;
_repairGuy assignAsDriver _repairTruck;
[_repairGuy] orderGetIn true;

Also.. I initially used playmove, but couldn't break out of this animation with it.. have to us switchmove

Edited by smacker909
more info

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  

×