IrishDeviant 10 Posted September 20, 2010 (edited) I have searched all over and haven't been able to find any explanation at all for the 'custom controls' section of the controls setup. I am trying to find a way to add custom input for weapon selection for aircraft. Basically, I'm tired of having to press a 'toggle' key to select weapons while flying. 90% of the time, I press the button too many times and fly right by the weapon I wanted, then have to tap the key a few more times to get back around. (don't know if anyone is following this). What I want is to be able to set my Num Pad keys to individual weapons instead of having to press F key. The keys don't need to be attached to specific weapons though. For ex, Num 1 could simply be the first weapon in the string. Typically that would be cannons for aircraft. But, many aircraft have different amounts of availible weapons, and of course all different types of weapons. So, I just want the Num keys to function like: Num 1 = "weapon slot 1", Num 2 = "weapon slot 2", etc. Does anyone know how to set this up to work the way I'd like it to? Edited September 20, 2010 by IrishDeviant Share this post Link to post Share on other sites
nkenny 775 Posted September 20, 2010 Not possible. Just another one of Bohemias ludicrous user interface elements. -k Share this post Link to post Share on other sites
IrishDeviant 10 Posted September 20, 2010 What about addons like Mando Missile pack that allow selecting weapons through UI elements. Would there be a way to run an addon that added an 'invisible' UI element that captures the User Action Controls to select the specific weapon needed. The way I understand it, in the scripting the "array" is the total number of available weapons. Such as 2 slots for a weapon with 2 firing modes, then a slot for grenades, a slot for satchels, etc. This makes up the array. So, could an addon latch on to this and give a command that basically says User Action 15 = array_1, User Action 16 = array_2, etc? Share this post Link to post Share on other sites
Defunkt 429 Posted September 20, 2010 _kdeh = -1; while {_kdeh == -1} do { _kdeh = FindDisplay 46 DisplayAddEventHandler["KeyDown", "_this Call keypress_hook"]; }; keypress_hook = { _code = _this select 1; _done = false; if (_code in ActionKeys "User15") then { _done = true; }; _done; }; Share this post Link to post Share on other sites
IrishDeviant 10 Posted September 20, 2010 um, k, well uh, what do I do with that? ;) Share this post Link to post Share on other sites
IrishDeviant 10 Posted September 20, 2010 Could anyone tell me how to use this code. Does it go in a script, config file. Basically, what do I need to do to set it up. Also, if you read my first post, I'd like to have my Num pad work as a weapon select for aircraft. ie, cannons on Num 1, Sidewinders on Num 2, etc (or whatever happens to be in that order of the weapon selection) So, would I have to make a mod of all of the existing aircraft to use this, or is it something that I could do as a client side mod to allow all existing aircraft to use this? Share this post Link to post Share on other sites
Defunkt 429 Posted September 20, 2010 That fragment merely illustrates how to hook keyboard input and would be suitable for use within a mission's init.sqf or some routine spawned from it. You could then add code to iterate through the current vehicle's weapons and decide which to select based on each weapon's core class or ammo type combined with the key pressed. If you wanted it in an addon you'd probably need to use CBA's event handlers instead so it plays nice with other addons but if none of this makes much sense you probably need to resort to the Addon Request Thread and see if somebody will make it for you. Share this post Link to post Share on other sites
IrishDeviant 10 Posted September 20, 2010 Thanks man, appreciate the help Share this post Link to post Share on other sites