Custom Remapping Advice
Hi Zenumtin,
This is in response to your Steam Guide question on customising the script. I've posted it here to avoid the character limit on Steam as its a bit lengthy. Given there is a lot of changes you want to make, I can't go through all of them with detailed code as I will be here all arvo writing this post, but will describe how to make most changes you need & where to look. I hope this will start you in the right direction.
Some advice to start with:
- The manual is your friend. You can access this via the Help button in the script editor. It explains how most commands work & may help if you get into trouble. Likewise, read the comments in green in the script (may need to scroll to the side at some points).
- Be patient
Make one change at a time, save, compile & test in ED before moving onto the next.
- Become familiar with the sections in the script. Everything is commented ('//') to help. Each file handles specific things such as keybinds, or macro/functions or key mappings. Primarily, you will need the key mappings file to be changed, but there are a few other things.
- Make backups & copies as you progress through. Nothing worse than loosing your work. This goes for both the script files & the ED bindings file after you make each successful change. With backups you are free to mess around and try things without risk.
Ok, lets start with the easier changes, where you want to swap two commands & work our way through.
1) Swap ECM/Shield Cell Bank & Chaff/Heat Sink long/short presses:
Around line 159 in the main ED script you will find this:
Code:
MapKey(&Joystick, S1, TEMPO[COLOR=#ffffff]([/COLOR]PULSE[COLOR=#ffffff]+[/COLOR]FireChaffLauncher, PULSE[COLOR=#ffffff]+[/COLOR]DeployHeatSink, LongPressDelay));
MapKey(&Joystick, S2, TEMPO[COLOR=#ffffff]([/COLOR]PULSE[COLOR=#ffffff]+[/COLOR]SRVTurret, PULSE[COLOR=#ffffff]+[/COLOR]UseShieldCell, LongPressDelay));
Simply swap the two commands after the TEMPO part to change which is long and which is short press. Such as:
TEMPO
(PULSE
+DeployHeatSink, PULSE
+FireChaffLauncher, LongPressDelay)
Same applies to the Fighter Focus & Wingman's target, which are found just under the above code. These look a little different as they have IF statements for the modifier key (Joystick[S4]) but operate the same way. Just copy/paste to move these around to your liking.
2) Swapping Throttle Presets:
This can be done by changing these user preferences in the EDSettings files:
define ThrottlePresetUP
define ThrottlePresetMID
define ThrottlePresetDOWN
Note: My script uses its own Forward Only mode so the button mapping for reverse does not work. You will need to use the digital reverse thrust to go backwards (Thrusters Back). Right now, this is mapped directly in ED bindings file, so moving it to where the Hardpoints are by default will be harder as its used for other things in the script.
Alternatively, if you
only use Forward only, you can change this in the ED bindings file directly without script code change, but that will make the Throttle presets break (ie leave full range & don't use them). Also, I describe below where I have the
** note how to unmap the Hardpoints in the (initHardpointManagement()). If you do this you may be able to map this directly to the Reverse Thrust toggle in ED bindings from ED if you go down that path.
3) Middle Mouse Button where Mic Toggle is:
I'm not sure if it is possible to map a mouse button directly into the script. So alternatively, if you clear the mappings in the script to free up the button in question it should allow you to map this directly in ED bindings to whatever you want to have on that Mouse button. OR if you are using the middle mouse button with external software, you may need to map this to a keyboard key.
Comment out '
//' these lines around 259 in the main script file:
Code:
MapKey(&Throttle, MSP, EXEC([COLOR=#a52a2a]"initMicCommander();"[/COLOR]));
MapKeyR(&Throttle, MSP, EXEC([COLOR=#a52a2a]"initMicCommander();"[/COLOR]));
Then map in ED bindings in game.
4) Add Hardpoints to China Hat Switch:
This one requires a bit of coding, but not too complicated. See line 256 in main ED script:
Code:
[COLOR=#1e90ff][B]if[/B][/COLOR][COLOR=#ffffff]([/COLOR]CruiseOnThrottle == [COLOR=#ffffff]1[/COLOR]){
MapKey(&Throttle, CHF, PULSE[COLOR=#ffffff]+[/COLOR]OrbitalLines);
MapKey(&Throttle, CHB, PULSE[COLOR=#ffffff]+[/COLOR]SelectNextSystemInRoute);
This defines your forward & back actions. You need to add the hardpoints to one of these with the modifier [2].
Code:
MapKey(&Throttle, CHF, EXEC([COLOR=#a52a2a]"if(!Joystick[H4P] ActKey(KEYON+[/COLOR][COLOR=#a52a2a]PULSE[/COLOR][COLOR=#a52a2a][COLOR=#a52a2a]+[/COLOR]OrbitalLines);"
[/COLOR][COLOR=#a52a2a] if(Joystick[H4P] [/COLOR][COLOR=#a52a2a]ActKey(KEYON+[/COLOR][COLOR=#a52a2a]PULSE[/COLOR][COLOR=#a52a2a][COLOR=#a52a2a]+[/COLOR][COLOR=#a52a2a]DeployHardpoints[/COLOR]);"[/COLOR]));
** For cleanup, I would also go into the EDFunctions file (initHardpointManagement()) around line 295 & comment out the following to ensure that Hardpoints are disabled on the default button:
// ActKey
(KEYON
+PULSE
+DeployHardpoints);
The rest of the function will still be used for the other commands mapped.
5) Remapping the Mic Switch & Coolie Hat Switch on the Throttle:
Good news here is that these are
not mapped in the script! You can see these commented out/null around line 232 & 239 respectively in the main script file. This means that all these directional hat switches can be mapped directly in ED to your liking.
You should still be able to use combo/modifier commands directly in ED bindings for things like the Yaw left/right. I would recommend leaving as much of the existing mapping as possible, so if there is a keyboard command mapped already, try to leave it and just add the DX mapping via the button press of the hat switch. This will minimise breaking anything else that may use it in the script.
I think that covers everything, but let me know if I missed something. There may be further cleanup or remapping needed depending how it all works out (may be worth keeping a note of those things you are removing or moving to double check). Any questions or issues, will help if I can.
AD