Jump to content
You need to play a total of 5 battles to post in this section.
17L20

Binding the Gun Locks commands

8 comments in this topic

Recommended Posts

15
[TMS]
Members
90 posts
12,115 battles

Most players are familiar with the keyboard shortcuts to lock your guns on a particular bearing (Ctrl+X) or sector (Space+X). And these commands are real handy at times. But what if you're not real deft with the keyboard (like me) and want to assign those commands to different keys or mouse buttons. Unfortunately, there's no option for it in the Settings>Controls screen. So you must do it manually by editing the preferences.xml file. Here I'll show you how. But please be careful, and if you don't understand something, ASK. Because if you screw something up, well, you know the rest...

1. BACKUP YOUR preferences.xml FILE. Now open your preferences.xml file in your favorite text editor (I like wordpad).

2. Press Ctrl+F (find) and look for <commands>. It should appear near the bottom of the file. If it does, go to step 3. If not, then you've never altered a command. So do the following:

2a) Close the text editor and start up the game.

2b) Go to Settings>Controls and add a harmless key command. Example: assign the O key as the secondary key (right box) to the Reload Torpedo Tube command.

2c) Apply the command and exit the game. Start at step 1 again and you should now see the <command> section in step 2.

3. Next you must insert code into the <commands> section. Notice further down, there's a line that reads </commands>. This is the END of the section. If you have other keys reassigned or added, the code is inserted in blocks of code starting with the command name (like <CMD_TORPEDO_RELOAD) and ends with  /command name (like </CMD_TORPEDO_RELOAD), (Note the forwardslash at the start of the ending command). You must insert code in it's own separate block. Between the end of one block and before the start of the next block.

4. To reassign a key/button for the Locked On Bearing command, insert this block of code:

                        <CMD_RELATIVE_GUNS_LOCK
                                context="ship"
                                type="down">
                            <VALUE
                                    key="KEY_MOUSE4"
                                    mods=""
                                    index="1" />
                        </CMD_RELATIVE_GUNS_LOCK>

Note that this will assign the command to the Mouse4 button. If you want a different key, replace the MOUSE4 with your desired key (Example "KEY_O" or "KEY_RBRACKET").

5.  To reassign a key/button for the Locked On Sector command, insert this block of code:

                        <CMD_ABSOLUTE_GUNS_LOCK
                                context="ship"
                                type="down">
                            <VALUE
                                    key="KEY_MOUSE5"
                                    mods=""
                                    index="1" />
                        </CMD_ABSOLUTE_GUNS_LOCK>

Note that this will assign the command to the Mouse5 button. If you want a different key, replace the MOUSE5 with your desired key (Example "KEY_P" or "KEY_LBRACKET").

6. Save the file and start the game. If you screwed something up, the game will either crash or start and rep[lace the preferences.xml with the default one. In either event redo the process.

Options: The code inserts will assign a secondary key to the commands. So the Ctrl+X and Shift+X keys will still work. If you want to replace the original key commands, change the index line from "1" to "0". If you want a key combo (a key pressed along with the ALT, CTRL or Shift key), insert that key name (KEY_LALT, KEY_LCONTROL, or KEY_LSHIFT) inside the quotes of the mods line (Example mods="KEY_LALT")

If there's a part you don't understand or you think needs clarification, don't hesitate to ask.

Edited by 17L20
  • Cool 1

Share this post


Link to post
Share on other sites
26
[WOLF8]
Members
81 posts
17,775 battles

Thank you, this will help. I was wondering if you know how to set a single "Key" to perform a double mouse click??? I been finding myself having issues with getting the double mouse click to fire a full salvo. It is usually one turret follow by the remaining turrets. I mess with the windows setting to try to get it to work. It does for a few rounds but then I get sidetracked and never get the click right.

Share this post


Link to post
Share on other sites
3,703
Supertester, Alpha Tester
6,051 posts

In general, trying to change anything associated with a mouse click may end up with a suboptimal result. Either backup your preference file or be prepared to delete it and start your key assignments over.


You may want to look at your mouse setup. If you have extra buttons it may be possible to assign one of the extras to a double click. It depends on the mouse.

 

 

 

 

Share this post


Link to post
Share on other sites
15
[TMS]
Members
90 posts
12,115 battles
6 hours ago, Ens_Stovall said:

how to set a single "Key" to perform a double mouse click

You can modify a key that is already assigned to a double-click. So you can do a salvo fire with a single keystroke. But as Quaffer says, be careful. Strange things can happen when you mess with reserved keys. Here's how I recommend you do it.

Start with clean default Controls. Start the game and enter the Settings>Controls page. Then assign the desired salvo key/mouse to the SECONDARY (right side box) Fire control (See the attached pic where I assign the middle mouse button to do the secondary Fire command and then, since I stole the MMB from here, I assign the Left Side mouse button for the Track Shell command). Apply the changes and exit the game.

Now open your preferences.xml file and go to the <commands> section. It should look something similar to this (if you used the mid mouse button, otherwise the KEY will be different):

 

<commands>
	<CMD_SHOOT
			context="ship"
			type="hold">
		<VALUE
				key="KEY_MOUSE2"
				mods=""
				index="1" />
	</CMD_SHOOT>
	<CMD_CINEMATIC_SHOOT
			context="ship"
			type="down">
		<VALUE
				key="KEY_MOUSE4"
				mods=""
				index="0" />
	</CMD_CINEMATIC_SHOOT>
	<CMD_SHOOT_SALVO
			context="ship"
			type="doubleTap">
		<VALUE
				key="KEY_MOUSE2"
				mods=""
				index="1" />
	</CMD_SHOOT_SALVO>

Now, in the <CMD_SHOOT_SALVO> block, change the line type="doubleTap"> to type="down">. Your <CMD_SHOOT_SALVO> block should now look like this:

	<CMD_SHOOT_SALVO
			context="ship"
			type="down">
		<VALUE
				key="KEY_MOUSE2"
				mods=""
				index="1" />
	</CMD_SHOOT_SALVO>

With the change, the game should see the 'down' action before the 'hold' action and salvo your guns.

Save the file and you should be good to go. If you have any funny business, try deleting the <CMD_SHOOT> block. It might be interfering.

controls1.jpg

Edited by 17L20
code update

Share this post


Link to post
Share on other sites
15
[TMS]
Members
90 posts
12,115 battles
5 hours ago, Ens_Stovall said:

It is usually one turret follow by the remaining turrets.

I'm guessing your double-click setting is a little slow. So the game sees the initial click and fires, then the double-click registers and fires the remaining guns. Try going to your Wndows Control Panel>Mouse and adjusting the double-click timing.

Share this post


Link to post
Share on other sites
26
[WOLF8]
Members
81 posts
17,775 battles

I have been using the Windows control panel to set the double click. But during game play the arthritis kicks up and it through off the timing off. So getting it a key bind I'm hoping will improve my game play.

Share this post


Link to post
Share on other sites
26
[WOLF8]
Members
81 posts
17,775 battles

Thank you both for posting and suggestions. I first took @Quaffer suggestion and looked at the Logitech software and I could not see any way to make a single mouse button have a double click. I could set macros for regular key strokes. So I took @17L20 suggestion for testing it out with a non game key bindings. Making the "L" key the second control/command for firing. Then I made a macro of the L key in the Logitech software as a double key stroke. Long story short it work great. From my limited testing last night my alpha strike and shell grouping look wonderful.

 

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

×