Jump to content
froggyluv

Trying to pass elements over to BIS_fnc_ambientAnim__terminate

Recommended Posts

Using the example provided by the WIKI

 

Quote

[this,"SIT2"] call BIS_fnc_ambientAnim;
0 = this spawn {waitUntil {behaviour _this == "combat"}; _this call BIS_fnc_ambientAnim__terminate;}

 

 Works great when placed into individual map placed units but Id like to have the ability to have master control over the whether they spawn in mass or just walk into a certain area.

A.

_this = _this select 0;
[_this,"SIT2"] call BIS_fnc_ambientAnim;
0 = _this spawn waitUntil {behaviour _this == "combat"};
 [_this] call BIS_fnc_ambientAnim_terminate;
 

 Doesnt Work

 

B.
{[_x "SIT2"] call BIS_fnc_ambientAnim;
0 = [_x] spawn {waitUntil {behaviour _x == "combat"};
 [_x] call BIS_fnc_ambientAnim_terminate}} foreach thisList
 

 Also getting Undefined errors on this.

Share this post


Link to post
Share on other sites
11 hours ago, froggyluv said:

_this = _this select 0;
[_this,"SIT2"] call BIS_fnc_ambientAnim;
0 = _this spawn waitUntil {behaviour _this == "combat"};
 [_this] call BIS_fnc_ambientAnim_terminate;

Hello there my stylin' 70s amphibian brother...

 

I'm not sure what your issue is, but see 2 odd things.  

 

_this = _this select 0;   // Is it a good idea to override  the _this input parameter like that?

 

And your terminate call is not within the spawn brackers {}, so it looks to me like anim is terminated immediately (its not waiting for the spawned behaviour check).

Share this post


Link to post
Share on other sites

 

Hey JDawg -yeah sorry was pretty sloppy late nite ^^

 

 So pretty much what Im tryna do is have a base full of soldiers with different animations that switch off when Danger mode comes in. They have a Combat Animation type in which they already do that but the list is very small

 

 

Share this post


Link to post
Share on other sites

Too much [ ] !

_this refers to a single unit (here) No need to wrap it in [ ] then ask for _this select 0 (first element of the array)

[_this] is useless, because   _this    is always the whole parameter(s)  (unique or array) . As you can see in workable example:   _this   is OK.

 

this   (without underscore) is a "magic" variable referring to the object/unit and wrote in its init field.

 

_x is also a specific variable inside a forEach loop.

You can:  { _x spawn {some code with _myLocalThing = _this  (as passed parameter) ... }  } forEach (an array);

 

  • Thanks 1

Share this post


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

Hey JDawg -yeah sorry was pretty sloppy late nite ^^

Dude, remember:  Don't drink and code.  Don't drink and post.

 

Lessons the old JDawg had to learn the hard way...:drinking:

  • Like 1

Share this post


Link to post
Share on other sites
36 minutes ago, johnnyboy said:

Dude, remember:  Don't drink and code.  Don't drink and post.

 

Lessons the old JDawg had to learn the hard way...:drinking:

 

Nobody can hold Frogs down 

 

:drinking2:

  • Like 2

Share this post


Link to post
Share on other sites

You will have to wait for Ego mod... it has a picture of me and Frogs in the backstreets of Kavala... repping for all the Gangstarrs ;)

  • Haha 1

Share this post


Link to post
Share on other sites

 

@pierremgi  as usual i was overcomplicating things unknown syntax tends to do that to me

 

 So in the Debug: {IF (side _x == east) then {[_x, "SIT", "light"] call BIS_fnc_ambientAnim;}} foreach allunits;  
 { _x spawn Frog_TerminateMeArnold} forEach allUnits

 

 Frog_TerminateMeArnold = {
                                                  waitUntil  {behaviour _this == "combat"};
                                                  _this call BIS_fnc_ambientAnim__terminate

                                                       };

 

Is working!! Obviously AllUnits will be slimmed down and a sleep added but just wanted to get it up and running. Thanks again man I dont always get your stuff at first but it usually sends me down the right direction.

 

@BunchaMooks: Cmon guys Im way studlier than that think....

                                                                                                                 

 

lol just watched that Fink video - disturbing yet mildly arousing...?...Beerfest haha takes me back to Super Troopers

  • Like 2

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

×