Jump to content
Sign in to follow this  
Morts

Switchmoves

Recommended Posts

Hey guys,

I'm trying to get some switchmoves involved in my missions for players to use. It is vital that they work.

It is run through an addAction

 this addAction ["Play Dead", "die.sqf"] 

die.sqf:

player switchmove "AdthPercMstpSrasWrflDb_8"

That works fine, but i want the player to be able to stand up afterwards. Now i thought, it would be just another simple swtichmove to roll over like the healing module. But when i run this switchmove the player just lies there and cannot move.

Also, is it possible to add an eventhandler so that it plays a different animation depending on which position they are in. I.e. the animation i'm using now, is a death from standing up, but can it change depending on whether the payer is kneeling or prone.

I also want to add a surrender addaction, but i'm guessing it will cause the same problem as the death, not being able to move from it.

Thanks in advance

Morts

Share this post


Link to post
Share on other sites

Hello,

first off I'm no expert, but the way I did this was with 3 triggers (which you could trigger from addActions, or just use the same commands in the addaction-sqf)

I have a soldier named p1, trigger 1 and 2 were activated by radio (for easy testing) all triggers were repeatable.

Trigger1: onAct: p1 switchmove "AdthPercMstpSrasWrflDb_8"

Trigger2: onAct: p1 switchMove "AinjPpneMstpSnonWrflDnon_rolltofront"; getup = true;

Trigger3: Condition: getup

Timer: 3 seconds (min,mid,max)

onAct: p1 switchMove "AmovPpneMstpSrasWrflDnon_AmovPercMstpSrasWrflDnon"; getup = false;

This worked for me, the first trigger makes him "die", second makes him roll over (but that anim wont let you move), and the 3rd (which is triggered after the roll by a timer) makes you stand up.

However, the die anim makes you fall on your back, (with the feet first) and the roll anim then moves you with your head first. So that looks a bit weird but you should be able to work around it. maybe with a p1 setDir (getDir p1)+180 or something. haven't looked into it.

But that worked for me. Hope you can use some of it.

As for your second question, I don't know.

But the third should be doable. using p1 switchMove ""; This will cancel the animation and should allow you to move. may not look pretty but yeah. or even playMove "" (maybe that will give a nicer transition?).

Also I'm sure there are some other people that will give much more delicate solutions than me.

Btw, is this for singleplayer or multiplayer? (just out of curiosity)

Kind regards

Melvin

Edited by MelvinNor
Spelling and syntax

Share this post


Link to post
Share on other sites

Cheers for that matey, i'll give it a try :D It's meant for multiplayer fro training missions. Using P:UKF BFA's so that you can decide when to "die" etc

Share this post


Link to post
Share on other sites

Okay I have the anims working, I changed the die anim so it doesn't look so weird, but i can't get the getup part to work?

I'm trying to script the whole thing so i don't have to name every player. I was thinking i would put something like:

 sleep 3;
getup = true

It doesn't seem to work though.

Cheers Morts

Share this post


Link to post
Share on other sites
Okay I have the anims working, I changed the die anim so it doesn't look so weird, but i can't get the getup part to work?

I'm trying to script the whole thing so i don't have to name every player. I was thinking i would put something like:

 sleep 3;
getup = true

It doesn't seem to work though.

Cheers Morts

if you're trying to use sleep in triggers then that won't work. I think that only works in scripts.

Maybe you forgot to change the triggers to repeatable?

The idea behind the getup = true (and then the getup = false) is just to be able to reactivate the 3rd trigger which allows you to get up. Trigger 2 and 3 are linked. so 2 will activate 3. and since we want to repeat them I think we have to set the condition for trigger 3 to false. (I may be wrong though)

The only problem I see with my solution is that if you're making a MP mission you will need a set of triggers for all the units that want to "fake their death", instead of one script that can be called by all of the players.

Kind Regards

Melvin

Share this post


Link to post
Share on other sites

I am putting it in one script, which is why i don't think that the getup is working.

Share this post


Link to post
Share on other sites
I am putting it in one script, which is why i don't think that the getup is working.

Getup isn't an action, it's just a variable I made to trigger the 3rd trigger. It could just as well have been monkeyrobsbank = true.

Or am I misunderstanding something?

Kind Regards

Melvin

Share this post


Link to post
Share on other sites

Oh, I thought getup was the actual command xD

What I meant was, that when the switchmove is done for "Get Up" The player cannot move, so far i have got it so that he can crawl forward. but they can't stand, keneel move sidewards or backwards

Share this post


Link to post
Share on other sites
What I meant was, that when the switchmove is done for "Get Up" The player cannot move, so far i have got it so that he can crawl forward. but they can't stand, keneel move sidewards or backwards

That's because the 2nd animation (the roll over from the back) is the "injured" roll from back, and it only allows you to crawl (like when you've been shot). The 3rd animation is the get up from laying and that allows you to move again (the animation I have placed in the 3rd trigger).

If you have it in a script then:

(2nd animation);

sleep 3;

(3rd animaztion);

Should do the trick, even though I don't know what your script looks like.

Regards

Melvin

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  

×