Jump to content
Sign in to follow this  
enad

How to make an Animation loop?

Recommended Posts

That's probably the animation try something else.

Share this post


Link to post
Share on other sites
That's probably the animation try something else.

I tried 10 different animations. None of them worked.

Edited by Toasticuss

Share this post


Link to post
Share on other sites

If you notice in there is a command true in the call code, change it to false. True just removes weapons.

Some of the actions are slight the one I copied from your post only has him aim his weapon and as it's in his init you don't see him raise it.

Edited by F2k Sel

Share this post


Link to post
Share on other sites
If you notice in there is a command true in the code, change it to false. True just removes weapons.

Some of the actions are slight the one I copied from your post only has him aim his weapon and as it's in his init you don't see him raise it.

What?

Are you talking about this?

while {true} do {

Share this post


Link to post
Share on other sites

Forget the true false crap it's something else that is messing up.

pilot1act = [this,"ActsPsitMstpSnonWunaDnon_sceneNikitinDisloyalty_Sykes",true] execVM "animLoop.sqf";

I see what's happening with the animations when we post the animations on the forum it keeps inserting the odd space and then when you copy them back they don't do anything. Can you see the space in the above line, I can't seem to remove and it's also in the code tha's what's stopping them from doing the correct animation of sitting with hands tied.

The space is also in your post as well.

Remove the space in the call code and it will be fine (I hope).

Edited by F2k Sel

Share this post


Link to post
Share on other sites
Forget the true false crap it's something else that is messing up.

pilot1act = [this,"ActsPsitMstpSnonWunaDnon_sceneNikitinDisloyalty_Sykes",true] execVM "animLoop.sqf";

I see what's happening with the animations when we post the animations on the forum it keeps inserting the odd space and then when you copy them back they don't do anything. Can you see the space in the above line, I can't seem to remove and it's also in the code tha's what's stopping them from doing the correct animation of sitting with hands tied.

The space is also in your post as well.

Remove the space in the call code and it will be fine (I hope).

Putting in a false gives you this lol

- arma2oa2010070910521201.jpg

Yeah the space wasnt it either, when removing the space he does the animation but does not get up. Just spins around in place lol.

All I want to have is 2 pilots that look like they are tied down and then released after a player enters the trigger area.

:cry:

Is their a way to achieve that without doing a loop?

Edited by Toasticuss

Share this post


Link to post
Share on other sites

I don't know what your doing to get that error, mine don't spin with either true or false.

One thing I have found is that the animation for them sitting is very long so upon release it looks like nothing happens for ages but then they do move.

I'm not sure if you can actually break the animation itself.

Share this post


Link to post
Share on other sites
I don't know what your doing to get that error, mine don't spin with either true or false.

One thing I have found is that the animation for them sitting is very long so upon release it looks like nothing happens for ages but then they do move.

I'm not sure if you can actually break the animation itself.

What about something like this?

Unitname switchmove "";

I think I tried this, couldnt get it to work.

Share this post


Link to post
Share on other sites

I'm puzzled because other animations work and stop the animation as soon as the trigger goes off.

Share this post


Link to post
Share on other sites
I'm puzzled because other animations work and stop the animation as soon as the trigger goes off.

It must be like you said because of it being so long. I just wonder what I could do to interrupt it. Because that seems to be the only animation like that.

Share this post


Link to post
Share on other sites

Hm, here's how i would do it.

animLoop.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};
};
};

1. Execute Script. (BTW, did you try "playmove" instead of "switchmove"? Sometimes it's a bit problematic...)

pilot1act = [this,"ActsPsitMstpSnonWunaDnon_sceneNikitinDisloyalty_Sykes",true,false] execVM "animLoop.sqf";
pilot2act = [this,"ActsPsitMstpSnonWunaDnon_sceneNikitinDisloyalty_Sykes",true,false] execVM "animLoop.sqf";

2. Place a trigger wich activates when the player enters:

Activated by BLUFOR/OPFOR/Whatever - Condition:

player in thislist

On Activation:

terminate pilot1act;
terminate pilot2act;
pilot1 switchmove "";
pilot2 switchmove "";

This script was originally designed by me to keep AI in a never ending loop to create some camp atmosphere. It was never expected to end sometime. Anyway, i hope it helps!

Share this post


Link to post
Share on other sites
Hm, here's how i would do it.

animLoop.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};
};
};

1. Execute Script. (BTW, did you try "playmove" instead of "switchmove"? Sometimes it's a bit problematic...)

pilot1act = [this,"ActsPsitMstpSnonWunaDnon_sceneNikitinDisloyalty_Sykes",true,false] execVM "animLoop.sqf";
pilot2act = [this,"ActsPsitMstpSnonWunaDnon_sceneNikitinDisloyalty_Sykes",true,false] execVM "animLoop.sqf";

2. Place a trigger wich activates when the player enters:

Activated by BLUFOR/OPFOR/Whatever - Condition:

player in thislist

On Activation:

terminate pilot1act;
terminate pilot2act;
pilot1 switchmove "";
pilot2 switchmove "";

This script was originally designed by me to keep AI in a never ending loop to create some camp atmosphere. It was never expected to end sometime. Anyway, i hope it helps!

Wow lol, the original creator of the script is posting on here, awesome.

Anyway, I have not tried playMove instead of switch move.

Just tried setting up the way you said, and when I get to them they arent doing any animation.

Edited by Toasticuss

Share this post


Link to post
Share on other sites

Hm, then it must be switchmove. But i don't know why they wouldn't stop. Did you try it without any scripts.

pilot1 switchMove "animation";

Maybe it's and "endless" animation? After the scene where this animation is used in BIS' campaign the mission ends. Maybe the animation was never supposed to end?

Share this post


Link to post
Share on other sites
Hm, then it must be switchmove. But i don't know why they wouldn't stop. Did you try it without any scripts.
pilot1 switchMove "animation";

Maybe it's and "endless" animation? After the scene where this animation is used in BIS' campaign the mission ends. Maybe the animation was never supposed to end?

We'll ive seen it end, i think its just like 120 seconds long.

Share this post


Link to post
Share on other sites

Ok, did you already try the way from my first post with switchmove?

pilot1act = [this,"ActsPsitMstpSnonWunaDnon_sceneNikitinDisloyalty_Sykes",true,true] execVM "animLoop.sqf";

Share this post


Link to post
Share on other sites
Ok, did you already try the way from my first post with switchmove?
pilot1act = [this,"ActsPsitMstpSnonWunaDnon_sceneNikitinDisloyalty_Sykes",true,true] execVM "animLoop.sqf";

[True, true] results with him doing the animation but when I walk into the trigger area he continues to do the animation.

Actually I think he stopped.

The grouping command is not working though.

---------- Post added at 01:02 PM ---------- Previous post was at 12:45 PM ----------

Alright I did some trial and error on this.

So what happenend is that when you enter the termination trigger, he basically becomes the terminator. He will stop the animation and then never listen to you again. After he finishes with the animation the join group trigger still does not work with him.

Oh yeah, hes also invincible while doing the animation

That's basically it.

Ugh, what could I do now?

Edited by Toasticuss

Share this post


Link to post
Share on other sites

IndeedPete thanks, works perfectly for me.

I'm still not sure why this foxed me so much I've tried playmove and switchmove and end up some wired results.

I'll keep this one safe, Cheers.

Share this post


Link to post
Share on other sites
IndeedPete thanks, works perfectly for me.

I'm still not sure why this foxed me so much I've tried playmove and switchmove and end up some wired results.

I'll keep this one safe, Cheers.

Wait so you got yours working where the animation will interrupt? Can you send me the mission of that so I can see where I went wrong...

Share this post


Link to post
Share on other sites

Done.

oa

wrong file deleted

Edited by F2k Sel

Share this post


Link to post
Share on other sites

He's invincible because of the script:

...
_unit allowDamage false;
...

Just remove this line and you can hurt him again. I put it in because sometimes AI hurts itself by doing some animations. Don't know why... :rolleyes:

Share this post


Link to post
Share on other sites
Damn you nicked it quick

http://www.sendspace.com/file/5i0ju0

I've just retried this to make really really sure it's right now, just adjust the trigger is still on a timer.

It still feels kinda off right now.

I'm trying to make it player activated by him walking into the trigger but it doesnt feel right.

Why cant I put hint text in with the terminations? It will activate silently, once they are freed the text will fire off.

Edit: Never mind, I'm retarded, theres that 5 second cool down.

Thanks a lot guys, now the last hardest thing I need to do is figure out how to put a trigger in a specific place inside of a building....

Edited by Toasticuss

Share this post


Link to post
Share on other sites

To make sure you have the right one download again.

use a distance check in the trigger

trigger axis 0,0

min,mid,max all 0,0,0

condition player distance pilot1 < 2 or player distance pilot2 < 2

placement of the trigger is not important it can be anywhere.

Edited by F2k Sel

Share this post


Link to post
Share on other sites

Wait, I thought this was the name of the unit, "pilot1act" but its not. What is the point of the ACT on the end of the name? This is what has been messing me up.

---------- Post added at 01:53 PM ---------- Previous post was at 01:44 PM ----------

Alright your names confused me throughout this entire process lol.

They are just methods you call on, I get it now.

So this is basically what happens, I have him executing an animation, the animation I will label as anim1, and now I can use that name in a trigger to stop it. It has nothing to do with his actual name.

Edited by Toasticuss

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  

×