Carma Key Binder
User avatar
QTZ created Carma Key Binder on Sun Feb 15, 2015 4:39 pm
Post
Carma Key Binder

It's a VB tool for Carmageddon 1 / Splat Pack / demos and mods.
With this tool you can bind keys that are not possible to bind from game, also all customizable functions are available to bind.
Attachment:
CKB.png
CKB.png [ 16.87 KiB | Viewed 2398 times ]

Current version is at very beta stage. There is no load error handling implemented. It need special text files (text format decrypted and full, without "," characters which are not tolerated by simple input command...).

You can run it as standalone then just copy saved keymap_0.txt (1, 2, 3) into game folder.
If you want to test it in game folder create backup of your text files first and use those included (all files should be copied to game dir)! There is also default UK keyboard.cok included.

Edit1: This is Windows Application, so must be started from Windows.
However may be used with DOS Box installation (or any other) of Carmageddon / Splat Pack.

Probably some (or most) descriptions for functions (and for some keys) are wrong, most of them are not tested... If you know - find out - proper - better descriptions or keys mistakes, please let me know here.

The story: I know from years there are keymap files which can be customized outside the game (I have done it in the past for C2), but since default C1 keyboard setting is brilliant for me I always think changing that in C1 is pointless, till now.

On GOG forum there is information how to reassign "S" key which prevent of using WSAD combination as directions (or whatever). So this is not true what Stainless say that we can't reassign 'S' key, it's not a bug but it's feature (to prevent of assign few keys to one function), which become annoying without proper setup.

There is also customized keymap_0.txt file for laptop which is just expanded usage of above information, however this convince me to create this tool. The file is for C2, for C1 it look completely messed up (few keys are added in the middle of file). Btw. I included two configs (C, D) which are set to main keys only (it look like some less important are not working).

Edit2: File mentioned above is for C2, so that's why it look completely messed up, however some functions are set to one key.

There is much laptops without keypad, keyboards without numeric block, so it fill the gap. This also allow to set the keys for left hand, arrows or whatever we want. Some keys are hard-coded in game, but we can set almost everything (I hope).

Note: To detect keypad key-pressing Num Lock must be set to 'on' first.

This tool doesn't prevent from set one key to many functions (yet), so we are responsible to do it right way. There is a information column which indicate reuse of keys, but for some function (set by default) this is not critical, like for those accessed with 'controls' or 'shifts' and in certain modes (like in cockpit view).

I think to add Carmageddon 2 support in the future, since there are same problem (also like F1 key, which is set by default, but can't be assigned again when changed from game)

This program access:
- KEYMAP_0.TXT (A config)
- KEYMAP_1.TXT (B config)
- KEYMAP_2.TXT (C config)
- KEYMAP_3.TXT (D config)

- DKEYMAP0.TXT (default for A)
- DKEYMAP1.TXT (default for B)
- DKEYMAP2.TXT (default for C)
- DKEYMAP3.TXT (default for D)

- KEYNAMES.TXT (key names taken from this file, displayed optionally)
- TEXT.TXT (some text taken from this file, displayed optionally)

The other file which is important for keyboard setting (not used by this tool) is:
- KEYBOARD.COK
This file is responsible for keyboard layout (my tool was only tested with UK version).
So if we have for example Franch Carmageddon this file is in AZERTY standard, unfortunately game doesn't have setup for that file, so if it not match our keyboard layout we have keys switched. Splat Pack have few KEYBOARD.COK files (look in INT sub-folder) used by it setup (in GOG release setup is removed**, however they included KEYBOARD.COK files), unfortunately it took the file based on Carmageddon installation language in PATHS.TXT, so we still have no possibility to choice, there is not even information what that file does... The solution is to manually copy one of KEYBOARD.COK over existing (make backup first) and try. Also it's possible to set it using my Unofficial Carmageddon Patch. It is scheduled to be added to my other patches too, btw.

Edit3: **) Actually setup is included, but we need to extract it from .gog file (copy .gog file to .iso, then extract)

So we don't need to type codes with switched letters or replacing the keyboard.


Last edited by QTZ on Tue Feb 17, 2015 5:22 pm, edited 1 time in total.
User avatar
Harmalarm on Sun Feb 15, 2015 7:56 pm
Post
Nice tool. I tried it but ran into a problem.

I am on a laptop without numpad, so this is really helpfull for me. I just noticed that now that I have set the arrow keys for the accelerate, brake and steering part, that the car steers to the right when I accelerate.

These are my settings:
Attachment:
2015-02-15_20h55_31.jpg
2015-02-15_20h55_31.jpg [ 126.87 KiB | Viewed 2372 times ]


any thoughts on why this is happening?
User avatar
QTZ on Sun Feb 15, 2015 9:11 pm
Post
I have no access to C1 now (this PC is run out of HD space, so even demo can't be installed), to test, but by looking your config should work fine. I suggest to change "Sound Off / On" to "v" (for example) and "Net: Send Message" to "t". "w" is also used for two functions it will work but when you will press 'w' 'outside' car and then switch to cockpit view it will be set to "Look forward". The numbers indicate how many times one key is mapped, for the arrows this is blank, so means not used elsewhere. However some keys are hard-coded like "," (<) and "." (>) for replay playing. Arrows work fine for me (tested earlier - my config C).

The only thing that come to my mind is you are trying this with C2? Since I was trying the file mentioned above with C1 and I ended up with messed up controls, then I have found they put additional functions in the middle of C1 setup. So if you want to use this for C2 it require to add missing entries.

Anyway I will try this in C1/C2.
User avatar
Harmalarm on Sun Feb 15, 2015 9:24 pm
Post
Yes I am trying this in C2. My bad. :lol:
User avatar
QTZ on Sun Feb 15, 2015 9:33 pm
Post
:) C2 support is scheduled!

Edit: Corrected typo


Last edited by QTZ on Tue Feb 17, 2015 4:41 pm, edited 1 time in total.
User avatar
Toshiba-3 on Mon Feb 16, 2015 11:38 am
Post
Very nice initiative!
Definitely a tool that will come in handy!
Image / carmageddon add-ons at road reaction
User avatar
QTZ on Thu Feb 19, 2015 12:16 pm
Post
Thanks :) I really don't know why we don't have such tool yet ;)

Most additional functions need testing - if they work (I think some are just to prevent user from reuse some keys, but are hard-coded anyway; some probably not used at all or need special mode to activate) and if they are correctly described, since I put most of description just based on knowledge, but not actually trying. However basic controls should be fine, which is most important.

Since I am tired, I think to add just quick option to import / export key setting from / to C2.
This will drop some functions on import and add default or set to one key on export :)
This should be possible to remap missing keys from C2 then.

Edit:

It's ready :)

As announced - on import some functions which are not present in C1 are dropped. If there are joystick 1 buttons 5 to 32 in use, they are remapped to joystick 1 buttons 1 to 4 instead (need check and eventually remapping).
On export for missing functions it using C2 default keys, since all default key sets have those keys same.

C2 demo is partially compatible too (all except for joysticks, not tested, but it may crash if joystick will be set to play for C2 demo). C2 demo using same joystick config as is in C1, but not supported by this tool (it simple need to add another option like export to C2 demo which skip conversion of joysticks settings).

To import C2 keys copy your keymap_?.txt files from C2 DATA to DATA_C2_To_Import folder then import setting you want. You can edit it and save for Carmageddon 1 or export back as Carmageddon 2 file (of course you can export C1 settings too) - copy it from DATA_C2_Exported to Carmageddon 2 DATA folder. Then edit 9 defaulted function from C2 game if you need. If you can't set selected key from game you need first to free this key in Key Binder (set to other free key you want) then export the file again.

The new Carmageddon 2 functions (in KeyMap_?.txt) are:

line 10: Alt = alt (1) (it's the only new function not available from C2 to set, but why we may want to change it?)

line 62: Activate Powerup (Use Power Up) = alt (1)
line 63: Inventory = ; (56)
line 64: Inventory Left (Previous Power Up) = [ (60)
line 65: Inventory Right (Next Power Up) = ] (61)

line 73: Target Lock = t (40)
line 74: Cycle Target = y (45)
line 75: Flap Doors = enter (51)
line 76: Change Camera (Camera mode) = keypad * (76)
line 77: Cycle Headups = f1 (91)

Note: Export doesn't count as save - 'edit' status is not affected.

Other Changes:
- Directions keys / joysticks directions order in 'Keys' menu are set to match function order (up, down, left, right).
- Too big or too small values are exchanged to 'shift' on load / import.
User avatar
Harmalarm on Thu Feb 19, 2015 12:55 pm
Post
Cool. I will give it a try once I get home tonight
User avatar
QTZ on Tue May 12, 2015 5:00 pm
Post
OK.

After some testing:

Keys:

[keypad =] - doesn't work, there is no such key, num-pad enter is already mapped elsewhere
[\] - doesn't work, there is no such key, or maybe it's useful for other keyboard layout(?), game using key named '#' instead
[#] - "\", can be set from game (used instead of [\])

[print screen] - doesn't work (not detected)

[pause] - pause, but can't be detected with old exec or US keyboard.cok (returned left-control)

[shift] - any shift, can't be set form game
[alt] - any alt, can't be set form game
[control] - any control, can't be set from game
[command] - any control (second time), can't be set from game

Note: "Delete" key actually work in demo, but keys are shifted, so it's not accessible to re-bind from demo game. So fake alert about this.

I have tested and confirmed most functions from 'first page' (with 'Sort' option selected), except for:
- function set as "Space" - which I call "View Net Players" as is in C2?
- function which is by default set to "r" - have no idea what is this for?
- group I was thinking is for replay functions, but those seems to be hard-coded. Binding not working or the functions are for something else?

From 'second page' I have confirmed just two keys: Control and Shift so far.
Keys 1 to 7 are for options - in demo those are enabled in game by default.
I have no idea what for are F1 and "/" keys (second one probably work with Control or Shift)?

I have found that during replay we can bring hud by pressing Control + "I" (default keys), but "I" must be enabled first (KEVWOZEAR).

So maybe other unknown functions need 'special' mode to work?

That's all for today... :)

Edit:

Update:

- some corrections in descriptions

- some keys order in menu (not working or problematic moved below correct one)

- paths to C1 and C2 can be set in Settings.ini which is saved in (you need to run CKB [save settings or just quit] once to create this file):

%APPDATA%/Carma Key Binder/Settings.ini
or
%WINDIR%/Carma Key Binder/Settings.ini
or
%TEMP%/Carma Key Binder/Settings.ini

- now one path is used for C2 import and export, but when exporting there is additional question dialog

- some problematic keys conversion added on export / import:

C2->C1
- convert '\' into '#' (used as '\' in C1)
- convert '#' into '\' (I hope this is correct for some keyboards...)
- convert "print screen" into "caps lock" ("print screen" not work in C1, "caps lock" not work in C2)
- convert "right alt" into "pause" (right alt may be detected as left control in C2, pause not work in C2; in C1 pause may be detected as left control [work]) - so...
- joystick remap (present in previous version too)

C1->C2
- convert '#' into '\' (C2 using '\')
- convert '\' into '#' (I hope this is correct for some keyboards...)
- convert "caps lock" into "print screen" ("caps lock" not work in C2, "print screen" not work in C1)
- convert "pause" into "right alt" (in C1 pause may be detected as left control (not work); right alt may be detected as left control in C2 (not work), pause not work in C2 at all) - so...
- joysticks remap (as in previous version)

- C1/C2/C2 demo detection is still not implemented, so just DO NOT COPY THIS TOOL TO C2 DIRECTORY! AND SET C1 AND C2 FOLDERS CORRECTLY!

Edit2:

Update:

Fixed:
- bug: when program is moved and previous location is deleted - refuse, to work.
- bug: it always save C1 files in own DATA directory (no matter what is set in ini).

Currently it saving files at paths defined in Settings.ini (path to ini described above), on first run it save location and try to always use it. If path not exist - it set (C1 only) path to new location. So the best is to edit ini with paths we want, then no matter where we start it will try to use those locations. I have added option to see current paths and to edit ini (you need to have set up app for ini extension to open).

- when no C1 files are found it set path to it own DATA folder.
- when own DATA folder is set to use or some files are missed - in place of missing files it using own descriptions and game defaults**.
- now it can load any decrypted version of C1 TEXT.TXT, so you can use it with translations (of course, only text that is present in this file will be replaced).
- there is no need to overwrite .TXT files with those included in CKB (those are C1 files) - only settings B and C (KEYMAP_2.TXT and KEYMAP_3.TXT) are modified - to arrows and WSAD key combinations. (If you need to change keyboard layout to UK QWERTY you may use included KEYBOARD.COK.)

- some other tiny fixes.

Edit3:

**) I have found that default setting B in game have bug - the buy armour, power, offense keys are shifted, so we have 'delete', 'w' and 'e' keys instead of 'q', 'w', 'e'. This is set wrong because there was bug in early C1, which show inappropriate keys in key configuration in game (we can see this problem in demo).

Edit4:

Big update!

- Added C2 Full version / mod support in main mode (detection is not implemented; demo not yet supported).
- Added simple twat file parser, to read text from data.twt file (Is any translated version of C2 even exist?).
- Limitation: Export / Import is possible only in C1 mode.
- All functions which can be set in C2 keymap files (of course all C1 too) are available - some not working in C2. However this allow to free keys in use (map them to other keys), we want to remap (which game prevent to set - like 'q', 'w', 'e', 's', 'f1' keys).
- Most functions names stay as in C1.
- Build in key names are in upper case now.
- 'Null' keys are allowed to set (it is possible to set '[undefined]' from game).
- Now menu can be accessed by pressing second mouse button, but function must be selected with first mouse button or using keyboard first.
- Some bugs are fixed.

- Bug: Just before release I have found error introduced in previous version which cause C2 path generated by program to point to DATA\_C2 instead DATA_C2, anyway to work with C2 it's required to set correct path to C2 DATA folder - there is dialog for it, which should work fine.

Edit5:

Build 50 available!

- Many bugs fixed.
- Now it's possible to switch C1<=>C2 mode at any time.
- New example keyboard schemes for C1 and C2 included - settings C & D - Arrows / WSAD for laptop (you need to copy the files KEYMAP_2.TXT, KEYMAP_3.TXT to games to try - DATA is for C1, DATA_C2 is for C2).

Edit6:

Build 53:
- new: keys in use are checked in Key menu.

Build 54 (test 10):
- bug fix: menu "File" descriptions are updated correctly on mode switch to match available functions.

Here is short manual (for both C1 and C2, but information written with C2 in mind).
User avatar
QTZ on Fri May 22, 2015 12:52 am
Post
Build 61 is available!

Export Help (Ctrl+K) option added:

It generate KEYSC#_#.TXT files (one of them) which are similar to default help file, but contains our keys.
The file contains only the basic controls as is in standard help file.
The key names are taken from CKB, so can be set to build in or taken from game.
The descriptions are different than used in CKB and can't be changed.
Also "Sort" option not affect generated file (order is different - to be similar to original help file).

Example of Arrows help file:
Code:
                             Carmageddon controls help

  Arrow Up             Accelerate forward
  Arrow Down           Brake when going forwards
  Arrow Left           Steer left
  Arrow Right          Steer Right
  Z                    Turn tightly
  Space                Handbrake
  C                    Toggle between internal and external views
  J                    Look left from internal view
  K                    Look forward from internal view
  L                    Look right from internal view
  W                    Move external camera forward
  S                    Move external camera back
  A                    Move external camera around left
  D                    Move external camera around right
  H                    Horn
  P                    Toggle pratcam
  M                    Toggle mirror on and off when in internal view
  V                    Toggle sound on and off
  Tab                  Show/Hide map
  Esc                  Go to menu
  Backspace            Repair car
  Insert               Recover vehicle if it's on its roof or side
  Delete               Buy armour
  End                  Buy power
  Page Down            Buy offensive
  `                    Send message
  '                    Toggle pedestrians and giblets on and off
  -                    Screen smaller
  =                    Screen bigger
  Any Shift+D          Screen dump
  F2                   Save
  Any Control (Comm.+S Save
  F3                   Load
  Any Control (Comm.+L Load
  Any Control (Comm.+A Abort race
  Any Control (Comm.+Q Quit
  \ [was #]            Toggle between live action and action replay modes

  When in action replay mode, use the mouse or these keys:

  Keypad 5 Cent./Space Pause/unpause
  Keypad 0./Backspace  Flip direction of playing
  ,                    Play backwards
  .                    Play forwards
  Keypad *             Cycle through different camera modes
  Keypad 4 Le./Page Up Rewind
  Keypad 6./Page Down  Fast forward
  Keypad 7 Home/Home   Go straight back to the start of the 'tape'
  Keypad 9 Pg Up/End   Go straight to the end of the 'tape'
  Keypad 1 End         Frame advance backwards
  Keypad 3 Pg Dn       Frame advance forwards






Example of C2:
Code:
                             Carmageddon 2 controls help

  Arrow Up             Accelerate forward
  Arrow Down           Brake when going forwards
  Arrow Left           Steer left
  Arrow Right          Steer Right
  Z                    Turn tightly
  Space                Handbrake
  C                    Toggle between internal and external views
  X                    Change Camera during race
  W                    Move external camera forward
  S                    Move external camera back
  A                    Move external camera around left
  D                    Move external camera around right
  T                    Target lock toggle on and off
  Y                    Cycle Target
  H                    Horn
  M                    Mini-map toggle on and off
  V                    Toggle sound on and off
  Tab                  Show/Hide map
  Esc                  Go to menu
  Backspace            Repair car
  Insert               Recover vehicle if it's on its roof or side
  Delete               Buy armour
  End                  Buy power
  Page Down            Buy offensive
  `                    Send message
  N                    View net players
  Any Alt              Activate powerup
  ;                    Powerup inventory
  [                    Select previous powerup
  ]                    Select next powerup
  Enter                Flap doors
  -                    Screen smaller
  =                    Screen bigger
  Any Shift+D          Screen dump
  F9                   Cycle headups
  Any Control (Comm.+A Abort race
  Any Control (Comm.+Q Quit
  \                    Toggle between live action and action replay modes

  When in action replay mode, use the mouse or these keys:

  Keypad 5 Cent./Space Pause/unpause
  Keypad 0./Backspace  Flip direction of playing
  ,                    Play backwards
  .                    Play forwards
  Keypad *             Cycle through different camera modes
  Keypad 4 Le./Page Up Rewind
  Keypad 6./Page Down  Fast forward
  Keypad 7 Home/Home   Go straight back to the start of the 'tape'
  Keypad 9 Pg Up/End   Go straight to the end of the 'tape'
  Keypad 1 End         Frame advance backwards
  Keypad 3 Pg Dn       Frame advance forwards
  Any Control (Comman. Manual mode camera movement modifier up/down
  Keypad /             Record quick time movie






Note: The keys for replay mode are hard-coded, so always the same.
Note: The typos are also in default help file... Iwill correct those in next version... But here are corrected.
Note: As we can see this is not comfortable in C2 to have CTRL+A for "abort race" when camera controls are set to WSAD,
since CTRL+UP/DOWN (here W/S) are for camera control and we can incidentally press CTRL+A.

Edit: Build 63:
- changed order for "Quit" function.
- custom key bindings changes: Abort (CTRL+Home), Quit (CTRL+PgUp), Dump (Shift+E).
Pages: 1



Extra information
It is currently Tue Apr 25, 2017 2:42 pm,

Please Register a username.
In total there are 2 users online :: 0 registered, 0 hidden and 2 guests
Users browsing this forum: No registered users and 2 guests
Moderators: coffeycup, Toshiba-3

Powered by phpBB :: Hosted by n3wton :: Molested by goats
CWA Links
Facebook