b00tsy 27 Posted August 1, 2010 (edited) Hi, I've searched the biki and the forum as always, but could not find what I am looking for. I am trying to get some men in a house to play animations such as sitting and lying on the ground. I am activating the animations with a trigger. (off1 switchmove "AidlPpneMstpSnonWnonDnon_SleepC_layDown"; ) The problem I have now is that the men stands up and go back to default animation when the animation ends. I have set the triggers to repeat, but that does not work as the men keep standing in the trigger so It does not get activated again. I have been looking to replace playmove/switchmove with something that enables the animation to loop, but I can't find a command for that. Does anybody know how I can make a non looped animation loop anyway once it is activated by a trigger (without external scripts)? Edited August 1, 2010 by B00tsy Share this post Link to post Share on other sites
rübe 118 Posted August 1, 2010 Does anybody know how I can make a non looped animation loop anyway once it is activated by a trigger (without external scripts)? off1 playMoveNow "AidlPpneMstpSnonWnonDnon_SleepC_layDown"; off1 disableAI "ANIM"; should do the trick. With disableAI "ANIM" you prevent the unit from changing the animation, thus he will loop/be stuck in this animation. Share this post Link to post Share on other sites
b00tsy 27 Posted August 1, 2010 Yes that works! Thanks for the help :) ---------- Post added at 01:32 PM ---------- Previous post was at 12:50 PM ---------- Ahh i just tried it with this animation ( ActsPercMstpSlowWpstDnon_sceneNikitinDisloyalty_Lopotev2 ) and indeed does not go back to the default animation, but it does not loop the animation either. When the animation ends the character stays static in the last animation frame that was played. It does not replay the animation. Share this post Link to post Share on other sites
rübe 118 Posted August 1, 2010 well, not all animations loop, I guess. And not all can be switchMoved and not all can be playMoved and then some depend on behaviour... The animation system in Arma2 is quite hard to understand... take what you can and good luck. :) Share this post Link to post Share on other sites
b00tsy 27 Posted August 1, 2010 Yeah for now i will work around it with repeating the animation command in the "on act" box. Hope it wont add lag if i repeat that line 20 times or more. Share this post Link to post Share on other sites
Nicolai 10 Posted August 1, 2010 (edited) I might have a way to do this: If you want the men to do the animations from the beginning of the mission, you should give them all a waypoint REALLY close to them and in the onAct field of that waypoint you should play the animation. After that waypoint you should place another CYCLE waypoint also really close to the unit. So when the unit starts, it plays the animation, and when it's done it cycles thus playing it again. For a looped animation from a trigger, hang on a couple of minutes. Nicolai EDIT: Ok if you want it to happen from the trigger: Synchronize the trigger with the first waypoint. That will make the loop start when the trigger is activated. I have to say that the animation is not really suitable for a loop, you'd better find an animation which is a loop by itself. you could try using the animationviewer by clayman to find a suitable animation. Good luck Nicolai Edited August 1, 2010 by Nicolai Share this post Link to post Share on other sites
IndeedPete 1019 Posted August 1, 2010 Why don't you try this: animationLoop.sqf _unit = _this select 0; _animation = _this select 1; _noWeapons = _this select 2; _switchMove = _this select 3; _unit allowDamage false; _unit setDamage 0; _unit setVariable ["BIS_noCoreConversations", true]; if (_noWeapons) then {removeAllWeapons _unit}; if (_switchMove) then { while {true} do { _unit switchMove _animation; waitUntil {animationState _unit != _animation}; }; } else { while {true} do { _unit playMove _animation; waitUntil {animationState _unit != _animation}; }; }; Execute it via: nil = [pete,"animation",true,true] execVM "animationLoop.sqf"; It's quite easy to use and works fine. ;) Share this post Link to post Share on other sites
b00tsy 27 Posted August 1, 2010 I might have a way to do this:If you want the men to do the animations from the beginning of the mission, you should give them all a waypoint REALLY close to them and in the onAct field of that waypoint you should play the animation. After that waypoint you should place another CYCLE waypoint also really close to the unit. So when the unit starts, it plays the animation, and when it's done it cycles thus playing it again. For a looped animation from a trigger, hang on a couple of minutes. Nicolai EDIT: Ok if you want it to happen from the trigger: Synchronize the trigger with the first waypoint. That will make the loop start when the trigger is activated. I have to say that the animation is not really suitable for a loop, you'd better find an animation which is a loop by itself. you could try using the animationviewer by clayman to find a suitable animation. Good luck Nicolai The waypoint idea works good with the animations I tried so far, thanks for the tip! Yea I am still digging through the animation list and trying them out in the editor, which is time consuming. Will definitely check the animation viewer out :) ---------- Post added at 04:15 PM ---------- Previous post was at 04:10 PM ---------- Why don't you try this:animationLoop.sqf _unit = _this select 0; _animation = _this select 1; _noWeapons = _this select 2; _switchMove = _this select 3; _unit allowDamage false; _unit setDamage 0; _unit setVariable ["BIS_noCoreConversations", true]; if (_noWeapons) then {removeAllWeapons _unit}; if (_switchMove) then { while {true} do { _unit switchMove _animation; waitUntil {animationState _unit != _animation}; }; } else { while {true} do { _unit playMove _animation; waitUntil {animationState _unit != _animation}; }; }; Execute it via: nil = [pete,"animation",true,true] execVM "animationLoop.sqf"; It's quite easy to use and works fine. ;) That looks not that easy actually. I preferably do not want to use an external script cos I tend to mess that up even when it is copy/paste work. So far the waypoint way seems to work :) Thanks tho! ---------- Post added at 06:07 PM ---------- Previous post was at 04:15 PM ---------- I actually discovered something now. I can create patroling units that walk a large distance up and down a road for example and with only 2 waypoint using 1 animation. Like suggested, I first create a waypoint that includes an animation. I use this animation: a3 playMoveNow "LHD_midDeck"; and place the unit any distance from the waypoint I like and use the second cycle waypoint to loop it. The "patrol animation" now lets the men walk constantly from where he first started back to the waypoint endlessly until he detects an enemy. Share this post Link to post Share on other sites