Home   Help Search Login Register  

Author Topic: SOLVED How to make an animation loop?  (Read 6328 times)

0 Members and 1 Guest are viewing this topic.

Offline stephen271276

  • Members
  • *
SOLVED How to make an animation loop?
« on: 13 Feb 2011, 19:10:30 »
Im putting an animation of a guard beating a civilian into my mission via a trigger using....
<<<<<civ switchMove "ActsPercMstpSnonWpstDnon_sceneBardak02"; guard1 switchMove "CtsDoktor_Vojak_uder1"; >>>>>
Now it works great but only happens once, but I want it to keep happening? How can I do this?
Ive tried repeatedly on trigger it doesnt work?
« Last Edit: 16 Feb 2011, 16:41:47 by stephen271276 »

Offline Zipper5

  • BIS Team
  • ****
Re: How to make an animation loop?
« Reply #1 on: 13 Feb 2011, 19:16:34 »
Code: [Select]
civAnim = true;
guard1Anim = true;

[] spawn {
while {civAnim} do {
civ switchMove "ActsPercMstpSnonWpstDnon_sceneBardak02";
waitUntil {(animationState civ != "ActsPercMstpSnonWpstDnon_sceneBardak02") && civAnim};
};
};

[] spawn {
while {guard1Anim} do {
guard1 switchMove "CtsDoktor_Vojak_uder1";
waitUntil {(animationState guard1 != "CtsDoktor_Vojak_uder1") && guard1Anim};
};
};
Put that in a SQF script and execute it in the mission. The unit named civ will loop the animation until civAnim is set to false, and the unit named guard1 will loop the animation until guard1Anim is set to false.

Offline stephen271276

  • Members
  • *
Re: How to make an animation loop?
« Reply #2 on: 13 Feb 2011, 19:21:47 »
Cheers man Ill try it now.....
Works but how do I set them to false via a trigger ie <<<<<<!alive guard>>>>>>> condition in the trigger....
Basically Id want the anims to loop till the guard is killed
« Last Edit: 13 Feb 2011, 19:26:07 by stephen271276 »

Offline Zipper5

  • BIS Team
  • ****
Re: How to make an animation loop?
« Reply #3 on: 13 Feb 2011, 19:39:28 »
Ah, well, in that case, use this:
Code: [Select]
[] spawn {
while {alive civ && alive guard1} do {
civ switchMove "ActsPercMstpSnonWpstDnon_sceneBardak02";
waitUntil {(animationState civ != "ActsPercMstpSnonWpstDnon_sceneBardak02") && alive civ && alive guard1};
};
};

[] spawn {
while {alive guard1} do {
guard1 switchMove "CtsDoktor_Vojak_uder1";
waitUntil {(animationState guard1 != "CtsDoktor_Vojak_uder1") && alive guard1};
};
};

[] spawn {
waitUntil {!(alive guard1)};
civ switchMove "AmovPercMstpSnonWnonDnon";
guard1 switchMove "AmovPercMstpSlowWrflDnon";
};
That will make it so that when the guard is killed both units' animations will reset and the loop will stop.

Offline stephen271276

  • Members
  • *
Re: How to make an animation loop?
« Reply #4 on: 13 Feb 2011, 20:02:36 »
Lifesaver, thanks pal

Offline COL. Alderman

  • Members
  • *
Re: SOLVED How to make an animation loop?
« Reply #5 on: 14 Jun 2013, 01:46:44 »
On This Same Note I Am Trying To Make A Script To Make My Realism Members Stand At Attention With Hands Behind Their Backs i Got the script working but it does not want to keep them in that position


while in game scroll and click Attention and the animation should play untill you scroll and click At ease

p1 switchMove "AmovPercMstpSnonWnonDnon_Ease";

for the Attention


p1 switchmove"AmovPercMstpSnonWnonDnon_Easeout"

for the At Ease