Jump to content

computermancer

Recommended Posts

Okay, so I added some keys to choose from in the config.sqf file.

Just set the key you want to use as a toggle to true.

KeySelect_cm_F4 = true;
KeySelect_cm_F5 = false;
KeySelect_cm_F6 = false;
KeySelect_cm_Insert = false;
KeySelect_cm_Home = false;
KeySelect_cm_UpArrow = false;
KeySelect_cm_DownArrow = false;
KeySelect_cm_LeftArrow = false;
KeySelect_cm_RightArrow = false;
KeySelect_cm_RightControl = false;
KeySelect_cm_RightAlt = false;
Link to comment
Share on other sites

cm,
so I throw an idea, went to bed, and by the time I get up you got a new release? awesome man!

one day, they will teach your dedication to continuous improvement as case study in Harvard School of Scripting! :D

thanks, my Transport for Arma script coming along really well, hopefully I will have a initial Public Alpha release will be out soon - I just need to write one last module (pay as you go payment system).
I will be glad if you choose to use it as a base for some of your future work!

Link to comment
Share on other sites

BTW you have a multitude of BOOLs above.

later in the code, are you evaluating 12 conditions?

even with lazy eval syntax, a lot of typing to do, no?

if so, an optimization idea is doing evaluation just once, as such:

///////////////////////

// config_file.sqf

//DEAR ADMIN, PLEASE SEE THE TABLE BELOW AND SET THE DESIRED HOTKEY

// keyIsUpArrow is 1;

// keyIsInsert is 2;

// keyIsHome is 3;

// Your choice goes here dear admin

hotkey = 3;

//// process configured value and assign chosen DIK

switchcase:

hotkey

'1': dikCodeIs = 210;

'2': dikCodeIs = 114:

P.S.: Posting from mobile, this is just PoC.

DIK codes and switchcase syntax above is not accurate and need GoogleFu correction :)

Link to comment
Share on other sites

Yeah, I haven't learned how to use SWITCH command yet. :P

 

I tried using a variable to make the choice but it didnt work properly, so I got lazy and just wanted to get it done :P

 

My philosophy: First comes functionality, then optimization, then glory :P

Make it work, then make it work better - I totally agree. Working solution with a few faults is better than no solution at all...
Link to comment
Share on other sites

Yeah, I haven't learned how to use SWITCH command yet. :P

 

I tried using a variable to make the choice but it didnt work properly, so I got lazy and just wanted to get it done :P

 

My philosophy: First comes functionality, then optimization, then glory :P

Here is the code that should work for you, give it a try buddy...

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// HOTKEY CONFIGURATION FOR: TOGGLE EARPLUG IN/OUT VIA KEYPRESS FUNCTION
//
// List of Available Hotkey Options
//	To use	INSERT			as your hotkey, please choose:		1		in the variable below
//	To use	NumPadMultiply		as your hotkey, please choose:		2		in the variable below
//	To use	NumPadDivide		as your hotkey, please choose:		3		in the variable below
cmEarplugs_myHotkeyChoice = 1;
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////





////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// DO NOT CHANGE THE VALUES BELOW
cmEarplugs_hotkeyDIKCodeNumberINSERT						= 210;
cmEarplugs_hotkeyDIKCodeNumberNUMPADMULTIPLY				= 55;
cmEarplugs_hotkeyDIKCodeNumberNUMPADDIVIDE				= 181;
switch cmEarplugs_myHotkeyChoice do {
	case 1:		{ cmEarplugs_hotkeyDIKCodeNumber = cmEarplugs_hotkeyDIKCodeNumberINSERT				};
	case 2:		{ cmEarplugs_hotkeyDIKCodeNumber = cmEarplugs_hotkeyDIKCodeNumberNUMPADMULTIPLY 		};
	case 3:		{ cmEarplugs_hotkeyDIKCodeNumber = cmEarplugs_hotkeyDIKCodeNumberNUMPADDIVIDE 		};
	case 0;
	default		{ cmEarplugs_hotkeyDIKCodeNumber = cmEarplugs_hotkeyDIKCodeNumberINSERT				};
};
publicVariable	"cmEarplugs_hotkeyDIKCodeNumber";
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



Link to comment
Share on other sites

I'm getting this error when dying from the script.  also f4 doesn't put in/take out like its set, i have not changed any settings whatsoever, just installed per your instructions......however when getting in a vehicle it does auto insert them and i get the action menu for them, but when i get out it does not auto take out. and the action menu disappears.

 

'...Actions inCaseofDeath;

removeAllActions |#|theOneTrueName;

inCaseofDeath setVariabl...'

File mpmissions\__CUR_MP.Bornholm\onPlayerKilled.sqf, line 6

Error Undefined variable in expression: theonetruename

Link to comment
Share on other sites

Just tried installing this today on Bornholm map and all seemed to work until i got out vehicle and earplugs stayed active,   Also F4  wouldn't do anything so only way to pull earplugs out was to get back into vehicle and scroll manually then get out.

 

Any reasons why this might be?   I followed instructions as provided.

 

2 posts back from this someone reported F4 also not working for them prior to the latest updated file.

 

 

Would like to get this working on Bornholm.

Link to comment
Share on other sites

Same problem here. Default settings (auto in-out).

 

If triggered with autoinsert - autoremove isn't working.

If triggered manually - autoremove is working.

 

 

ATM best solusion would be "manual insert - auto remove".

 

E:

  • F4 was working (in vehicle, on foot etc) if:

InsertAutoEarplugs=false;

RemoveAutoEarplugs=true;

 

Autoremove isn't working :/

Link to comment
Share on other sites

Same problem here. Default settings (auto in-out).

 

If triggered with autoinsert - autoremove isn't working.

If triggered manually - autoremove is working.

 

 

ATM best solusion would be "manual insert - auto remove".

 

E:

  • F4 was working (in vehicle, on foot etc) if:

InsertAutoEarplugs=false;

RemoveAutoEarplugs=true;

 

Autoremove isn't working :/

i changed my auto insert to false like you did but i'm still having the same issues, F4 is not working at all, i have the earplug action menu in the vehicle, earplugs auto insert, but don't auto remove, i'm going to have to assume another script is somehow messing with it? since it works for some, and doesn't for some?

update: after exiting arma and rejoining my test server to fix some graphic changes, auto insert and auto remove both did not work. action menu worked and F4 worked this time........killed myself to test things out, after doing this and going back to the vehicle, nothing worked at all except for the action menu.  exited arma again and rejoined just to test things out... again nothing worked at all except for the action menu while in the vehicle.

Link to comment
Share on other sites

Afternoon all, ive installed the script after using it on other servers but for some reason i get the following BE filter which is not in your list. this could be from the 3.02 recent update and of course the recent 1.42 arma update any pointers

 

#9 "setVariable ["BIS_fnc_feedback_postResetHandler", true];
player addeventhandler ["PostReset",{BIS_EnginePPReset = true;} ];
Link to comment
Share on other sites

 

Afternoon all, ive installed the script after using it on other servers but for some reason i get the following BE filter which is not in your list. this could be from the 3.02 recent update and of course the recent 1.42 arma update any pointers

 

#9 "setVariable ["BIS_fnc_feedback_postResetHandler", true];
player addeventhandler ["PostReset",{BIS_EnginePPReset = true;} ];

 

yeah, those are not mine, 3.0.2 related for sure

Link to comment
Share on other sites

Oh man, looks like I got some testing to do... I'll setup my vanilla test server tomorrow and go at it

Any ideas when this will work for Arma 3 Epoch 0.3.0.2 ?

Link to comment
Share on other sites

#9 "setVariable ["BIS_fnc_feedback_postResetHandler", true];
player addeventhandler ["PostReset",{BIS_EnginePPReset = true;} ];

 

those only appeared when i added the earplug scripts. if i remove the earplug scripts the server works fine again.

 

ive fixed it for now by changing line 9 to a 3 instead of a 7

Link to comment
Share on other sites

Sorry guys had a physiological setback today, I woke up with a horrible migraine, bad enough to make me throw up.

 

Once I am done recovering, I will setup my vanilla server, and create a video of the current version being installed and it's functionality.

 

Then I will add the new technique taught to me by mgm, and make a new video.

 

Hopefully I will feel well enough later thi evening... I am a scripting junkie, need my fix

Link to comment
Share on other sites

Sorry guys had a physiological setback today, I woke up with a horrible migraine, bad enough to make me throw up.

 

Once I am done recovering, I will setup my vanilla server, and create a video of the current version being installed and it's functionality.

 

Then I will add the new technique taught to me by mgm, and make a new video.

 

Hopefully I will feel well enough later thi evening... I am a scripting junkie, need my fix

 

Aha that sucks, hope your better soon, realized today how useful this script/mod would be to have on our server,  specially for those darn noisy choppers.  

 

Cheers for keeping us updated, really looking forward to getting this on the server.

Link to comment
Share on other sites

Hey guys, I updated the files on github with a working version.

 

It doesn't have keypress option though, just auto-insert/remove.

 

I should have time this week to get a highly-config version 

Not sure if I will install this right now or wait for the super uber highly config version to be released :D

 

Either way thanks for the update and as for the keypress option thats no big deal for me, just happy if it auto in and out when entering vehicles.

 

Thanks for updating!

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...