SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH4 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 07-31-07, 11:35 AM   #1
panthercules
The Old Man
 
Join Date: Apr 2005
Posts: 1,336
Downloads: 6
Uploads: 0
Default [TEC] Tutorial for mapping commands to keys?

I know there's got to be one out there somewhere, but I couldn't find it when I searched so I hope someone can point me to it here. There are lots of commands listed in the command.cfg file that don't seem to have keys mapped to them, and I'd like to map a few to be able to use them with voice recognition.

Can someone point out how to go about mapping some of these commands to keys? (such as the following one, for example):

[Cmd152]
Name=Propulsion_recharge
Ctxt=1
MnID=0x3F0F0002
__________________
panthercules is offline   Reply With Quote
Old 07-31-07, 01:34 PM   #2
CaptainCox
Sea Lord
 
Join Date: Feb 2007
Location: A Swede in Frankfurt am Main
Posts: 1,897
Downloads: 4
Uploads: 0
Default

This is a pretty good tut
http://www.subsim.com/radioroom/showthread.php?t=113354

and this written by myself :p (example of adding the "weather report button")
http://www.subsim.com/radioroom/showthread.php?t=118548

Then you need to do the graphics of the button if you want to do it properly
All the buttons are found here
Quote:
C:\Program Files\Ubisoft\Silent Hunter 4 Wolves of the Pacific\Data\Menu\Gui\Layout
Called
Quote:
Hud.dds
__________________
CaptainCox is offline   Reply With Quote
Old 07-31-07, 08:38 PM   #3
panthercules
The Old Man
 
Join Date: Apr 2005
Posts: 1,336
Downloads: 6
Uploads: 0
Default

Capt - thanks for the response and the links to the buttons tutorials.

Unfortunately, I must not have been clear enough - I'm not looking to make new buttons at all here. Just looking to be able to assign some commands to keys (so I can then use the speech recognition program that works by recognizing a spoken command and outputting a key stroke signal). In my example above, I was looking to be able to assign a key to toggle "recharge batteries", so I could speak a command to do that instead of having to push the button for it.

I know it's fairly easy to re-assign keys for game commands that have already been assigned to keys (e.g., changing "fire" to be "Ctrl+Enter" instead of just "Enter"), but I'm not sure how to do it for a command that hasn't been assigned to a key in the first place.

Any ideas?
__________________
panthercules is offline   Reply With Quote
Old 07-31-07, 09:02 PM   #4
DirtyHarry3033
Weps
 
Join Date: Aug 2005
Posts: 351
Downloads: 0
Uploads: 0
Default

Panthercules, do this:

1) Download and install SetKeys 1.11 for SH3, it's in the download section here at subsim.

2) Make a copy of your commands.cfg file somewhere else on your drive. That is important, you don't want to edit your real commands.cfg with SetKeys as there are some keys it will break in SH4 (it was written for SH3...)

3) Point SetKeys to the copy you made. Locate the commands you want and assign keys to them, then save the file.

4) Open up your edited copy in Notepad or your favorite editor, and open the real commands.cfg in another session of your editor.

5) Locate and copy/paste the commands you changed in the copied/edited commands.cfg into the real commands.cfg. Then save and enjoy!

Of course, back up your live commands.cfg 1st in case something goes wrong I've done a number of keymappings this way and it works great!

HTH!

DH
DirtyHarry3033 is offline   Reply With Quote
Old 07-31-07, 09:49 PM   #5
Fearless
Ace of the Deep
 
Join Date: Feb 2007
Location: Adelaide, Australia
Posts: 1,047
Downloads: 340
Uploads: 1
Default

I for one go into the Commands.cfg and look for key commands that have been disabled with the ; then
I check to make sure that key hasn't been re-allocated to some other command.
If it hasn't, I copy that key command line and paste it where I want to activate a particular command.

Eg,

[Cmd152]
Name=Propulsion_recharge
Ctxt=1
MnID=0x3F0F0002
SetKey=0x34D,,"T"

At work now so can't fully remember what the key= line looks like but is similar to that I think.
__________________
Fearless

System Specs: AMD Ryzen 7 5800X 8 Core 16 Thread CPU, 3.8GHz Base Clock, 4.7GHz Boost, 105W TDP, 32MB L3 cache | MSI GeForce RTX3060Ti 8Gb Graphics | Corsair Vengeance RGB Pro 32Gb (2x16Gb) 3200 MHz CL16 DDR4 Ram | Samsung 970 Evo Plus NVMe SSD 1TB | Seagate Barracuda 2.5in 2TB HDD | AOC QHD 165 Hz FreeSync HDR curved 31.5in Monitor | ASUS ROG Strix LC 240 ARGB AIO Liquid CPU Cooler White Edition | ASUS ROG Strix Gold 750W Modular Power Supply | Corsair iCUE 5000X RGB Tempered Glass Mid Tower Case White.

Last edited by Fearless; 07-31-07 at 11:41 PM.
Fearless is offline   Reply With Quote
Old 07-31-07, 10:06 PM   #6
DirtyHarry3033
Weps
 
Join Date: Aug 2005
Posts: 351
Downloads: 0
Uploads: 0
Default

That's the cool thing about SetKeys, it will tell you if there's a conflict with the key you picked. Also it gives the right hex-code for the key and the right syntax, so it is a no-brainer for a brain-dead moron like me :rotfl:

Only prob is, as I mentioned, if you edit the live SH4 commands.cfg with it, some keys get broken. Two that I noticed were, gramophone and radio. Neither keys nor buttons would work. But if you edit a copy of commands.cfg and then just paste in only the changed commands to the live file, it's no problem at all. Nothing breaks and you don't have to worry about hex codes or syntax!

DH
DirtyHarry3033 is offline   Reply With Quote
Old 07-31-07, 11:34 PM   #7
panthercules
The Old Man
 
Join Date: Apr 2005
Posts: 1,336
Downloads: 6
Uploads: 0
Default

Quote:
Originally Posted by Fearless
I for one go into the Commands.cfg and look for key commands that have been disabled with the ; then
I check to make sure that key hasn't been re-allocated to some other command.
If it hasn't, I copy that key command line and paste it where I want to activate a particular command.
Problem I have is with the commands where there just isn't any key line (disabled or otherwise), like the one below:
[Cmd152]
Name=Propulsion_recharge
Ctxt=1
MnID=0x3F0F0002
Does the SetKeys thing work for those kinds of commands which never had key lines? If so, guess I'll give that setkeys thing a try - I remember seeing some posts about it during the SH3 days, but I never messed with it so this will be another adventure

Thanks for the tips on how to protect my real file - I suspect that will prove to be very sage advice
__________________
panthercules is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 03:25 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.