Jump to content
Gilatar

Wounded Sitting and Leaning animation

Recommended Posts

Hello, guys. I've been toying around with mission making and I wanted to have an HVT sitting wounded backed up against a wall, like in

video.

The closest thing I can find to this, however, is an animation where the charater is prone on the ground, and not leaning up against a wall - ""PRONE_INJURED_U1-2"" and ""PRONE_INJURED".

Can anyone help me with this?

Thanks on beforehand!

Share this post


Link to post
Share on other sites

You can normally find that kind of animation by filtering for 'cutscene' in the animation viewer. The ones you want are "Acts_SittingWounded_out" and similar. The others are probably _in and _loop, I happened to have that one noted down.

Share this post


Link to post
Share on other sites
You can normally find that kind of animation by filtering for 'cutscene' in the animation viewer. The ones you want are "Acts_SittingWounded_out" and similar. The others are probably _in and _loop, I happened to have that one noted down.

Thanks! That appears to be the animation I want, however, I can't get it to work in-game. Do I need a special type of code for it?

This is the code I'm using on the init line:

[this,"Acts_sittingWounded_loop"] call BIS_fnc_ambientAnim;

It does not change the animation and the character is simply standing like normal. The same code works for "PRONE_INJURED" and other animations, but not for "Acts_sittingWounded_xxx" types.

Share this post


Link to post
Share on other sites

The ambientAnim function uses a few sets of specific animations, you can't use it for everything. This is what you do:

unit switchMove "Acts_SittingWounded_loop";

Or if you want to put it in the unit's init:

0 = this spawn {waitUntil {time > 0}; _this switchMove "Acts_SittingWounded_loop"};

The unit might still be able to turn or the animation might end, so you might have to put this in the init:

{this disableAI _x} forEach ["ANIM", "TARGET", "AUTOTARGET", "MOVE"];

Share this post


Link to post
Share on other sites
The ambientAnim function uses a few sets of specific animations, you can't use it for everything. This is what you do:

unit switchMove "Acts_SittingWounded_loop";

Or if you want to put it in the unit's init:

0 = this spawn {waitUntil {time > 0}; _this switchMove "Acts_SittingWounded_loop"};

The unit might still be able to turn or the animation might end, so you might have to put this in the init:

{this disableAI _x} forEach ["ANIM", "TARGET", "AUTOTARGET", "MOVE"];

I'm still very new to mission making in ArmA, and especially scripting, so bear with me!

That works excellently though. Thank you so much!

---------- Post added at 11:55 ---------- Previous post was at 10:04 ----------

The ambientAnim function uses a few sets of specific animations, you can't use it for everything. This is what you do:

unit switchMove "Acts_SittingWounded_loop";

Or if you want to put it in the unit's init:

0 = this spawn {waitUntil {time > 0}; _this switchMove "Acts_SittingWounded_loop"};

The unit might still be able to turn or the animation might end, so you might have to put this in the init:

{this disableAI _x} forEach ["ANIM", "TARGET", "AUTOTARGET", "MOVE"];

I seem to be having an odd issue where the animations only work in the editor and not when I load up the map in multiplayer. Is there a reason for this?

Share this post


Link to post
Share on other sites

If you want to use animations in MP, you would have to name the unit a specific name, and including this into the call for animation (I.E. "ai1").

Place a switch-trigger on the AI's position, with a countdown on like "MIN:1, MED:2, MAX:3" (Maximum 3 seconds before initializing), with BLUFOR (or whatever faction the AI is) present, calling for an external script (like "[this] execVM "scripts\ai1.sqf";", in the "ON ACT" section. In this case, when the trigger has initialized, it will begin looking for that file, in the "scripts" folder, in the specific mission-folder.

(basically, just put the script into the missions folder, in an SQF format naming it like "ai1", "ai2" etc.).

Then you should be able to see the animation after those 2-3 seconds.

*Make sure, if you have multiple AIs running an animation, to have different unique countdowns. The scripts will stress the system, causing the animations to break otherwise. So "ai2"'s trigger's countdown should be set to 4,5,6 and so forth. Decimals should also work.

Hope this helps.

Share this post


Link to post
Share on other sites
If you want to use animations in MP, you would have to name the unit a specific name, and including this into the call for animation (I.E. "ai1").

Place a switch-trigger on the AI's position, with a countdown on like "MIN:1, MED:2, MAX:3" (Maximum 3 seconds before initializing), with BLUFOR (or whatever faction the AI is) present, calling for an external script (like "[this] execVM "scripts\ai1.sqf";", in the "ON ACT" section. In this case, when the trigger has initialized, it will begin looking for that file, in the "scripts" folder, in the specific mission-folder.

(basically, just put the script into the missions folder, in an SQF format naming it like "ai1", "ai2" etc.).

Then you should be able to see the animation after those 2-3 seconds.

*Make sure, if you have multiple AIs running an animation, to have different unique countdowns. The scripts will stress the system, causing the animations to break otherwise. So "ai2"'s trigger's countdown should be set to 4,5,6 and so forth. Decimals should also work.

Hope this helps.

Thanks for your help, but I'm still having an issue with this.

I keep getting an error when I put "[this] execVM "scripts\ai1.sqf";" in the ON ACT-section. It says "Type Script, expected Nothing".

Completely puzzled by this. I have a feeling the actual script file itself is not correct. What should I put in it?

Right now I just put the same thing in there as I did in the inital trigger:

unit switchMove "Acts_SittingWounded_loop";

Share this post


Link to post
Share on other sites

For the record, if anyone's interested, I figured this out.

Instead of using

"[this] execVM "scripts\ai1.sqf";

I used:

null = execVM "scripts/ai1.sqf";

And it works. Thanks for everyone's help.

Share this post


Link to post
Share on other sites

For dedicated.

[ [ myUnit, "Acts_SittingWounded_loop" ], "switchMove" ] call BIS_fnc_MP; 

Share this post


Link to post
Share on other sites
Thanks for your help, but I'm still having an issue with this.

I keep getting an error when I put "[this] execVM "scripts\ai1.sqf";" in the ON ACT-section. It says "Type Script, expected Nothing".

I see that you got it to work, but just so it's actually written down somewhere so that people in the future who stumble on this thread will see it, script handles are required in the initialization lines in the editor. Otherwise you get that error.

Also, if you don't really care to save the script handle you can just use '0 = [] execVM "myscript.sqf"' the game will let you do this, but since numbers can't be variables, it is not overwritten and the script handle is not saved at all.

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

×