Jump to content
stormoffires

Fire Dancing script?

Recommended Posts

Not sure how to make this work, been trying to make a dance.sqf file and link it to my fire pit but all the scripts ive tried copying dont work. Anyone willing to share how they would set it up and what they would use?

Share this post


Link to post
Share on other sites

Stormoffires wanting a fire dancing script huh :)

 

What exactly do you want? People dancing around a campfire like natives?

If so, do you have the animation name yet?

 

Kind regards,

Sanchez 

Share this post


Link to post
Share on other sites

Sorry that was vague, i see that now. Probably not best to post when I'm tired. 

 

What I am trying to do is allow a player to walk up to a fire pit and select "Dance". Best I can tell is there is no native Arma 3 dance animation correct? So i will have to find a mod such as http://www.armaholic.com/page.php?id=20604 to bring them in, then if its on the server will anyone be able to use it without download or will they need to all have their own? thanks mates!

Share this post


Link to post
Share on other sites

This probably isn't what you are looking for, but I have to post it on a Fire Dancing thread!  The "dancing" in this video is simply repeating these two animations:

 

"Acts_AidlPercMstpSnonWnonDnon_warmup_2_out" 
"AmovPercMstpSlowWlnrDnon_AmovPercMstpSrasWlnrDnon"

 

One animation is head banging, and the other is lifting arms to the sky.  Script also moves them left and right during the animation.  Let me know if you want the script.

 

This clip captures the Mabunga Voodoo dancers...a unique cultural experience, possibly worthy of a PBS documentary.  See mission Property of Mabunga.

 

  • Like 16
  • Haha 1

Share this post


Link to post
Share on other sites

That will work! I might just figure out how to make my own animations but this would get me started on the script

 

  • Like 1

Share this post


Link to post
Share on other sites

Here's the script.  I put this code directly in the init.sqf for my sample mission for the video.  In the editor I created a campfire object and name it campfire1.  I then placed 12 AI units around the campfire (named those units dancer_1 through dancer_12.  So the code below executes a foreach loop on the 12 dancers, pairing each with a dance animation. The spawn code executed foreach dancer unit could be converted to a script or function, that you can call from an Action as a player approaches the fire.  You then call that script passing the player and the animation. 

 

You probably have to disable input on player or something so he can't leave the scripted animations until  you want him to.  Not sure about that.  Good luck.



FIRE_POS = getPos campfire1;  // campfire1 is name of campfire object placed in editor
{
    sleep .3;
    animateDude = _x spawn {
        sleep 1;
        _dancer = _this select 0;
        _move = _this select 1;
        //_dancer setmass 0;
        removeHeadgear _dancer;
        //removeAllWeapons _dancer;
        removeVest _dancer;
       
        _preyTypes = ["Rabbit_F","Cock_random_F","Snake_random_F","Snake_random_F"];
        if (_move == "AmovPercMstpSlowWlnrDnon_AmovPercMstpSrasWlnrDnon") then {
           _preyType = (_preyTypes call BIS_fnc_arrayShuffle) select 0;
           _rabbit = createAgent [_preyType, [0,0,0], [], 0, "NONE"];
           _rabbit enableCollisionWith _dancer;
           _rabbit setDir getdir _dancer;
           _zOffset = -.15;
           if (_preyType == "Snake_random_F") then {_zOffset = 0;};
          _rabbit attachTo [_dancer, [0.05,-.2,_zOffset],"LeftHand"];
           if (_preyType == "Snake_random_F") then {_rabbit setVectorDirAndUp [[0.2,0.1,0],[0,0,0]];};
         };
         
        _dirObj = "Land_CanOpener_F" createVehicle [10,10000,0];
        _dirObj enableSimulation False;
        _dirObj setpos FIRE_POS;
        _dirObj setPos (_dirObj modelToWorld [0,0,-2.5]);
        _dirTo = [FIRE_POS, getpos _dancer] call BIS_fnc_dirTo;
        _dirObj setDir _dirTo;
        _distance = _dancer distance _dirObj;
        //_vectorDirTo = [getposasl lunch, getposasl _dancer] call BIS_fnc_vectorFromXToY;
        _speed = 2;
        _startPos = getpos _dancer;
        _zVel = 0;
         while {true} do {
              _dancer switchMove _move;
              _dirTo = _dirTo + 2;
              if (_dirTo >= 360) then {_dirTo = _dirTo - 360;};
              _dirObj setDir _dirTo;
              if (_move in ["AmovPercMstpSlowWlnrDnon_AmovPercMstpSrasWlnrDnon"] ) then {
                 //_dancer setvelocity [velocity _dancer select 0, velocity _dancer select 1, 1];
                 _zVel = 1;
                  // get direction from dancer to next radial position form _dirObj;
                  _dirTo2 = [_dancer, _dirObj modelToWorld [0,_distance,0]] call BIS_fnc_dirTo;
                  _dancer setVelocity [_speed * sin(_dirTo2), _speed * cos(_dirTo2), _zVel];  
              } else {
                  _dancer setpos _startPos;
              };
               waitUntil {((animationState _dancer) != _move)};
              _dirObj setDir ([FIRE_POS, getpos _dancer] call BIS_fnc_dirTo);
              sleep .2;
        };
    };
// Foreach loop uses array of pre-placed dancer AI units, and the dance move for each one to play
} foreach [    [dancer_1,"AmovPercMstpSlowWlnrDnon_AmovPercMstpSrasWlnrDnon"],
               [dancer_2,"Acts_AidlPercMstpSnonWnonDnon_warmup_2_out"], //
               [dancer_3,"AmovPercMstpSlowWlnrDnon_AmovPercMstpSrasWlnrDnon"],
               [dancer_4,"Acts_AidlPercMstpSnonWnonDnon_warmup_2_out"],
               [dancer_5,"AmovPercMstpSlowWlnrDnon_AmovPercMstpSrasWlnrDnon"],
               [dancer_6,"Acts_AidlPercMstpSnonWnonDnon_warmup_2_out"], //
               [dancer_7,"AmovPercMstpSlowWlnrDnon_AmovPercMstpSrasWlnrDnon"],
               [dancer_8,"Acts_AidlPercMstpSnonWnonDnon_warmup_2_out"],
               [dancer_9,"AmovPercMstpSlowWlnrDnon_AmovPercMstpSrasWlnrDnon"],
               [dancer_10,"AmovPercMstpSlowWlnrDnon_AmovPercMstpSrasWlnrDnon"], //
               [dancer_11,"AmovPercMstpSlowWlnrDnon_AmovPercMstpSrasWlnrDnon"],
               [dancer_12,"AmovPercMstpSlowWlnrDnon_AmovPercMstpSrasWlnrDnon"]
               ];

Share this post


Link to post
Share on other sites

Awesome thanks when I get a chance I want to test some things. Do you think I can swap " dancer_1-12" for just "player" ? Be cool to make it so any player approaching the fire is forced to dance? Maybe link a trigger to a dance.sqf? 

execVM "dance.sqf"

Share this post


Link to post
Share on other sites

That's what I was getting at.  Take the code inside the loop that is spawned and make it a script or function.  Currently that spawned code is passed each dancer one at a time via the foreach loop.  If you make that code a script, you call it once passing the player, and which animation you want him to play.  Tweak it until it does what you want.

_nul = [player,"someAnimationName"] execVM "dance.sqf"

 

  • Like 1

Share this post


Link to post
Share on other sites
18 hours ago, johnnyboy said:

This clip captures the Mabunga Voodoo dancers...a unique cultural experience, possibly worthy of a PBS documentary.  See mission Property of Mabunga.

I've seen this video so many times but it's still amazing. :thumb:

  • Like 2

Share this post


Link to post
Share on other sites

Hi @johnnyboy 

 

i'm using this epic script in a mission im building at the moment.... 

 

i need a bit of help..

 

the script has them doing there thing and then rotating around, how do i go about just getting them to stand in one place and do the offerings or whatever it is that they are doing, i still want them to bow and raise up the animals just not rotate arround the fire

 

cheers

Share this post


Link to post
Share on other sites

@PSYKO_nz:  I'm glad you're enjoying the script.

 

Try replacing the while loop in the code posted above with this while loop instead:

while {true} do 
{
    _dancer switchMove _move;
    waitUntil {((animationState _dancer) != _move)};
    sleep .2;
};

This new loop has all the setVelocity and setDir code removed, so dancers should be playing animation only (and not moving left and right).  You may need to set the direction of the dancers individually via the editor to get your desired look.

Share this post


Link to post
Share on other sites

its looking good to me, i have some pics of it, and an error that's popping up, but i can't get the images to load on the forums, looks epic so far tho

 

thanks heaps for your help! 

 

One Problem!!!!!

 

i need to be able to kill them

 

at the moment they are gods.

 

also i need the script to stop running when they are all dead, is this possible?

Share this post


Link to post
Share on other sites
On 16.1.2017 at 9:33 PM, johnnyboy said:

This probably isn't what you are looking for, but I have to post it on a Fire Dancing thread!  The "dancing" in this video is simply repeating these two animations:

 

"Acts_AidlPercMstpSnonWnonDnon_warmup_2_out" 
"AmovPercMstpSlowWlnrDnon_AmovPercMstpSrasWlnrDnon"

 

One animation is head banging, and the other is lifting arms to the sky.  Script also moves them left and right during the animation.  Let me know if you want the script.

 

This clip captures the Mabunga Voodoo dancers...a unique cultural experience, possibly worthy of a PBS documentary.  See mission Property of Mabunga.

 

 

Oh my god, I just see this. So awesome.The best shit I've seen in a long time.

  • Like 2

Share this post


Link to post
Share on other sites
2 hours ago, PSYKO_nz said:

its looking good to me, i have some pics of it, and an error that's popping up, but i can't get the images to load on the forums, looks epic so far tho

 

thanks heaps for your help! 

 

One Problem!!!!!

 

i need to be able to kill them

 

at the moment they are gods.

 

also i need the script to stop running when they are all dead, is this possible?

I don't see any code in there that makes them invincible, but try changing this line:

while {true} do {

to this:

while {alive _dancer} do {

So the loop ends for each dancer when they are dead.  I'm guessing your problem is that switchmove is working on the dancer even if he is dead.  I don't know if that is possible or not...

 

To make it more realistic, the loop should stop as soon as one is killed, or if they know about an enemy.  So you could add other conditions to the while {} condition to stop dancing if some other condition is true.

Share this post


Link to post
Share on other sites
33 minutes ago, lexx said:

Oh my god, I just see this. So awesome.The best shit I've seen in a long time.

Thanks bro.  That was really fun and satisfying to make.

Share this post


Link to post
Share on other sites

your going to like this....

 

so i tried this 

while {alive _dancer} do { and it worked (no surprise)

what was happening is that they die but cause of the anim they get back up and carry on....

 

BUT

 

i changed while {alive _dancer} do { to while {alive priest} do {

 

priest is the guy who's praying/sacrificing on the fire at the alter, so as long as hes alive the dancers keep getting back up with their offerings. as soon as hes dead the ones who are dead fall down and the ones who are still alive go back to normal, as if the trance has been broken hahahaha

 

epic

 

now to test on the server!

 

fingers crossed it all works, thanks so much for your help bro!

  • Like 1

Share this post


Link to post
Share on other sites
5 hours ago, PSYKO_nz said:

now to test on the server!

 

fingers crossed it all works, thanks so much for your help bro!

switchMove will not work on server, it has local effect

Share this post


Link to post
Share on other sites
16 hours ago, johnnyboy said:

@PSYKO_nz sounds beautiful dude.  I hope you post a vid of this!

 

here ya go!!

 

its not finished but here is the cor of what ive done

 

 

 

12 hours ago, M1ke_SK said:

switchMove will not work on server, it has local effect

i tested it on server last night, looked like it worked to me. i will check with more players to make sure!!! thanks for the warning

  • Like 2

Share this post


Link to post
Share on other sites

@PSYKO_nz, you kiwi evil genius, I love it.  This looks like a very interesting mission you are brewing up.  I suggest detaching all the animals when priest is killed, so followers drop them.  Love the volcano.

Share this post


Link to post
Share on other sites

hahaha thanks bro!

 

credit to @aliascartoons for the volcano script, i'm just assembling it together for a mission haha

 

how do i make them drop the animals? i think that would be perfect. other issue is how do i make the script running when the volcano blows? regardless of the priest being dead or not?

 

getting close to finishing it all up. NZArmA will be playing it next weekend then ill strip our units out and put it on steam for you :)

Share this post


Link to post
Share on other sites

Cool.  You can detach animals by repeating this code for each dancer:

{
  detach _x;
} forEach attachedObjects dancer_1;

 

Share this post


Link to post
Share on other sites

played the mission on sunday. went so well, everything worked.

 

over the next few days or weeks ill take out our content and make it as basic as i can, rhs, ace etc and upload to steam and post a link here!

 

keep an eye out

  • Like 3

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

×