Jump to content

computermancer

Recommended Posts

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.
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

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

2nc032q.jpg

 

 

restart the server and it gets to the initialising stage and stops

 

I guess I'm doing it wrong lol,

Link to comment
Share on other sites

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

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

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!

Link to comment
Share on other sites

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...