Jump to content
The Dark Mod Forums

keymap for "nextweapon/wheel down"


buzzwall

Recommended Posts

[Version2.08 File thedarkmod.x64 

Ubuntu 20.10

In the training mission, on my very first task, I'm to press the "wheel down" button. to turn the page. 

I have tried pushing and rolling my mouse button. 

Looking into DarkModKeybinds.cfg I don't see 'wheel' or 'next'. 

 

I am not an experienced gamer so... 



 

Edited by buzzwall
Link to comment
Share on other sites

I can see the following lines at the bottom of my DarkModKeybinds.cfg:

bind "MWHEELDOWN" "_impulse47"
bind "MWHEELUP" "_impulse48"

Inserting those should bind weapon scrolling and page turning to the mouse wheel.

Link to comment
Share on other sites

I'd add that an impulse is a one-time command in the game, i.e. select the next item in the inventory. A keyboard key can be bound so that it triggers such an event.

Slightly confusing that the continuous form of "impulse" is called "button" (i.e. move forward). Both are assigned to keyboard keys.

Maybe a list of all available impulses and buttons in the engine can be found somewhere in the source code.

Link to comment
Share on other sites

10 hours ago, Dragofer said:

I'd add that an impulse is a one-time command in the game, i.e. select the next item in the inventory. A keyboard key can be bound so that it triggers such an event.

Slightly confusing that the continuous form of "impulse" is called "button" (i.e. move forward). Both are assigned to keyboard keys.

Maybe a list of all available impulses and buttons in the engine can be found somewhere in the source code.

./framework/KeyInput.cpp *looks to be* handling some transformation between system keycodes and application keycodes but it's going to take me some figuring to sort it out. I haven't looked at c++ for over 20 years. Maybe you can explain it, point me to an explanation, or if I get it figured out I'll post it here. 

Link to comment
Share on other sites

I've found a translation of impulse & button names in UsercmdGen.cpp, with the outwardly visible name (like in DarkmodKeybinds.cfg) on the left and the internal name on the right. Not all impulses have given names, since some are for engine internal things like showing pathfinding areas.

userCmdString_t	userCmdStrings[] = {
	// self-explanatory names
	{ "_jump",			UB_UP },
	{ "_parry",			UB_PARRY_MANIPULATE },
	{ "_creep",			UB_CREEP },

	{ "_weapon0",		UB_WEAPON0 },
	{ "_weapon1",		UB_WEAPON1 },
	{ "_weapon2",		UB_WEAPON2 },
	{ "_weapon3",		UB_WEAPON3 },
	{ "_weapon4",		UB_WEAPON4 },
	{ "_weapon5",		UB_WEAPON5 },
	{ "_weapon6",		UB_WEAPON6 },
	{ "_weapon7",		UB_WEAPON7 },
	{ "_weapon8",		UB_WEAPON8 },
	{ "_weapon9",		UB_WEAPON9 },
	{ "_weapon10",		UB_WEAPON10 },
	{ "_weapon11",		UB_WEAPON11 },
	{ "_weapon12",		UB_WEAPON12 },
	{ "_reload",			UB_RELOAD },
	{ "_weapon_next",	UB_WEAPON_NEXT },
	{ "_weapon_prev",	UB_WEAPON_PREV },
	{ "_ready",			UB_READY },
	{ "_center_view",	UB_CENTER_VIEW },
	{ "_objectives",		UB_OBJECTIVES },
	{ "_crouch",			UB_CROUCH },
	{ "_mantle",			UB_MANTLE },
	{ "_inventory_grid",	UB_INVENTORY_GRID },
	{ "_frob",			UB_FROB },
	{ "_lean_forward",	UB_LEAN_FORWARD },
	{ "_lean_left",		UB_LEAN_LEFT },
	{ "_lean_right",		UB_LEAN_RIGHT },
	{ "_inventory_prev",	UB_INVENTORY_PREV },
	{ "_inventory_next",	UB_INVENTORY_NEXT },
	{ "_inventory_group_prev", UB_INVENTORY_GROUP_PREV },
	{ "_inventory_group_next", UB_INVENTORY_GROUP_NEXT },
	{ "_inventory_use",	UB_INVENTORY_USE },
	{ "_inventory_drop",	UB_INVENTORY_DROP },

	// legacy names
	{ "_moveUp",		UB_UP },
	{ "_moveDown",		UB_DOWN },
	{ "_left",			UB_LEFT },
	{ "_right",			UB_RIGHT },
	{ "_forward",		UB_FORWARD },
	{ "_back",			UB_BACK },
	{ "_lookUp",		UB_LOOKUP },
	{ "_lookDown",		UB_LOOKDOWN },
	{ "_strafe",		UB_STRAFE },
	{ "_moveLeft",		UB_MOVELEFT },
	{ "_moveRight",		UB_MOVERIGHT },

	{ "_attack",		UB_ATTACK },
	{ "_speed",			UB_SPEED },
	{ "_zoom",			UB_PARRY_MANIPULATE },
	{ "_showScores",	UB_SHOWSCORES },
	{ "_mlook",			UB_MLOOK },

	{ "_button0",		UB_BUTTON0 },
	{ "_button1",		UB_BUTTON1 },
	{ "_button2",		UB_BUTTON2 },
	{ "_button3",		UB_BUTTON3 },
	{ "_button4",		UB_BUTTON4 },
	{ "_button5",		UB_CREEP },
	{ "_button6",		UB_BUTTON6 },
	{ "_button7",		UB_BUTTON7 },

	{ "_impulse0",		UB_WEAPON0 },
	{ "_impulse1",		UB_WEAPON1 },
	{ "_impulse2",		UB_WEAPON2 },
	{ "_impulse3",		UB_WEAPON3 },
	{ "_impulse4",		UB_WEAPON4 },
	{ "_impulse5",		UB_WEAPON5 },
	{ "_impulse6",		UB_WEAPON6 },
	{ "_impulse7",		UB_WEAPON7 },
	{ "_impulse8",		UB_WEAPON8 },
	{ "_impulse9",		UB_WEAPON9 },
	{ "_impulse10",		UB_WEAPON10 },
	{ "_impulse11",		UB_WEAPON11 },
	{ "_impulse12",		UB_WEAPON12 },
	{ "_impulse13",		UB_RELOAD },
	{ "_impulse14",		UB_WEAPON_NEXT },
	{ "_impulse15",		UB_WEAPON_PREV },
	{ "_impulse16",		UB_IMPULSE16 },
	{ "_impulse17",		UB_READY },
	{ "_impulse18",		UB_CENTER_VIEW },
	{ "_impulse19",		UB_OBJECTIVES },
	{ "_impulse20",		UB_IMPULSE20 },
	{ "_impulse21",		UB_IMPULSE21 },
	{ "_impulse22",		UB_IMPULSE22 },
	{ "_impulse23",		UB_CROUCH },
	{ "_impulse24",		UB_MANTLE },
	{ "_impulse25",		UB_IMPULSE25 },
	{ "_impulse26",		UB_IMPULSE26 },
	{ "_impulse27",		UB_IMPULSE27 },
	{ "_impulse28",		UB_IMPULSE28 },
	{ "_impulse29",		UB_IMPULSE29 },
	{ "_impulse30",		UB_INVENTORY_GRID },
	{ "_impulse31",		UB_IMPULSE31 },
	{ "_impulse32",		UB_IMPULSE32 },
	{ "_impulse33",		UB_IMPULSE33 },
	{ "_impulse34",		UB_IMPULSE34 },
	{ "_impulse35",		UB_IMPULSE35 },
	{ "_impulse36",		UB_IMPULSE36 },
	{ "_impulse37",		UB_IMPULSE37 },
	{ "_impulse38",		UB_IMPULSE38 },
	{ "_impulse39",		UB_IMPULSE39 },
	{ "_impulse40",		UB_IMPULSE40 },
	{ "_impulse41",		UB_FROB },
	{ "_impulse42",		UB_IMPULSE42 },
	{ "_impulse43",		UB_IMPULSE43 },
	{ "_impulse44",		UB_LEAN_FORWARD },
	{ "_impulse45",		UB_LEAN_LEFT },
	{ "_impulse46",		UB_LEAN_RIGHT },
	{ "_impulse47",		UB_INVENTORY_PREV },
	{ "_impulse48",		UB_INVENTORY_NEXT },
	{ "_impulse49",		UB_INVENTORY_GROUP_PREV },
	{ "_impulse50",		UB_INVENTORY_GROUP_NEXT },
	{ "_impulse51",		UB_INVENTORY_USE },
	{ "_impulse52",		UB_INVENTORY_DROP },
	{ "_impulse53",		UB_IMPULSE53 },
	{ "_impulse54",		UB_IMPULSE54 },
	{ "_impulse55",		UB_IMPULSE55 },
	{ "_impulse56",		UB_IMPULSE56 },
	{ "_impulse57",		UB_IMPULSE57 },
	{ "_impulse58",		UB_IMPULSE58 },
	{ "_impulse59",		UB_IMPULSE59 },
	{ "_impulse60",		UB_IMPULSE60 },
	{ "_impulse61",		UB_IMPULSE61 },
	{ "_impulse62",		UB_IMPULSE62 },
	{ "_impulse63",		UB_IMPULSE63 },

	{ NULL,				UB_NONE },

Names for keyboard keys on Windows can be found in win_input.cpp:

Spoiler


static const unsigned char s_scantokey[256] = { 
//  0            1       2          3          4       5            6         7
//  8            9       A          B          C       D            E         F
	0,           27,    '1',       '2',        '3',    '4',         '5',      '6', 
	'7',        '8',    '9',       '0',        '-',    '=',          K_BACKSPACE, 9, // 0
	'q',        'w',    'e',       'r',        't',    'y',         'u',      'i', 
	'o',        'p',    '[',       ']',        K_ENTER,K_CTRL,      'a',      's',   // 1
	'd',        'f',    'g',       'h',        'j',    'k',         'l',      ';', 
	'\'',       '`',    K_SHIFT,   '\\',       'z',    'x',         'c',      'v',   // 2
	'b',        'n',    'm',       ',',        '.',    '/',         K_SHIFT,  K_KP_STAR, 
	K_ALT,      ' ',    K_CAPSLOCK,K_F1,       K_F2,   K_F3,        K_F4,     K_F5,  // 3
	K_F6,       K_F7,   K_F8,      K_F9,       K_F10,  K_PAUSE,     K_SCROLL, K_HOME, 
	K_UPARROW,  K_PGUP, K_KP_MINUS,K_LEFTARROW,K_KP_5, K_RIGHTARROW,K_KP_PLUS,K_END, // 4
	K_DOWNARROW,K_PGDN, K_INS,     K_DEL,      0,      0,           0,        K_F11, 
	K_F12,      0,      0,         K_LWIN,     K_RWIN, K_MENU,      0,        0,     // 5
	0,          0,      0,         0,          0,      0,           0,        0, 
	0,          0,      0,         0,          0,      0,           0,        0,     // 6
	0,          0,      0,         0,          0,      0,           0,        0, 
	0,          0,      0,         0,          0,      0,           0,        0,      // 7
// shifted
	0,           27,    '!',       '@',        '#',    '$',         '%',      '^', 
	'&',        '*',    '(',       ')',        '_',    '+',          K_BACKSPACE, 9, // 0
	'q',        'w',    'e',       'r',        't',    'y',         'u',      'i', 
	'o',        'p',    '[',       ']',        K_ENTER,K_CTRL,      'a',      's',   // 1
	'd',        'f',    'g',       'h',        'j',    'k',         'l',      ';', 
	'\'',       '~',    K_SHIFT,   '\\',       'z',    'x',         'c',      'v',   // 2
	'b',        'n',    'm',       ',',        '.',    '/',         K_SHIFT,  K_KP_STAR, 
	K_ALT,      ' ',    K_CAPSLOCK,K_F1,       K_F2,   K_F3,        K_F4,     K_F5,  // 3
	K_F6,       K_F7,   K_F8,      K_F9,       K_F10,  K_PAUSE,     K_SCROLL, K_HOME, 
	K_UPARROW,  K_PGUP, K_KP_MINUS,K_LEFTARROW,K_KP_5, K_RIGHTARROW,K_KP_PLUS,K_END, // 4
	K_DOWNARROW,K_PGDN, K_INS,     K_DEL,      0,      0,           0,        K_F11, 
	K_F12,      0,      0,         K_LWIN,     K_RWIN, K_MENU,      0,        0,     // 5
	0,          0,      0,         0,          0,      0,           0,        0, 
	0,          0,      0,         0,          0,      0,           0,        0,     // 6
	0,          0,      0,         0,          0,      0,           0,        0, 
	0,          0,      0,         0,          0,      0,           0,        0      // 7
}; 

 

For completeness, here are the full contents of my DarkmodKeybinds.cfg file:

Spoiler

unbindall
bind "ENTER" "_impulse51"
bind "ESCAPE" "togglemenu"
bind "SPACE" "_moveup"
bind "0" "_impulse10"
bind "1" "_impulse2"
bind "2" "_impulse1"
bind "3" "_impulse3"
bind "4" "_impulse4"
bind "5" "_impulse5"
bind "6" "_impulse9"
bind "7" "_impulse7"
bind "8" "_impulse6"
bind "9" "_impulse8"
bind "=" "_impulse49"
bind "[" "_impulse48"
bind "\" "_mlook"
bind "]" "_impulse47"
bind "`" "_impulse0"
bind "a" "_moveleft"
bind "c" "_impulse44"
bind "d" "_moveright"
bind "e" "_impulse46"
bind "f" "_impulse23"
bind "g" "inventory_use '#str_02396'"
bind "i" "_impulse30"
bind "j" "reloadDecls"
bind "k" "inventory_cycle_group '#str_02392'"
bind "l" "inventory_use '#str_02395'"
bind "m" "inventory_cycle_maps"
bind "n" "noclip"
bind "o" "_impulse19"
bind "p" "map xray"
bind "q" "_impulse45"
bind "r" "inventory_hotkey ''"
bind "s" "_back"
bind "t" "notarget"
bind "u" "loadgame quick"
bind "v" "inventory_hotkey '#str_02397'"
bind "w" "_forward"
bind "x" "inventory_cycle_group '#str_02389'"
bind "y" "savegame quick"
bind "z" "inventory_cycle_group '#str_02389'"
bind "BACKSPACE" "_impulse52"
bind "PAUSE" "pause"
bind "UPARROW" "_forward"
bind "DOWNARROW" "_back"
bind "LEFTARROW" "_left"
bind "RIGHTARROW" "_right"
bind "ALT" "_strafe"
bind "CTRL" "_button5"
bind "SHIFT" "_speed"
bind "DEL" "_lookdown"
bind "PGDN" "_lookup"
bind "END" "_impulse18"
bind "F3" "_impulse17"
bind "F4" "savegame quick"
bind "F5" "loadgame"
bind "F6" "_impulse20"
bind "F7" "_impulse22"
bind "F9" "loadgame quick"
bind "F12" "screenshot"
bind "MOUSE1" "_impulse41"
bind "MOUSE2" "_attack"
bind "MOUSE3" "_zoom"
bind "MWHEELDOWN" "_impulse47"
bind "MWHEELUP" "_impulse48"

 

 

  • Like 1
Link to comment
Share on other sites

Seems a few things are available as both buttons and impulses. UsercmdGen.h lists buttons:

Spoiler




// ButtonState inputs; originally from UsercmdGen.cpp, left out of SDK by accident
// sourced from http://www.doom3world.org/phpbb2/viewtopic.php?f=26&t=18587&p=170143
typedef enum {
   UB_NONE,

   UB_UP,
   UB_DOWN,
   UB_LEFT,
   UB_RIGHT,
   UB_FORWARD,
   UB_BACK,
   UB_LOOKUP,
   UB_LOOKDOWN,
   UB_STRAFE,
   UB_MOVELEFT,
   UB_MOVERIGHT,

   UB_BUTTON0,
   UB_BUTTON1,
   UB_BUTTON2,
   UB_BUTTON3,
   UB_BUTTON4,
   UB_CREEP,
   UB_BUTTON6,
   UB_BUTTON7,

   UB_ATTACK,
   UB_SPEED,
   UB_PARRY_MANIPULATE,
   UB_SHOWSCORES,
   UB_MLOOK,

#ifdef QUAKE4
        UB_INGAMESTATS,
        UB_VOICECHAT,
        UB_TOURNEY,
#endif//QUAKE4

   UB_WEAPON0,
   UB_WEAPON1,
   UB_WEAPON2,
   UB_WEAPON3,
   UB_WEAPON4,
   UB_WEAPON5,
   UB_WEAPON6,
   UB_WEAPON7,
   UB_WEAPON8,
   UB_WEAPON9,
   UB_WEAPON10,
   UB_WEAPON11,
   UB_WEAPON12,
   UB_RELOAD,
   UB_WEAPON_NEXT,
   UB_WEAPON_PREV,
   UB_IMPULSE16,
   UB_READY,
   UB_CENTER_VIEW,
   UB_OBJECTIVES,
   UB_IMPULSE20,
   UB_IMPULSE21,
   UB_IMPULSE22,
   UB_CROUCH,
   UB_MANTLE,
   UB_IMPULSE25,
   UB_IMPULSE26,
   UB_IMPULSE27,
   UB_IMPULSE28,
   UB_IMPULSE29,
   UB_INVENTORY_GRID,
   UB_IMPULSE31,
   UB_IMPULSE32,
   UB_IMPULSE33,
   UB_IMPULSE34,
   UB_IMPULSE35,
   UB_IMPULSE36,
   UB_IMPULSE37,
   UB_IMPULSE38,
   UB_IMPULSE39,
   UB_IMPULSE40,
   UB_FROB,
   UB_IMPULSE42,
   UB_IMPULSE43,
   UB_LEAN_FORWARD,
   UB_LEAN_LEFT,
   UB_LEAN_RIGHT,
   UB_INVENTORY_PREV,
   UB_INVENTORY_NEXT,
   UB_INVENTORY_GROUP_PREV,
   UB_INVENTORY_GROUP_NEXT,
   UB_INVENTORY_USE,
   UB_INVENTORY_DROP,
   UB_IMPULSE53,
   UB_IMPULSE54,
   UB_IMPULSE55,
   UB_IMPULSE56,
   UB_IMPULSE57,
   UB_IMPULSE58,
   UB_IMPULSE59,
   UB_IMPULSE60,
   UB_IMPULSE61,
   UB_IMPULSE62,
   UB_IMPULSE63,

   UB_MAX_BUTTONS
} UserCmdButton;


// usercmd_t->button bits
const int BUTTON_ATTACK			= BIT(0);
const int BUTTON_RUN			= BIT(1);
const int BUTTON_ZOOM			= BIT(2);
const int BUTTON_SCORES			= BIT(3);
const int BUTTON_MLOOK			= BIT(4);
const int BUTTON_CREEP			= BIT(5);
const int BUTTON_6				= BIT(6);
const int BUTTON_7				= BIT(7);

 

Then impulses:

Spoiler




// usercmd_t->impulse commands
enum {
	IMPULSE_WEAPON0,
	IMPULSE_WEAPON1,
	IMPULSE_WEAPON2,
	IMPULSE_WEAPON3,
	IMPULSE_WEAPON4,
	IMPULSE_WEAPON5,
	IMPULSE_WEAPON6,
	IMPULSE_WEAPON7,
	IMPULSE_WEAPON8,
	IMPULSE_WEAPON9,
	IMPULSE_WEAPON10,
	IMPULSE_WEAPON11,
	IMPULSE_WEAPON12,
	IMPULSE_RELOAD,
	IMPULSE_WEAPON_NEXT,
	IMPULSE_WEAPON_PREV,
	IMPULSE_16,
	IMPULSE_READY,
	IMPULSE_CENTER_VIEW,
	IMPULSE_OBJECTIVES,
	IMPULSE_20,
	IMPULSE_21,
	IMPULSE_22,
	IMPULSE_CROUCH,
	IMPULSE_MANTLE,
	IMPULSE_25,
	IMPULSE_26,
	IMPULSE_27,
	IMPULSE_28,
	IMPULSE_29,
	IMPULSE_INVENTORY_GRID,	// #4286
	IMPULSE_40 = 40,
	IMPULSE_FROB,
	IMPULSE_42,
	IMPULSE_43,
	IMPULSE_LEAN_FORWARD,
	IMPULSE_LEAN_LEFT,
	IMPULSE_LEAN_RIGHT,
	IMPULSE_INVENTORY_PREV,
	IMPULSE_INVENTORY_NEXT,
	IMPULSE_INVENTORY_GROUP_PREV,
	IMPULSE_INVENTORY_GROUP_NEXT,
	IMPULSE_INVENTORY_USE,
	IMPULSE_INVENTORY_DROP,
	IMPULSE_MAX
};

 

Strangely I can only find a handful of the above names in other source files, i.e. IMPULSE_WEAPON12 in Player.cpp. You'd think that something like UB_LEAN_LEFT and UB_LEAN_RIGHT (_impulse45 and _impulse46, bound to q and e) would show up somewhere else.

  • Like 1
Link to comment
Share on other sites

7 hours ago, Dragofer said:

Strangely I can only find a handful of the above names in other source files, i.e. IMPULSE_WEAPON12 in Player.cpp. You'd think that something like UB_LEAN_LEFT and UB_LEAN_RIGHT (_impulse45 and _impulse46, bound to q and e) would show up somewhere else.

On original Doom 3 very few impulses and buttons are used, even thou the list is big, so the same most be true for TDM.

buzzwall imo there's a easy way to know what is used or not, not sure about TDM engine but for doom 3, impulses are managed in the player.cpp file in PerformImpulse() function called inside the player Think() function and other places, you can see in the TDM player file if that is there, and if it is than you can see the current impulses the player can use, you can also search the code base for "usercmd.impulse == IMPULSE_NAME" for any impulse being used directly, or "usercmd.buttons & BUTTON_NAME" for buttons in this case.

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 3 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
×
×
  • Create New...