Jump to content

Recommended Posts

Hello,

 

I have this script:

[this,"BRIEFING_POINT_TABLE"] call BIS_fnc_ambientAnim;

Within a units init. This works fine. However. I want the unit to 

sleep = 10;

So, I created: cmdr_briefing.sqf

Changed the units init to:

this = execVM "cmdr_briefing.sqf";

Am I doing anything worng here?

I then have inside cmdr_briefing.sqf:

CMDR // unit name
sleep 10; //wait for 10 seconds
[CMDR,"BRIEFING_POINT_TABLE"] call BIS_fnc_ambientAnim; // do animation

// Is this correct?

*Yes the CMDR is case-sensitive.

 

Any help is greatly appreciated.

 

Linked YouTube Video: Unlisted.

 

Share this post


Link to post
Share on other sites

Your approach is bad because it requires a global variable and a separate script for each and every character animation. Better you can make script more universal and use same script in all cases:

// in universal_anim_script.sqf
params ["_unit", "_anim", "_delay"];
sleep _delay;
[_unit, _anim] call BIS_fnc_ambientAnim;


// in unit init field
_temp = [this, "BRIEFING_POINT_TABLE", 10] execVM "universal_anim_script.sqf"

* init field code fixed

Share this post


Link to post
Share on other sites

This: 

// in unit init field
[this, "BRIEFING_POINT_TABLE", 10] execVM "universal_anim_script.sqf"

I tried with and without the ; at the end.

 

Doesn't work.

 

 

Share this post


Link to post
Share on other sites

Oh, arma is sometimes capricious. Fixed variant:

_temp = [this, "BRIEFING_POINT_TABLE", 10] execVM "universal_anim_script.sqf"

Semicolon is required only when you need to separate from each other a few commands. Also, CMDR variable is no longer needed, it can be removed.

Share this post


Link to post
Share on other sites

Personally, I would have done it this way (for perspective's sake):

 

In commanders init:

nul = this spawn {
	sleep 10;
	[_this,"BRIEFING_POINT_TABLE"] call BIS_fnc_ambientAnim;
};

 

  • Like 1

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

×