Jump to content
novainfuse

What am I missing with MP and animations?

Recommended Posts

Trying to get this animation to run on an AI on my mission:

 

Quote

Acts_Onchair_Dead

 

I've been looking around, but all the solutions don't seem to work.

 

This is in the init field:

this disableAI "ANIM"; this disableAI "MOVE"; if (isServer) then {[[this,"Acts_Onchair_Dead"],BIS_fnc_ambientAnim ] remoteExec ["call"] };

This one from the wiki also doesn't seem to get the job done:
 

if (isServer) then { [[this,"SIT2"],BIS_fnc_ambientAnim ] remoteExec ["call"] };

 

However, nothing seems to work. I also tried putting it in a waypoint (giving the unit a name, and changing the "this" to the unit name). That waypoint was also repeated.

 

This seems to be the case for most of the animations found in the animation viewer (specifically under "cut scene").

 

Share this post


Link to post
Share on other sites

Try:

_unit playMove "Acts_Onchair_Dead";

 

playMove

switchMove

switchAction

 

or try one of the above until one works.

 

I haven't really taken the time to figure out when you should be using which, or what ambientAnimations are really for.

But i managed to get an AI unit to do a briefing animation using playmove.

 

Note that "Acts_Onchair_Dead" isn't included on the list of ambient animations on the BIS wiki

Share this post


Link to post
Share on other sites

Thinking about it, you'd probably have to loop the animation endlessly if you were using playMove/switchAction/switchMove.

I guess that's what ambientAnimations are about; you enter them and stay in them until interrupted.

 

Afraid I can't help you with those though.

Share this post


Link to post
Share on other sites

In InitServer.sqf:

 

sleep 0.5;
{unit1 disableAI _x} foreach ["AUTOTARGET","TARGET","MOVE","PATH"];
[unit1, "Acts_Onchair_Dead"] remoteExec ["switchMove", 0];

or

sleep 0.5;
{unit1 disableAI _x} foreach ["AUTOTARGET","TARGET","MOVE","PATH"];
[unit1, "Acts_Onchair_Dead"] remoteExec ["switchMove", 0, true];

to work for JIP players too.

 

Also you can use my old script I wrote in ARMA 2 and still use in ARMA 3 missions

 

Animator.sqf:

 

//SCRIPT BY JTS

private ["_Soldier","_Azimut","_Anim"];

if (isServer) exitWith
{
	for [{_i = 0},{_i <= count _this},{_i = _i + 1}] do
	{
		_Soldier = (_this select _i) select 0;
		_Azimut = (_this select _i) select 1;
		_Anim = (_this select _i) select 2;
	
		if (!isNil "_Soldier") then
		{
			if (!isNull _Soldier) then
			{
				if (alive _Soldier) then
				{
					_Soldier setdir _Azimut;
					//[objnull, _Soldier, rSwitchmove, _Anim] call RE --- ARMA 2
					[_Soldier, _Anim] remoteExec ["switchMove", 0];
				};
			};			sleep 0.05
		};
	};
};

 

Run it like: [[unit, azimuth, animationName]] execVM "Animator.sqf".

 

Example:

 

[
[act_1,getDir act_1,"Acts_Onchair_Dead"],
[act_2,getDir act_2,"Acts_Onchair_Dead"],
[act_3,getDir act_3,"Acts_Onchair_Dead"],
[act_4,getDir act_4,"Acts_Onchair_Dead"],
[act_5,getDir act_5,"Acts_Onchair_Dead"]
] execVM "Animator.sqf";

Share this post


Link to post
Share on other sites

Read the documentation.

1 you don't need to disableAI anything

2 you don't need to creat a loop

3 Bis_fnc_AmbientAnim is different from bis_fnc_AmbientAnimCombat. The unit stays in animation unitl death, except if you're scripting some "termination" (see example on BIKI page)

4 These both functions apply on a bunch of predefined anims only.

5 As far as you want to seat a unit on a chair, use an helper.

 

Share this post


Link to post
Share on other sites
20 hours ago, pierremgi said:

1 you don't need to disableAI anything

 

You never know what BIS will change in animations. What if they change that animation, so the AI can escape it? What about his head, which is moving around? I use disableAI on AI units to be sure, that this'll never happens in animations. Not long time ago I had some issues with some animations, which worked fine before. Some animations also even heavily reduced fps

  • Confused 1

Share this post


Link to post
Share on other sites
1 hour ago, jts_2009 said:

 

You never know what BIS will change in animations. What if they change that animation, so the AI can escape it? What about his head, which is moving around? I use disableAI on AI units to be sure, that this'll never happens in animations. Not long time ago I had some issues with some animations, which worked fine before. Some animations also even heavily reduced fps

Are you sure you weren't looping in unscheduled or something?

Plus, BIS hasn't changed anything in regards to how switchMove, playMove, and any of the gesture commands work with units.

The rtm animation controls the movement of the head, the body, the everything once played.  so if the unit moves  their head it's a part of the anim.

Do you mind showing us what "worked before" ?

Share this post


Link to post
Share on other sites
38 minutes ago, Midnighters said:

Are you sure you weren't looping in unscheduled or something?

Plus, BIS hasn't changed anything in regards to how switchMove, playMove, and any of the gesture commands work with units.

The rtm animation controls the movement of the head, the body, the everything once played.  so if the unit moves  their head it's a part of the anim.

Do you mind showing us what "worked before" ?

 

I had some issues, but on players. But tested on AI - it doesn't works too anymore. As one example that anim: Acts_welcomeOnHUB01_PlayerWalk_3

I used this in my coop in cut scene. But the player got stuck in this animation. The only solution was to use some animations with playmove: player playmove "AmovPercMstpSlowWrflDnon"; the AI stuck also too. Not sure about another similar anims, but I think they're bugged too

 

I also got low fps if I use these anims on AI:

 

"Acts_AidlPercMstpSloWWrflDnon_warmup_1_loop"
 "Acts_AidlPercMstpSloWWrflDnon_warmup_2_loop"
 "Acts_AidlPercMstpSloWWrflDnon_warmup_3_loop"
 "Acts_AidlPercMstpSloWWrflDnon_warmup_4_loop"
 "Acts_AidlPercMstpSloWWrflDnon_warmup_5_loop"

 

Not tested on players

Share this post


Link to post
Share on other sites
On 03/12/2017 at 8:52 AM, novainfuse said:

Trying to get this animation to run on an AI on my mission:

 

 

I've been looking around, but all the solutions don't seem to work.

 

This is in the init field:


this disableAI "ANIM"; this disableAI "MOVE"; if (isServer) then {[[this,"Acts_Onchair_Dead"],BIS_fnc_ambientAnim ] remoteExec ["call"] };

This one from the wiki also doesn't seem to get the job done:
 


if (isServer) then { [[this,"SIT2"],BIS_fnc_ambientAnim ] remoteExec ["call"] };

 

However, nothing seems to work. I also tried putting it in a waypoint (giving the unit a name, and changing the "this" to the unit name). That waypoint was also repeated.

 

This seems to be the case for most of the animations found in the animation viewer (specifically under "cut scene").

 

To put only the animation without it waking up when seeing an enemy put this line in the Init unit:


if (isServer) then {[this, "NAME_ANIMATION","ASIS"];}  call BIS_fnc_ambientAnim;

To end the animation and drive react to the environment:

_unit call BIS_fnc_ambientAnim__terminate; 

Or for the group:

{_x call BIS_fnc_ambientAnim__terminate;} foreach units _grupName;

Here types of animations supported by this command:

https://community.bistudio.com/wiki/BIS_fnc_ambientAnim

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

×