OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: ZapBrannigan on 01 Oct 2011, 17:54:35
-
Hello,
I have a scene where i need to loop the sprinting animation every .3 seconds. it needs to be every .3 seconds for what im doing to work. The problem is that the running animation takes longer than .3 seconds to complete. So as the scene is progressing im accumulating a lot of queued sprinting animations. and when the scene is finished and i want him to stop. He keeps playing the animation a few hundred times before he finally stops. How can i cancel all the queued animations or otherwise make him stop.
thanks
-
loon switchmove (http://www.ofpec.com/COMREF/index.php?action=details&id=363&game=All) ""
-
I tried it, it doesn't work :/
-
The alternative would be to have the sprinting animation controlled by a separate script which doesn't loop every .3 seconds but loops for the length of the sprinting animation. You control when the running animation script stops by setting a global variable.
Or you could deletevehicle the running guy and recreate him with all the properties of the old version, except standing still.
-
oh perfect both of those work. Nice work bedges.
thanks
-
Hi zap,
Could you post an example of your working anim loop please? Thanks.
-
_unit = _this select 0
_tgt = _this select 1
#loop
? (_unit distance _tgt)<5: exit
? (((GetPos _Tgt select 1) - (GetPos _Unit select 1)) > 0): _Ang = ATan (((GetPos _Tgt select 0) - (GetPos _Unit select 0)) / ((GetPos _Tgt select 1) - (GetPos _Unit select 1)))
? (((GetPos _Tgt select 1) - (GetPos _Unit select 1)) < 0): _Ang = ATan (((GetPos _Tgt select 0) - (GetPos _Unit select 0)) / ((GetPos _Tgt select 1) - (GetPos _Unit select 1))) + 180
? _Ang < 0: _Ang = _Ang + 360
_unit setdir _ang
_unit playmove "AmovPercMevaSrasWrflDf"
~.5
goto "loop"
-
Thanks Zap. I've been thinking about such a script to get a unit to move to a precise location.