Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
davidoss

Release: Falling screams

Recommended Posts

Adds scary screams while falling down.

 

usage:
place scripts directory in your mission root directory
add lines in:

init.sqf

if (hasInterface) then {
    0 = [] spawn compile preprocessFileLineNumbers "scripts\lib_fallingscream\fallingscream.sqf";
};

description.ext
 

class CfgSFX
{

    class fall_scream
    {
        sound0[] = {"scripts\lib_fallingscream\sounds\scream_0.ogg", db-0, 1.0, 100, 0.2, 99, 99, 99};
        sound1[] = {"scripts\lib_fallingscream\sounds\scream_1.ogg", db-0, 1.0, 100, 0.2, 99, 99, 99};
        sound2[] = {"scripts\lib_fallingscream\sounds\scream_2.ogg", db-0, 1.0, 100, 0.2, 99, 99, 99};
        sounds[] = {sound0,sound1,sound2};
        empty[] = {"", 0, 0, 0, 0, 0, 0, 0};
    };
};

class CfgVehicles
{
    class player_fall_scream
    {
        sound = "fall_scream";
    };

};

 

 

 

 

script overwiev:

fallingscream.sqf

 

/*
by DaVidoSS
falling screeams

usage:
place scripts directory in your mission root directory
add lines in:

init.sqf

if (hasInterface) then {
	0 = [] spawn compile preprocessFileLineNumbers "scripts\lib_fallingscream\fallingscream.sqf";
};

description.ext

class CfgSFX
{

	class fall_scream
	{
		sound0[] = {"scripts\lib_fallingscream\sounds\scream_0.ogg", db-0, 1.0, 100, 0.2, 99, 99, 99};
		sound1[] = {"scripts\lib_fallingscream\sounds\scream_1.ogg", db-0, 1.0, 100, 0.2, 99, 99, 99};
		sound2[] = {"scripts\lib_fallingscream\sounds\scream_2.ogg", db-0, 1.0, 100, 0.2, 99, 99, 99};
		sounds[] = {sound0,sound1,sound2};
		empty[] = {"", 0, 0, 0, 0, 0, 0, 0};
	};
};

class CfgVehicles
{
	class player_fall_scream 
	{
		sound = "fall_scream";
	};

};

*/


if !(hasInterface) exitWith {};
waitUntil {!isNull player};
waitUntil {player == player};

player setVariable ["hasFallen",false]; 
player addEventHandler ["AnimChanged", { 
	  
	params [["_unit",objNull,[objNull]], ["_anim","",[""]]]; 
	private _fallanims = [ 
		toLower "AfalPercMstpSrasWpstDnon", 
		toLower "AfalPercMstpSrasWrflDnon", 
		toLower "AfalPercMstpSrasWlnrDnon", 
		toLower "AfalPercMstpSnonWnonDnon", 
		toLower "AfalPknlMstpSrasWpstDnon", 
		toLower "AfalPknlMstpSrasWrflDnon", 
		toLower "AfalPknlMstpSrasWlnrDnon", 
		toLower "AfalPknlMstpSnonWnonDnon", 
		toLower "AfalPpneMstpSrasWpstDnon", 
		toLower "AfalPpneMstpSrasWrflDnon", 
		toLower "AfalPpneMstpSnonWnonDnon" 
	]; 
	 
	if !(toLower _anim in _fallanims) exitWith {}; 
	if (_unit getVariable "hasFallen") exitWith {};
		
	private _hight = ((getPosATl _unit) # 2); 
		
	if (_hight > 6) then { 
		0 = [_unit,_hight] spawn { 
			params [["_unit",objNull,[objNull]], ["_hight",0,[0]],["_scream",objNull,[objNull]]]; 
			sleep .3; 
			private _hight2 = ((getPosATl _unit) # 2); 
			if (_hight > _hight2) then { 
				_scream = createSoundSource ["player_fall_scream", _unit, [], 0]; 
				_scream attachTo [_unit, [0,0,-0.1], "head"]; 
				_unit setVariable ["hasFallen",true]; 
				waitUntil {sleep .05; !alive _unit || isTouchingGround _unit}; 
				if (alive _unit) then {_unit setVariable ["hasFallen",false]}; 
				sleep 1; 
				if (!isNull _scream) then {deleteVehicle _scream}; 
				_scream = objNull;
			}; 
		}; 
	};  
}];	

 

fall screams

  • Like 3
  • Thanks 1
  • Haha 1

Share this post


Link to post
Share on other sites

×