In the beginning of a script, I tell some units to sit down. But when the player is close to them, they will stand up and attack the player. The problem is, I can't get the units to stand up!
_unit = _this select 0
_marker = _this select 1
#Sit
[_unit] exec "distance.sqs"
?(distamount <= 5): goto "posPlayer"
_unit playmove "EffectStandSitDown"
goto "Sit"
#posPlayer
_marker setpos [getpos player select 0,getpos player select 1,1]
#alert
?((_unit distance _marker) <= 5): goto "Patrol"
?(!alive player): exit
?(!alive _unit): exit
_unit switchmove "SitDowntoStand"
_unit setcombatmode "RED"
_unit setbehaviour "Combat"
_unit commandmove getpos _marker
~4
goto "alert"
#Patrol
?(!alive player): exit
?(!alive _unit): exit
?(!_unit knowsabout player): exit
_unit doTarget player
_unit commandMove getpos player
~7
_aa = random 20
_ab = random 20
_unit setvelocity [_aa,0,_ab]
~7
goto "patrol"
Side note: Some of that code is a little bad b/c I couldn't think of what to do with it.
What command do I issue to get these guys to attack me.