Dancing Script?

how would i go about adding more songs to this? i found a couple tuts on it but they are confusing... can anyone point me in the right direction for a tut that is kinda simple?


class CfgSounds
{
sounds[] =
{
introSong
};
class introSong
{
name="introSong";
sound[]={introSong.ogg,0.9,1};
titles[] = {};
};
};


never mind i found it buried on the blur custom spawn thread.... i feel like a noob..(probably cause i am)
 
Last edited:
I am trying to make the song play only once. its kind of annoying when 4 people at one fire all start dancing, making the song all jumbled.

I tried this if statement

if (!_isstarted)
then {
_nul = [objNull, player, rSAY, "fox"] call RE;
_isstarted = true;
sleep 50;
_isstarted = false;
};

Code:
private["_ent"];
_ent = _this select 3;
player removeAction s_player_dance;
s_player_dance = -1;


_danceMoves = ["ActsPercMstpSnonWnonDnon_DancingDuoStefan","ActsPercMstpSnonWnonDnon_DancingDuoIvan","ActsPercMstpSnonWnonDnon_DancingStefan"] call BIS_fnc_selectRandom;

if (!_isstarted)
    then {
        _nul = [objNull, player, rSAY, "fox"] call RE;
        _isstarted = true;
        sleep 50;
        _isstarted = false;
    };
  
player playMove _danceMoves;
cutText ["RedneX in da house !!","PLAIN DOWN"];

r_interrupt = false;
_animState = animationState player;
r_doLoop = true;

_finished = false;
_started = false;
    while {r_doLoop} do {
        _animState = animationState player;
        _isDancing = [_danceMoves,_animState] call fnc_inString;
        if (_isDancing) then {
            _started = true;
        };
        if (_started and !_isDancing) then {
            r_doLoop = false;
            _finished = true;
        };
        if (r_interrupt) then {
            r_doLoop = false;
        };
        sleep 0.1;
    };
    r_doLoop = false;
if (_finished) then {
cutText ["WTF are you doing bro ?","PLAIN DOWN"];
} else {
r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
cutText ["Dance stopped! ;(","PLAIN DOWN"];
};

The issue I have come up to is that it doesnt play the song at all now. Does anyone know where i went wrong?
 
I am trying to make the song play only once. its kind of annoying when 4 people at one fire all start dancing, making the song all jumbled.

I tried this if statement

if (!_isstarted)
then {
_nul = [objNull, player, rSAY, "fox"] call RE;
_isstarted = true;
sleep 50;
_isstarted = false;
};

Code:
private["_ent"];
_ent = _this select 3;
player removeAction s_player_dance;
s_player_dance = -1;


_danceMoves = ["ActsPercMstpSnonWnonDnon_DancingDuoStefan","ActsPercMstpSnonWnonDnon_DancingDuoIvan","ActsPercMstpSnonWnonDnon_DancingStefan"] call BIS_fnc_selectRandom;

if (!_isstarted)
    then {
        _nul = [objNull, player, rSAY, "fox"] call RE;
        _isstarted = true;
        sleep 50;
        _isstarted = false;
    };

player playMove _danceMoves;
cutText ["RedneX in da house !!","PLAIN DOWN"];

r_interrupt = false;
_animState = animationState player;
r_doLoop = true;

_finished = false;
_started = false;
    while {r_doLoop} do {
        _animState = animationState player;
        _isDancing = [_danceMoves,_animState] call fnc_inString;
        if (_isDancing) then {
            _started = true;
        };
        if (_started and !_isDancing) then {
            r_doLoop = false;
            _finished = true;
        };
        if (r_interrupt) then {
            r_doLoop = false;
        };
        sleep 0.1;
    };
    r_doLoop = false;
if (_finished) then {
cutText ["WTF are you doing bro ?","PLAIN DOWN"];
} else {
r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
cutText ["Dance stopped! ;(","PLAIN DOWN"];
};

The issue I have come up to is that it doesnt play the song at all now. Does anyone know where i went wrong?

change the sound call to:
Code:
playsound "fox";

it will play it locally for the player only, not so other people can hear.

also make sure you have this

Code:
class CfgSounds
{
    sounds[] =
    {
    fox
    };
    class fox
    {
    name="fox";
    sound[]={fox.ogg,0.9,1};
    titles[] = {};
    };
};
 
So this script here should only play once per song, checks distance of other people to fire aswell.

Code:
private["_ent"];
player removeAction s_player_dance;
s_player_dance = -1;
_danceMoves = ["ActsPercMstpSnonWnonDnon_DancingDuoStefan","ActsPercMstpSnonWnonDnon_DancingDuoIvan","ActsPercMstpSnonWnonDnon_DancingStefan"] call BIS_fnc_selectRandom;
_neardanceing = false;
_nearestplayers = nearestObjects [player, ["CAManBase"], 50];
_cntnearestplayer = count _nearestplayers;
if (_cntnearestplayer > 0) then {
{
        _model = typeOf _x;
        if (_model in AllPlayers) then {
        _vari = _x getVariable["danceing",0];
                if !(_vari == 0) then {
                _neardanceing = true;
                };
        };
} foreach _nearestplayers;
};
if !(_neardanceing) then {
_nul = [objNull, player, rSAY, "fox"] call RE;
player setVariable ["danceing", 1, true];
};
player playMove _danceMoves;
cutText ["RedneX in da house !!","PLAIN DOWN"];
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_finished = false;
_started = false;
    while {r_doLoop} do {
        _animState = animationState player;
        _isDancing = [_danceMoves,_animState] call fnc_inString;
        if (_isDancing) then {
            _started = true;
        };
        if (_started and !_isDancing) then {
            r_doLoop = false;
            _finished = true;
        };
        if (r_interrupt) then {
            r_doLoop = false;
        };
        sleep 0.1;
    };
    r_doLoop = false;
if (_finished) then {
cutText ["WTF are you doing bro ?","PLAIN DOWN"];
player setVariable ["danceing", nil, true];
} else {
r_interrupt = false;
player setVariable ["danceing", nil, true];
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
cutText ["Dance stopped! ;(","PLAIN DOWN"];
};
 
Back
Top