computermancer Posted February 19, 2015 Report Share Posted February 19, 2015 cmEARPLUGS SCRIPT ver 2.0 B) WHAT IT DOES: Earplugs script for Arma 3 Epoch (EPAH safe) - This script allows you to put in "earplugs". - Config.sqf will let you configure almost every possible aspect of the script. - You can now insert and remove the earplugs by pressing a key of your choice. - Current available keys are : F4, F5, INSERT, NUMPADMULTIPLY, NUMPADDIVIDE - You can toggle the hotkey in case you use EPAH and wont be ablt to use hotkeys. - Auto-insert and remove earplugs when getting in and out of vehicles. - Inserting earplugs reduces volume down to about 25 percent. - Removing earplugs restores volume to 100 percent. -Thanks to mgm on epochmod.com for helping with keypress config technique. Here is a link to the github files. https://github.com/computermancer/cmEarplugs B) INSTRUCTIONS: 1. Copy the cmEarplugs folder to your mission folder (altis.Epoch) 2. If you have init.sqf, copy the code in this init.sqf to yours. 2a. If you do not have an init.sqf, copy this one over to your mission folder. 3. Copy onPlayerKilled.sqf and onPlayerRespawn.sqf to your mission folder. 4. Config your personal settings in the config.sqf file in the cmEarplgus folder. 5. Edit your battleye filters.Edit the following in your battleye filters. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// scripts.txt (at the end of the line add the following) ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// (BIS_fnc_) First Line: !"bis_fnc_initVehicle" !"BIS_fnc_setVehicleMass_fsm" !"BIS_fnc_arsenal_type" (displayAddEventHandler ) Line 53 (54 on notepad++) : !"EP_LOOP" (displayAddEventHandler ) Line 53 (54 on notepad++) !"cmKeyPress" ( exec ) Line 22 (23 on notepad++) : !"clock.sqf" ( removeAllActions ) Line 31 (32 on notepad++) : !"onplayerkilled.sqf" (displayRemoveEventHandler) Line 59 (60 on notepad++) : !"cmKeyPress" (removeAllEventHandlers) Line 59 (60 on notepad++) : !"cmKeyPress" ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// PublicVariable.txt (at the end of the line add the following) ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// First Line: !"cmEarplugs_hotkeyDIKCodeNumber" First Line: !"PLAYER_REJECT_NotReady1" ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// B) WHAT TO KNOW: If you use Epoch Anti Hack, the script will work except for the keypress option. EPAH seems to disable keydown eventhandlers. But auto insert and menu inside vehicle work fine. If you disable EPAH, you can use the keypress toggle as well. SideShowFreak, .:rmc:., mgm and 12 others 15 Link to comment Share on other sites More sharing options...
mgm Posted February 20, 2015 Report Share Posted February 20, 2015 This is where I will share my EPAH-safe earplugs script. Here is a link to the github files. https://github.com/computermancer/cmEarplugs This is working great! Thanks a lot computermancer! For server admins, This is easy to install and configure. Earplug auto behaviours easilly configurable with the following variables in the server side script file: InsertAutoEarplugs=true; RemoveAutoEarplugs=true; For players, super easy to use [basically they don't do nothing if admin sets autobehaviours to TRUE] as it's all automated. Player gets in vehicle = earplugs automatically put in. Player gets out of a vehicle = earplugs automatically removed. Also a nice message on the top right corner of the screen informs the player about the earplug status (it''s automatically put in / automatically removed). While in vehicle, at all times player has the choice to change earplug status by using the mousewheel option. This should be added to the vanilla epochmod I think. Nasdero, computermancer and CH!LL3R 3 Link to comment Share on other sites More sharing options...
computermancer Posted February 21, 2015 Author Report Share Posted February 21, 2015 I know this isn't the place for it, but I am so excited about it http://youtu.be/N7PZvUcng5s DirtySanchez and blindfisk 2 Link to comment Share on other sites More sharing options...
Totto005 Posted February 21, 2015 Report Share Posted February 21, 2015 Thanks works.. Link to comment Share on other sites More sharing options...
SadBoy1981 Posted February 21, 2015 Report Share Posted February 21, 2015 Works for me too, thanks! Link to comment Share on other sites More sharing options...
Liqu1dShadow Posted February 21, 2015 Report Share Posted February 21, 2015 It's not working for me, when I add this the server get no further than the initialising bar and the RPT is awash with nonetwork errors. I know I'm going wrong somewhere :/ Link to comment Share on other sites More sharing options...
Incsy Posted February 21, 2015 Report Share Posted February 21, 2015 My Mission SQM is already heavily edited and i cant see what changes you have made in your one for me to apply them changes to mine, so are there any changes in both mission sqm and description ext as i can't see them? Link to comment Share on other sites More sharing options...
computermancer Posted February 21, 2015 Author Report Share Posted February 21, 2015 My Mission SQM is already heavily edited and i cant see what changes you have made in your one for me to apply them changes to mine, so are there any changes in both mission sqm and description ext as i can't see them? No,they were just in there to show that they are vanilla. Link to comment Share on other sites More sharing options...
computermancer Posted February 21, 2015 Author Report Share Posted February 21, 2015 It's not working for me, when I add this the server get no further than the initialising bar and the RPT is awash with nonetwork errors. I know I'm going wrong somewhere :/ Upload your current mission files and I'll take a look. Link to comment Share on other sites More sharing options...
SadBoy1981 Posted February 21, 2015 Report Share Posted February 21, 2015 so simple to add this. init.sqf add waitUntil {vehicle player == player}; waituntil {!isnull (finddisplay 46)}; InsertAutoEarplugs=true; RemoveAutoEarplugs=true; [] execVM "cmEarplugs\cm_veh_fun.sqf"; and just add folder what u download to your mission folder. Thanks computermancer, this working good. Link to comment Share on other sites More sharing options...
Liqu1dShadow Posted February 21, 2015 Report Share Posted February 21, 2015 so simple to add this. init.sqf add waitUntil {vehicle player == player}; waituntil {!isnull (finddisplay 46)}; InsertAutoEarplugs=true; RemoveAutoEarplugs=true; [] execVM "cmEarplugs\cm_veh_fun.sqf"; and just add folder what u download to your mission folder. Thanks computermancer, this working good. oh hang on.... This what I do.......... I add this to my Init // Welcome Credits [] execVM "custom\welcome.sqf"; // EarPlugs [] execVM "cmEarplugs\cm_veh_fun.sqf"; // fatigue [] spawn { // No fatigue while {true} do { player setFatigue 0; uiSleep 6; }; }; //Zombies if (isDedicated) then { [] execVM "\q\addons\zombiemission\init.sqf"; }; [] execVM "zombie\compiles.sqf"; "playZSoundHurt" addPublicVariableEventHandler {(_this select 1) call fncNextSound}; "playZSound" addPublicVariableEventHandler {(_this select 1) call fncNextSound}; // Status Bar [] execVM "scripts\fn_statusBar.sqf"; /// Init.sqf DbD Clan Chernarus execVM "start_blck.sqf"; //If server execute this script if (isServer) then { execVM "\q\addons\custom_server\init.sqf"; //If anything but server execute this script } else { [] spawn { //This is to spawn the markers when players enter after server has started [] execVM "debug\addmarkers.sqf"; [] execVM "debug\addmarkers2.sqf"; [] execVM "debug\addmarkers75.sqf"; [] execVM "debug\addmarkers752.sqf"; //Event handler to show messages to players // this can be used for other scripts to send messages to players -- see AIM.sqf "blck_Message" addPublicVariableEventHandler {titleText[format["%1",_this select 1],"PLAIN DOWN",1];}; }; }; Then I put these in the epoch.Chernarus pbo restart the server and it gets to the initialising stage and stops I guess I'm doing it wrong lol, computermancer and mgm 2 Link to comment Share on other sites More sharing options...
computermancer Posted February 21, 2015 Author Report Share Posted February 21, 2015 I am sorry you guys, I guess my instructions were not very clear. I will update them later today, but here is the basics. B) INSTRUCTIONS: - COPY the folder "cmEarplugs" to your mission folder (where your init.sqf file is located) - COPY the file "onPlayerRespawn.sqf" to the same folder as above -Edit your battleye stuff.... -That's it. :angry: YOU DO NOT NEED TO EDIT YOUR INIT.SQF if you did remove any lines of code you added. (your init, mission, and description files don't need to be touched) :wub: ADVICE: Read through this to get a better idea of what files are being used by the game. https://community.bistudio.com/wiki/Event_Scripts This will explain what "init.sqf", "onPlayerRespawn.sqf" etc actually do, when they run and whether you should have one or not. **once again, sorry for being bad at instruction, i will edit github later :ph34r: Let me know if you have any more questions ro comments. The feedback helps me a great deal. "There is no evolution without conflict." Link to comment Share on other sites More sharing options...
Liqu1dShadow Posted February 21, 2015 Report Share Posted February 21, 2015 so how is the file called if its not in the init.sqf? does it call itself? This stuff just makes my brain hurt lol! computermancer 1 Link to comment Share on other sites More sharing options...
computermancer Posted February 21, 2015 Author Report Share Posted February 21, 2015 so how is the file called if its not in the init.sqf? does it call itself? This stuff just makes my brain hurt lol! Files in this list are files the game will load if they exist in the mission folder and have those specific names. The list helps clarify what they do and when they run. I use oNplayerRespawn because that runs EVERYTIME your character spawns (on load, and afterdeath, and from lobby) init.sqf only runs when you connect to the server, not when you respawn. So "scriptX" will run ONCE when you join if "execVM'd" from init.sqf. However, "scriptX" will run EVERYTIME you spawn if "execVM'd" from onPlayerRespawn.sqf. Link to comment Share on other sites More sharing options...
Liqu1dShadow Posted February 21, 2015 Report Share Posted February 21, 2015 Files in this list are files the game will load if they exist in the mission folder and have those specific names. The list helps clarify what they do and when they run. I use oNplayerRespawn because that runs EVERYTIME your character spawns (on load, and afterdeath, and from lobby) init.sqf only runs when you connect to the server, not when you respawn. So "scriptX" will run ONCE when you join if "execVM'd" from init.sqf. However, "scriptX" will run EVERYTIME you spawn if "execVM'd" from onPlayerRespawn.sqf. starting to get clear now, how you people know all this baffles me! i am picking things up but some of it just blows my tiny brain to bits! computermancer 1 Link to comment Share on other sites More sharing options...
computermancer Posted February 21, 2015 Author Report Share Posted February 21, 2015 Like most things, it's a simple formula... TIme and effort. :P Link to comment Share on other sites More sharing options...
lahlor Posted February 22, 2015 Report Share Posted February 22, 2015 Thank you for the Script. It is working very good, but every time someone die, he will get another "Earplug" entry in his menu bar. So finally the "Earplug" item will shown +1 every death. Are there a fix available? Greetz lahlor Link to comment Share on other sites More sharing options...
computermancer Posted February 22, 2015 Author Report Share Posted February 22, 2015 Make sure you don't have it being execVM'd from init.sqf Only copy the onPlayerRespawn.sqf If you add a line to your init.sqf to run the earplugs script, you will have both the server and your computer adding the action. Link to comment Share on other sites More sharing options...
lahlor Posted February 22, 2015 Report Share Posted February 22, 2015 I only have it in the onPlayerRespawn.sqf with the following entries: waitUntil {vehicle player == player}; waituntil {!isnull (finddisplay 46)}; //TOGGLES! InsertAutoEarplugs=true; RemoveAutoEarplugs=true; //ExecVM ! [] execVM "cmEarplugs\cm_veh_fun.sqf"; Link to comment Share on other sites More sharing options...
computermancer Posted February 23, 2015 Author Report Share Posted February 23, 2015 Okay, I see the problem, I will fix soon to prevent deathspam mgm 1 Link to comment Share on other sites More sharing options...
mgm Posted February 23, 2015 Report Share Posted February 23, 2015 Okay, I see the problem, I will fix soon to prevent deathspam I appreciate the on-going active support on this - keep it up CM! Link to comment Share on other sites More sharing options...
rezor92 Posted February 24, 2015 Report Share Posted February 24, 2015 Why not use initPlayerLocal.sqf Link to comment Share on other sites More sharing options...
lahlor Posted February 24, 2015 Report Share Posted February 24, 2015 keep going..cant whait for the update! Link to comment Share on other sites More sharing options...
fullaholes Posted February 26, 2015 Report Share Posted February 26, 2015 Okay, I see the problem, I will fix soon to prevent deathspam Is this still broke or did you fix it ? Link to comment Share on other sites More sharing options...
computermancer Posted February 27, 2015 Author Report Share Posted February 27, 2015 Is this still broke or did you fix it ? Still broke, haven't had a chance to get to it yet. It's on my To-Do list for sure. I am working on a very tangled script at the moment, but I am almost done. ( custom dialog console) I will see if I can get a vanilla server up on my test machine tonight :wub: 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