meanbeandk Posted April 26, 2015 Report Share Posted April 26, 2015 Don´t Work Go To post #8 Scare your players with this little script 1. Make a file and call it monster.sqf private["_rand_player","_chance","_spawnroll"]; ///////////////////Config//////////////////////////// _chance = 33; // Percent chance 0 - 100 //////////// ///////////////////////////////////////////////////// _rand_player = playableUnits call BIS_fnc_selectRandom; _spawnRoll = round(random 100); if (_spawnRoll <= _chance) then{ if((isPlayer _rand_player) && (alive _rand_player)) then { playSound "monster"; sleep 5; }; }; and place it in the modules folder in your dayz_server.pbo 2. In your Init.sqf in your mission folder (DayZ_Epoch_XX.XXXXX) find EpochEvents and add ["any","any","any","any",33,"monster"] EpochEvents = [["any","any","any","any",10,"Military"], ["any","any","any","any",34,"monster"],["any","any","any","any",25,"Treasure"], ["any","any","any","any",15,"Supplyitems"]]; 3. Add this to the description.ext file class CfgSounds { sounds[] = { monster }; class monster { name="monster"; sound[]={monster.ogg,0.3,1}; titles[] = {}; }; }; just before class RscLoadingText : RscText 4. unzip the attach file and put it in your mission folder (DayZ_Epoch_XX.XXXXX) All Done Come and vissit my Chuck Norris approved server ip: 5.103.68.98 Port 2302 monster.zip Link to comment Share on other sites More sharing options...
Gr8 Posted April 26, 2015 Report Share Posted April 26, 2015 _nul = [objNull, player, rSAY, "monster"] call RE; I dont know if this will scare the player, but will make other people near him and laugh and reveal his position. Use something like this : playSound "monster"; meanbeandk 1 Link to comment Share on other sites More sharing options...
meanbeandk Posted April 26, 2015 Author Report Share Posted April 26, 2015 Thanks to [GG] Ghostz Gamerz Now i have updatet my script :) Link to comment Share on other sites More sharing options...
Halvhjearne Posted April 26, 2015 Report Share Posted April 26, 2015 Use something like this : playSound "monster"; i dont think that will work when he is running this serverside, he would need to use a publicvariable then ... Link to comment Share on other sites More sharing options...
Gr8 Posted April 27, 2015 Report Share Posted April 27, 2015 i dont think that will work when he is running this serverside, he would need to use a publicvariable then ... oh yes, I forgot about that. But with public variable, how do you make it local? I would just suggest using a client side script. Link to comment Share on other sites More sharing options...
Halvhjearne Posted April 27, 2015 Report Share Posted April 27, 2015 oh yes, I forgot about that. But with public variable, how do you make it local? https://community.bistudio.com/wiki/publicVariableClient I would just suggest using a client side script. +1 no need to strain the server with anything unneeded like this imho... Link to comment Share on other sites More sharing options...
RimBlock Posted April 27, 2015 Report Share Posted April 27, 2015 Why not leverage object_speak.sqf already used for playing sounds in A2 Epoch. It will accept _unit _type _chance _dis (distance) and is called with (for example) [player,"tentpack",0,false] call dayz_zombieSpeak; If you have a process running on the server which 'selects' a player then it can calls it with a 100% chance. If any units in range are non local (to the server) it will fire a RE: to play the sound on the other players clients so everyone in the area gets the sound. Now, _unit need not be an actual player but could be some coords [x,y,z] so the sound could be played to anyone in range of a specific place. Wolf howl in the center of a dark forest, for example, for anyone close to hear. Detail on the RE (Remote Execution) framework can also be found here if you are interested. If the mechanisum is already there, why not use it. Andy.txt and Gr8 2 Link to comment Share on other sites More sharing options...
meanbeandk Posted April 27, 2015 Author Report Share Posted April 27, 2015 1. Make a file and call it monster.sqf private["_rand_player","_chance","_spawnroll"]; ///////////////////Config//////////////////////////// _chance = 33; // Percent chance 0 - 100 //////////// ///////////////////////////////////////////////////// _rand_player = playableUnits call BIS_fnc_selectRandom; _spawnRoll = round(random 100); if (_spawnRoll <= _chance) then{ if((isPlayer _rand_player) && (alive _rand_player)) then { playSound "monster"; sleep 5; }; }; and place it in your custom folder. 2. copy your local_lockUnlock.sqf from your Dayz_code.pbo to your costum folder in your mission folder (DayZ_Epoch_XX.XXXXX) 3. add [] execVM "custom\monster.sqf" to the local_lockUnlock.sqf so it looks like this private ["_vehicle","_status"]; _vehicle = _this select 0; _status = _this select 1; if (local _vehicle) then { if(_status) then { _vehicle setVehicleLock "LOCKED"; [] execVM "custom\monster.sqf" } else { _vehicle setVehicleLock "UNLOCKED"; }; }; 4. in your compiles.sqf find local_lockUnlock = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_lockUnlock.sqf"; and change the hole line to local_lockUnlock = compile preprocessFileLineNumbers "custom\local_lockUnlock.sqf"; 5. Add this to the description.ext file class CfgSounds { sounds[] = { monster }; class monster { name="monster"; sound[]={monster.ogg,0.3,1}; titles[] = {}; }; }; just before class RscLoadingText : RscText 4. unzip the attach file (from my first post) and put it in your mission folder (DayZ_Epoch_XX.XXXXX) Dont know if this is the perfect way but it works :) Link to comment Share on other sites More sharing options...
Halvhjearne Posted April 27, 2015 Report Share Posted April 27, 2015 Dont know if this is the perfect way but it works :) better than having the server do it imho ... else it will just generate a bunch of unneeded and unwanted network traffic slowing down the overall performance of connection and server ... it was like going around the moon to reach the bakery down the street. Link to comment Share on other sites More sharing options...
Thug Posted April 28, 2015 Report Share Posted April 28, 2015 When or where is this suppose to work in game?? what do i do with sounds[]={monster}; what i mean is what about all the other sounds i have. they have been working with just sounds[]={}; with nothing in the {}; Should i put each class behind monster like monster, DoorCreak, and so on? My question may be clear as mud, so if you need more information, let me know. The following are my sounds class CfgSounds { sounds[] = { }; class DoorCreak { name="DoorCreak"; sound[]={sounds\doorCreak.ogg, 0.1, 1}; titles[] = {}; }; class metalGates { name="metalGates"; sound[]={sounds\metalGates.ogg, 0.1, 1}; titles[] = {}; }; class stronghold { name = "stronghold"; sound[] = {sounds\vrata_sound.ogg,0.1,1}; titles[] = {}; }; class vendingmachine { name="vendingmachine"; sound[]={Vending\vendingmachine.ogg,0.9,1}; titles[] = {}; }; }; Link to comment Share on other sites More sharing options...
meanbeandk Posted April 28, 2015 Author Report Share Posted April 28, 2015 add this before the last "}" class monster { name="monster"; sound[]={monster.ogg,0.3,1}; titles[] = {}; }; Link to comment Share on other sites More sharing options...
ElDubya Posted July 15, 2015 Report Share Posted July 15, 2015 Can anyone please tell how to make it so the monster sound is heard by other players as well? Link to comment Share on other sites More sharing options...
Zupa Posted July 15, 2015 Report Share Posted July 15, 2015 Can anyone please tell how to make it so the monster sound is heard by other players as well? You would need to send the event to all players which then play the sound localy. Unnecessary trafic in my opinion though. Link to comment Share on other sites More sharing options...
ElDubya Posted July 15, 2015 Report Share Posted July 15, 2015 Damn .... I know the carlock sound script plays the sound so that everyone can hear it. I thought it might be an easy fix :( Link to comment Share on other sites More sharing options...
Zupa Posted July 15, 2015 Report Share Posted July 15, 2015 Damn .... I know the carlock sound script plays the sound so that everyone can hear it. I thought it might be an easy fix :( It's not hard. And don't call it a 'fix'. Extra 'feature' is more the word for this. Fixes sound like the scripter broke the script. Which is 80% of the cases just installation mistakes if the installer says it in a forum post :p Link to comment Share on other sites More sharing options...
ElDubya Posted July 15, 2015 Report Share Posted July 15, 2015 Ok :) Would you care to show me how to enable this "feature"? Please? :) Link to comment Share on other sites More sharing options...
choppra Posted July 15, 2015 Report Share Posted July 15, 2015 You don't need to use public variables for this. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now