Jump to content
  • 0

Earplugs for vehicles...


Angrygargamel

Question

Hi&Hello...

i tried to implement this little but functional earplug script on my epoch server...

i have tried 3 different variants now... but the mousewheel actions never show up

 

http://www.armaholic.com/page.php?id=26624

 

any suggestions?

 

 

who doesnt know what this script does...

when you fly in a heli you cant understand anything of the VON or teamspeak unless you turn the ingame volume down

this script does this for you instant... put the earplugs in... sound is lowered to x percent

take the earplugs out... sound is back to normal

Link to comment
Share on other sites

Recommended Posts

  • 0

Is there a way so when a vehicle is near you you can put in ear plugs? I hate it when your trying to talk to someone and there is a chopper next to you and you cant hear a thing.

 

Yeah, I am working on the next version of it which will allow you to put them in from inside and outside the car, and will auto remove them 10 seconds after getting out of a vehicle in case that vehicle blows up or w/e  :)

Link to comment
Share on other sites

  • 0

Sorry guys, used a bad methodology on that one. 

 

I fixed it now, so the script adds the Earplugs to every vehicle when you load in, rather than when you respawn.

 

So now you can die and respawn with only one iteration of the addaction.

 

Also, if you leave the server and re-connect, it still only shows one.

 

Hopefully no more earplug spam.  :P  I updated the link above, and the link below. 

 

https://www.dropbox.com/s/cen58l133nvt3pc/SFM_VEH_EP_3.rar?dl=0

Link to comment
Share on other sites

  • 0

Sorry guys, used a bad methodology on that one. 

 

I fixed it now, so the script adds the Earplugs to every vehicle when you load in, rather than when you respawn.

 

So now you can die and respawn with only one iteration of the addaction.

 

Also, if you leave the server and re-connect, it still only shows one.

 

Hopefully no more earplug spam.  :P  I updated the link above, and the link below. 

 

https://www.dropbox.com/s/cen58l133nvt3pc/SFM_VEH_EP_3.rar?dl=0

 

a lot of files here some of which say what to change and others leave me guessing. explanation would be great maybe make your own topic or a video.

Link to comment
Share on other sites

  • 0

a lot of files here some of which say what to change and others leave me guessing. explanation would be great maybe make your own topic or a video.

I am learning how to use github, when I am done, I will make a repository for it and other stuff I am working on. :wacko:

 

You're right, I did kinda just throw it all in there. :ph34r:  I also put in a request for my own topic, but it's still pending approval. :rolleyes:

Link to comment
Share on other sites

  • 0

awesome addition computermancer. Works like a charm. however, as it is added to any vehicle you also get it in some of the traders as those objects are also "vehicles". I believe it would be better to implement an array of allowed vehicles. 

Haha, didn't notice that, yeah, I had a method that used an array, probably will go back it to to be more specific. I though I could get away from it by making it a bit more general, but it may a bit TOO general, lol.

 

Why do people still use "sleep" in scripts? It's out of date, it should be "uiSleep"

https://community.bistudio.com/wiki/uiSleep

 

"uiSleep is basically using the system time (uiTime more specifically) and not simulation time. So in the cases where sleep command would get stuck indefinitely, uiSleep can still be used to effectively delay script execution."

 

I have no issues with old-school sleep command, I only use uisleep for very specific situations, none of these really call for it. Not sure if this script has it, but for onPlayerRespawn.sqf,  I do use uisleep because of the fact that it is usually happening for the first spawn during the mission briefing, after that point, it doesn't matter,... but I still consider myself a novice, so I could be totally wrong.  :P Honestly, I don't even need that uisleep in my opr because of the fact that I have my script waiting for the player to move before his opr scripts are run. 

 

Any other info you may have on UISLEEP would be greatly appreciated though,  ;) 

Link to comment
Share on other sites

  • 0

Sorry guys, used a bad methodology on that one. 

 

I fixed it now, so the script adds the Earplugs to every vehicle when you load in, rather than when you respawn.

 

So now you can die and respawn with only one iteration of the addaction.

 

Also, if you leave the server and re-connect, it still only shows one.

 

Hopefully no more earplug spam.  :P  I updated the link above, and the link below. 

 

https://www.dropbox.com/s/cen58l133nvt3pc/SFM_VEH_EP_3.rar?dl=0

Hi, a couple of things:

  1. good script, I like it - thanks!
  2. there is a bug, in your git hub, in file "cm_veh_init.sqf", the last character is a . (dot) which causes errors. I removed it, script started working fine. you might want to fix that.  [EDIT: Just FYI, error is "error in expression [] spawn cm_Veh_Loop; hint "done;.> error position: <.>"]
  3. I suggest for the next update (if it's gonna happen) you rename the script file and directory to 'earplugs' or something like that - it's just a small cosmetic improvement really.
  4. EDIT: "...you got out of a car..." text would be better with "...you got out of a vehicle" because it says car even when you actually leave a heli [haven't tested but I guess sea vehicles would have the same cosmetic issue].
  5. EDIT: so I was going to work (looting) in my kart, our new shiny earplugs mousewheel option was nowhere to be found. perhaps add more vehicles? :)
Link to comment
Share on other sites

  • 0

 

Hi, a couple of things:

  1. good script, I like it - thanks!
  2. there is a bug, in your git hub, in file "cm_veh_init.sqf", the last character is a . (dot) which causes errors. I removed it, script started working fine. you might want to fix that.  [EDIT: Just FYI, error is "error in expression [] spawn cm_Veh_Loop; hint "done;.> error position: <.>"]
  3. I suggest for the next update (if it's gonna happen) you rename the script file and directory to 'earplugs' or something like that - it's just a small cosmetic improvement really.
  4. EDIT: "...you got out of a car..." text would be better with "...you got out of a vehicle" because it says car even when you actually leave a heli [haven't tested but I guess sea vehicles would have the same cosmetic issue].
  5. EDIT: so I was going to work (looting) in my kart, our new shiny earplugs mousewheel option was nowhere to be found. perhaps add more vehicles? :)

 

 

Good catch

Link to comment
Share on other sites

  • 0

Thanks for catching that horrible type-O. I will be fixing those issues today. I will be adding an array of allowed vehicles, I will be adding a loop to constantly check for new vehicles that may show up after being bought from trader. I believe that's why some vehicles won't have the earplugs applied.

 

I will post the updated version later today when I am satisfied with the changes. 

Link to comment
Share on other sites

  • 0

 

Here you go dude, I finished testing it out earlier today.

 

Copy this to your onPlayerRespawn.sqf file in your root mission folder. (if you don't have it, create it.

waituntil {!isnull (finddisplay 46)};

private ["_hintTitle","_hintText","_hintInfo","_hintOut","_cm_die","_guydude","_cmtrig","_cmbreathing","_cm_startingpos","_cm_position","_cm_stationary"];

_cmbreathing = alive player;
_cmtrig=true;
_guydude = player;

while {_cmtrig} do {

sleep 0.5;

if (_cmbreathing) then {
_cm_startingpos = position player;
sleep 0.5;
_cm_position = position _guydude;
_cm_stationary = _cm_startingpos select 0 == _cm_position select 0 && _cm_startingpos select 1 == _cm_position select 1;
if (_cm_stationary) then {
hint "Spawned in... Standing around...";
} else {
hint "Starting up scripts...";
_cmtrig=false;
};
};
};

UISLEEP 5;

[] execVM "earplugs.sqf"; 


And copy this code to your earplugs.sqf file in your root folder. (if you don't have it, make it)

//created by computermancer //Inspitration for code structure came from // v1g Fast Rope by [STELS]Zealot
//=========================================================================================
//=== Awesome Earplugs Scripts==================================
//---by computermancer----- superfunserver.com------------------

#define CM_ADD_TITLE1 "Earplugs"
earplugsout=true;

// the vehicles in which you can addAction
cm_allowed_array = ["O_Heli_Light_02_unarmed_F","O_Heli_Light_02_F","B_Heli_Transport_01_F","B_Heli_Transport_01_camo_F","O_Heli_Attack_02_F","O_Heli_Attack_02_black_F","I_Heli_Transport_02_F","B_Heli_Light_01_F","C_Offroad_01_EPOCH","C_Quadbike_01_EPOCH","C_Hatchback_01_EPOCH","C_Hatchback_02_EPOCH","C_SUV_01_EPOCH","C_Rubberboat_EPOCH","C_Rubberboat_02_EPOCH","C_Rubberboat_03_EPOCH","C_Rubberboat_04_EPOCH","C_Van_01_box_EPOCH","C_Van_01_transport_EPOCH","C_Boat_Civil_01_EPOCH","C_Boat_Civil_01_police_EPOCH","C_Boat_Civil_01_rescue_EPOCH","B_Heli_Light_01_EPOCH","B_SDV_01_EPOCH","B_MRAP_01_EPOCH","B_Truck_01_transport_EPOCH","B_Truck_01_covered_EPOCH","B_Truck_01_mover_EPOCH","B_Truck_01_box_EPOCH","O_Truck_02_covered_EPOCH","O_Truck_02_transport_EPOCH","O_Truck_03_covered_EPOCH","O_Truck_02_box_EPOCH","I_Heli_light_03_unarmed_EPOCH","O_Heli_Light_02_unarmed_EPOCH","I_Heli_Transport_02_EPOCH","O_Heli_Transport_04_EPOCH","O_Heli_Transport_04_bench_EPOCH","O_Heli_Transport_04_box_EPOCH","O_Heli_Transport_04_covered_EPOCH","B_Heli_Transport_03_unarmed_EPOCH","jetski_epoch","K01","K02","K03","K04","ebike_epoch","mosquito_epoch"];
	
cm_addaction_req = {
private ["_veh","_cm_req"];
_veh = vehicle player;
_cm_req = (_veh != player) and { (typeof _veh) in cm_allowed_array } and {alive _veh};
_cm_req;
};
		
cm_FUNc_earplugs = {

	if (earplugsout) then {

	hint "Earplugs have been put in.";
	1 fadeSound 0.25;
	earplugsout=false;

	} else {

	hint "Earplugs have been taken out.";
	1 fadeSound 1;		
	earplugsout=true;
	};
};

player addAction["<t color='#00ffff'>"+CM_ADD_TITLE1+"</t>", cm_FUNc_earplugs, [], -1, false, false, '','[] call cm_addaction_req'];
cutText [format["You can now wear earplugs when in certain vehicles."], "PLAIN DOWN",1];

As for battle eye filters, just add this to your scripts.txt file. Look for the "execvm" line and at the end of it, add this...

!="finddisplay" !="onPlayerRespawn.sqf" !="earplugs.sqf"

should look something like this

7 exec !="<execute expression=" !"RscDebugConsole_execute" !"execFSM" !"_executeStackedEventHandler" !"fn_execVM" !"fn_moduleExecute" !"fn_execRemote" !"fn_MPexec" !"bis_fnc_moduleExecute_activate" !"fn_tridentExecute" !"randomize_civ1" !"executed from" !"EPOCH_DebugGUI_exec" !"_handle = [_display] execVM _script;" !"execVM \"\A3\Structures_F\scripts" !="execVM \"\A3\Structures_F_EPC\Civ\PlayGround\scripts\Carousel_spin.sqf\"" !="HC\init.sqf" !="aoa\DCL\init.sqf;" !="IgiLoad" !="R3F_ARTY_AND_LOG" !="HC" !="FuMs" !="NameTags" !="SFM" !="superfun" !="randomize_colors" !="clock.sqf" !="randomize_gue" !="finddisplay" !="onPlayerRespawn.sqf" !="earplugs.sqf"

 

This is working for me, but sometimes players does not have the selection of the Earplugs o.O (Vehicle is whitelist)

Link to comment
Share on other sites

  • 0

 

Hi, a couple of things:

  1. good script, I like it - thanks!
  2. there is a bug, in your git hub, in file "cm_veh_init.sqf", the last character is a . (dot) which causes errors. I removed it, script started working fine. you might want to fix that.  [EDIT: Just FYI, error is "error in expression [] spawn cm_Veh_Loop; hint "done;.> error position: <.>"]
  3. I suggest for the next update (if it's gonna happen) you rename the script file and directory to 'earplugs' or something like that - it's just a small cosmetic improvement really.
  4. EDIT: "...you got out of a car..." text would be better with "...you got out of a vehicle" because it says car even when you actually leave a heli [haven't tested but I guess sea vehicles would have the same cosmetic issue].
  5. EDIT: so I was going to work (looting) in my kart, our new shiny earplugs mousewheel option was nowhere to be found. perhaps add more vehicles? :)

 

 

6. "Automatically remove earplugs when you leave a vehicle" is a nice feature - saving us an unnecessary mouse wheel action every time. Likewise, "automatically put on earplugs" should exist I think - this too will save us from the unnecessary action.

 

It's novelty and fun to use mousewheel to turn volume down first 100 times or so, then it's just tiring. This is something BI should have added to the vanilla game as engine sound is inconveniently high.

Link to comment
Share on other sites

  • 0

6. "Automatically remove earplugs when you leave a vehicle" is a nice feature - saving us an unnecessary mouse wheel action every time. Likewise, "automatically put on earplugs" should exist I think - this too will save us from the unnecessary action.

 

It's novelty and fun to use mousewheel to turn volume down first 100 times or so, then it's just tiring. This is something BI should have added to the vanilla game as engine sound is inconveniently high.

BI already has their solution, they want you to use Ctrl + and Ctrl -

 

I would add an auto-put-in-earplugs action, but it might annoy people who don't need or want sound reduction.

 

The purpose of this script is to give players an extra option in sound reduction that requires no keyboard interaction or esc-menu-access.

 

Latest version should be updated today with many improvements.

 

Thanks for the feedback  :D

Link to comment
Share on other sites

  • 0

Okie Dokie. Here is a link to my latest version of the earplugs script. WIth instructions, and BE filters.  :D

 

https://github.com/computermancer/cmEarplugs

 

Updated this baby with some sweet sweet new techniques. Only things missing is an auto-remove triggered by distance to nearest vehicle.

a.The typo (.) bug has been fixed in this version

b.Script directory has been renamed to clarify functionality

c."You got out of car" text has been fixed to apply to all types of vehicles

d.Karts can now use earplugs! yay!

 

^^ All good improvements, thanks for continuous effort on this baby!

 

 

 

 

Here is my suggestions on this new release since you've been receptive to comments as per above:

  1. For any future work on this (on any script really) a single central ChangeLog file in the package would be very helpful to save us all time... EDIT: here is a good example of ChangeLog implementation...
  2. I have installed this; I can't see it but just to be sure I will ask please can you advise - "automatically put earplugs on" functionality doesn't seem to be in, has it been implemented? Any chance to add it later on? BI's solution don't really solve the problem, your script does. If it does this with less effort all the better!

thanks again.

Link to comment
Share on other sites

  • 0

a.The typo (.) bug has been fixed in this version

b.Script directory has been renamed to clarify functionality

c."You got out of car" text has been fixed to apply to all types of vehicles

d.Karts can now use earplugs! yay!

 

^^ All good improvements, thanks for continuous effort on this baby!

 

 

 

 

Here is my suggestions on this new release since you've been receptive to comments as per above:

  1. For any future work on this (on any script really) a single central ChangeLog file in the package would be very helpful to save us all time... EDIT: here is a good example of ChangeLog implementation...
  2. I have installed this; I can't see it but just to be sure I will ask please can you advise - "automatically put earplugs on" functionality doesn't seem to be in, has it been implemented? Any chance to add it later on? BI's solution don't really solve the problem, your script does. If it does this with less effort all the better!

thanks again.

 

There is no "automatically put earplugs on" functionality. I wanted to give people the option, sometimes we dont get in vehicles to turn them on...

 

I am bad at documentation.  :P  But will work on it. Thanks for the tips.

 

I can see about adding a toggle for auto-remove and auto-wear earplugs. This way script users can have a choice. What I really want is a nearestObject type trigger so earplugs come out if no vehicles are within 25m. Thats the dream. :P

 

I am very receptive to suggestion for improvements as well as any other future scripts. (currently working on radio script, and salvage script) 

 

Thanks for all the positive feedback! EgoBoooooost enabled!   :D

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
  • Advertisement
×
×
  • Create New...