Ok the Q3 source code was just released a few hours ago and I have had my eyes pouring over the contents ever since. Fortunately, much of it is similar to Quake 2. There is also a lot of new stuff.

As many of you know, the grappling hook was added into the code, but removed later in development. Therefore, it is just a matter of patching the code a little bit to unlock the grappling hook for general use < evil grin >. Here is a quick (very quick) tutorial on how to patch your source code to turn on the grappling hook.

1. Modify g_client.c (part of the „game“ DLL)

Go to about line 939

 client->ps.stats[STAT_WEAPONS] |= ( 1 << WP_GAUNTLET ); 
 client->ps.stats[STAT_WEAPONS] |= ( 1 << WP_GRAPPLING_HOOK); 
 client->ps.ammo[WP_GAUNTLET] = -1; 
 client->ps.ammo[WP_GRAPPLING_HOOK] = -1; 

Go to about line 991

for ( i = WP_NUM_WEAPONS – 2 ; i > 0 ; i– ) {
// changed the -1 to a -2 so the grapple isn’t selected by default
if ( client->ps.stats[STAT_WEAPONS] & ( 1 << i ) ) { client->ps.weapon = i; break; } }

2. Modify ui_controls2.c (part of the „ui“ DLL)

Go to about line 105 and insert this value for ID_WEAPON10. The array g_bindings[] uses these values as an index for all MTYPE_ACTION controls. If they don’t match their order in g_bindings[] then errors will arise.

The remaining values need to be bumped up by one as well, to retain uniqueness.

#define ID_CHAT3		32
#define ID_CHAT4		33
#define ID_WEAPON10  34  // grappling hook 
#define ID_FREELOOK		35
#define ID_ALWAYSRUN	37
#define ID_AUTOSWITCH	38
#define ID_MOUSESPEED	39
#define ID_JOYENABLE	40

Go to about line 170

 menuaction_s  bfg; 
 menuaction_s  hook; 
 menuaction_s  attack; 

Go to about line 245

 {"messagemode4", "chat - attacker", ID_CHAT4, ANIM_CHAT, -1, -1, -1, -1},
 {"weapon 10",  "grappling hook", ID_WEAPON10, ANIM_WEAPON10, '0',   -1,  -1, -1}, 
 {(char*)NULL, (char*)NULL, 0, 0, -1, -1, -1, -1},

Go to about line 299

 (menucommon_s *)&s_controls.bfg, 
 (menucommon_s *)&s_controls.hook, 

Go to about line 1386

 s_controls.bfg.generic.type      = MTYPE_ACTION; 
 s_controls.bfg.generic.flags     =
 s_controls.bfg.generic.callback  = Controls_ActionEvent; 
 s_controls.bfg.generic.ownerdraw = Controls_DrawKeyBinding;        = ID_WEAPON9; 
 s_controls.hook.generic.type      = MTYPE_ACTION; 
 s_controls.hook.generic.flags     = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_GRAYED|QMF_HIDDEN; 
 s_controls.hook.generic.callback  = Controls_ActionEvent; 
 s_controls.hook.generic.ownerdraw = Controls_DrawKeyBinding;        = ID_WEAPON10; 
 s_controls.attack.generic.type     = MTYPE_ACTION; 
 s_controls.attack.generic.flags     = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_GRAYED|QMF_HIDDEN; 
 s_controls.attack.generic.callback  = Controls_ActionEvent; 
 s_controls.attack.generic.ownerdraw = Controls_DrawKeyBinding;        = ID_ATTACK; 

That’s it! And yes, this patch _does_ work for CTF (I tested it briefly).

Contact Information:

I can be found on in #JUN at all times, although sometimes I will obviously be away. My nick is JB[JUN]. I am not going to post my email address on this page because I am sick of getting spam every day.

Here are other programming projects I am working on (you can get my email address from these pages hehe):
Balance of Power (look for the Quake 3 version soon muwahaha)

by Matt Ownby