Adding entries to control bindings menu?

Discuss programming in the QuakeC language.
Post Reply
Tiger Schwert
Posts: 5
Joined: Mon Jan 09, 2012 5:55 am

Adding entries to control bindings menu?

Post by Tiger Schwert »

Hi there, I'm working on a Quake mod and I'm wondering how to get this to work.

I've added two extra actions for the player, a quick melee kick and a buy menu. These are bound to impulses 13 and 14 respectively, and I'm starting to gear up towards a (really limited) first release for a few people. But I'd like to be sure they can properly bind these actions away from whatever defaults I put in, and I'm wondering if there's any way I can add these impulses to the control bindings menu to let people easily rebind them, or if I will have to do a custom engine build?

I'm using the Darkplaces engine. Thank you.
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Adding entries to control bindings menu?

Post by Baker »

Open DarkPlace's menu.c [We're talking the DarkPlaces engine source code here, which is a zip file with every download of the DP engine]

Search for phrase "impulse 10".

You'll see something resembling this ...

Code: Select all

 /* KEYS MENU */
 
char *bindnames[][2] =
char *quakebindnames[][2] =
{
{"+attack",            "attack"},
{"impulse 10",                 "next weapon"},
{"impulse 12",                 "previous weapon"},
{"+jump",                      "jump / swim up"},
{"+forward",           "walk forward"},
{"+back",                      "backpedal"},
{"+left",                      "turn left"},
{"+right",                     "turn right"},
{"+speed",                     "run"},
{"+moveleft",          "step left"},
{"+moveright",                 "step right"},
{"+strafe",            "sidestep"},
{"+lookup",            "look up"},
{"+lookdown",          "look down"},
{"centerview",                 "center view"},
{"+mlook",                     "mouse look"},
{"+klook",                     "keyboard look"},
{"+moveup",                    "swim up"},
{"+movedown",          "swim down"}
You'll know what to do from there :D [Non-engine modifications ways of doing this exist ... http://forums.inside3d.com/viewtopic.php?f=12&t=3397 ... but I can't say whether or not it is easy or hard or works as I have never tried it.]

See also: http://forums.inside3d.com/viewtopic.php?f=3&t=4509 (and if you need that thread, look for the post by MH)
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
mankrip
Posts: 924
Joined: Fri Jul 04, 2008 3:02 am

Re: Adding entries to control bindings menu?

Post by mankrip »

If you were using Makaqu, all you'd have to do is to add these lines to autoexec.cfg:

Code: Select all

menu_keys_addcmd "impulse 13" Kick
menu_keys_addcmd "impulse 14" "Buy Menu"
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Adding entries to control bindings menu?

Post by Baker »

mankrip wrote:If you were using Makaqu, all you'd have to do is to add these lines to autoexec.cfg:

Code: Select all

menu_keys_addcmd "impulse 13" Kick
menu_keys_addcmd "impulse 14" "Buy Menu"
What a wonderful idea. That's awesome.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
Tiger Schwert
Posts: 5
Joined: Mon Jan 09, 2012 5:55 am

Re: Adding entries to control bindings menu?

Post by Tiger Schwert »

Baker wrote:Open DarkPlace's menu.c [We're talking the DarkPlaces engine source code here, which is a zip file with every download of the DP engine]

Search for phrase "impulse 10".

You'll see something resembling this ...

Code: Select all

 /* KEYS MENU */
 
char *bindnames[][2] =
char *quakebindnames[][2] =
{
{"+attack",            "attack"},
{"impulse 10",                 "next weapon"},
{"impulse 12",                 "previous weapon"},
{"+jump",                      "jump / swim up"},
{"+forward",           "walk forward"},
{"+back",                      "backpedal"},
{"+left",                      "turn left"},
{"+right",                     "turn right"},
{"+speed",                     "run"},
{"+moveleft",          "step left"},
{"+moveright",                 "step right"},
{"+strafe",            "sidestep"},
{"+lookup",            "look up"},
{"+lookdown",          "look down"},
{"centerview",                 "center view"},
{"+mlook",                     "mouse look"},
{"+klook",                     "keyboard look"},
{"+moveup",                    "swim up"},
{"+movedown",          "swim down"}
You'll know what to do from there :D [Non-engine modifications ways of doing this exist ... http://forums.inside3d.com/viewtopic.php?f=12&t=3397 ... but I can't say whether or not it is easy or hard or works as I have never tried it.]

See also: http://forums.inside3d.com/viewtopic.php?f=3&t=4509 (and if you need that thread, look for the post by MH)
I'm hoping to hold off having to do actual engine modifications until it really does become necessary. I knew MenuQC could perhaps help me in this regard, but documentation for it was really thin on the ground (The MenuQC that comes with dpmod won't even compile for me) - so that link is really useful as a starting point

Also I never even thought to use make to compile DP! I tried to load one of the included .sln files into VC++ but things like that are always too tempermental for me to bear.
Tiger Schwert
Posts: 5
Joined: Mon Jan 09, 2012 5:55 am

Re: Adding entries to control bindings menu?

Post by Tiger Schwert »

This MenuQC business is interesting, but I think I'm seeing why the whole thing is kinda undocumented and almost swept under the rug.

After a little tinkering, I can get a nice menu up which lets the player start a new game, load, save etc. But I've now realised that I'd have to reimplement most of the standard DarkPlaces menu, including all the fiddly options for graphics settings and changing the video mode. This is a pretty big undertaking (a little like trying to get the usual Quake intermission screen working in CSQC, but on a much bigger scale)... so it looks like a custom build is in order.

Cheers
toneddu2000
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: Adding entries to control bindings menu?

Post by toneddu2000 »

Also I never even thought to use make to compile DP! I tried to load one of the included .sln files into VC++ but things like that are always too tempermental for me to bear.
Compiling DP is very easy. I'm not a programmer and I succeded in just a day. You need MS Studio Express 2008 (NOT 2010: it won't work). Just click on COMPILE ALL on the top of the menu and you're done. Of course you need all the libraries. On Linux is a piece of cake: just type make sdl-release and every time the compiler says "libXXX not found" just install libxxx and libxxx-dev by Sinaptic/Adept

According to MenuQC, behind_you wrote some time ago this guide. It has some errors (I fixed it - if you need I'll post it) but it explains pretty well how a menuqc works
Meadow Fun!! - my first commercial game, made with FTEQW game engine
Chip
Posts: 575
Joined: Wed Jan 21, 2009 9:12 am
Location: Dublin, Ireland
Contact:

Re: Adding entries to control bindings menu?

Post by Chip »

toneddu2000 wrote:
Also I never even thought to use make to compile DP! I tried to load one of the included .sln files into VC++ but things like that are always too tempermental for me to bear.
Compiling DP is very easy. I'm not a programmer and I succeded in just a day. You need MS Studio Express 2008 (NOT 2010: it won't work). Just click on COMPILE ALL on the top of the menu and you're done. Of course you need all the libraries. On Linux is a piece of cake: just type make sdl-release and every time the compiler says "libXXX not found" just install libxxx and libxxx-dev by Sinaptic/Adept

According to MenuQC, behind_you wrote some time ago this guide. It has some errors (I fixed it - if you need I'll post it) but it explains pretty well how a menuqc works
Go ahead and post it. I could use it.
QuakeWiki
getButterfly - WordPress Support Services
Roo Holidays

Fear not the dark, but what the dark hides.
toneddu2000
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: Adding entries to control bindings menu?

Post by toneddu2000 »

Okay, here it is. As I wrote in the readme behind_you created this menu, not me. I only tried to change something to make it compile. Now it compiles but it still doesn't work! :)
Menu still appears on screen even after pressing ESC key :?:
Meadow Fun!! - my first commercial game, made with FTEQW game engine
Post Reply