Quake3World.com
https://www.quake3world.com/forum/

Spawn player without machinegun...
https://www.quake3world.com/forum/viewtopic.php?f=16&t=41657
Page 1 of 1

Author:  Herr W [ 10-02-2009 12:44 AM ]
Post subject:  Spawn player without machinegun...

Hi everyone,

I would like to know if there is a (not to complicated :dork: ) way to spawn the player without machinegun, i.e. only with the gauntlet...

Thanks in advance!

Author:  ^misantropia^ [ 10-02-2009 04:13 AM ]
Post subject:  Re: Spawn player without machinegun...

's Easy as pie. You need to edit ClientSpawn() in game/g_client.c for that.

Author:  Herr W [ 10-05-2009 12:41 AM ]
Post subject:  Re: Spawn player without machinegun...

Thanks a lot!

I set the amount of ammo given to the player to 0...
Code:
   
client->ps.stats[STAT_WEAPONS] = ( 1 << WP_MACHINEGUN );
   if ( g_gametype.integer == GT_TEAM ) {
      client->ps.ammo[WP_MACHINEGUN] = 0;//WW was 50
   } else {
      client->ps.ammo[WP_MACHINEGUN] = 0;//WW was 100
   }


... and made the gauntlet base weapon...

Code:
client->ps.weapon = WP_GAUNTLET;//WW was WP_MACHINEGUN


... Works! :D

One thing I'm still not quite happy with is that the gauntlet doesn't appear in the "normal" weapon cycle. Can you tell me where to alter that?

Author:  ^misantropia^ [ 10-05-2009 08:50 AM ]
Post subject:  Re: Spawn player without machinegun...

I can and I will. It's client-side code in cgame/cg_weapons.c. More specifically, the CG_PrevWeapon_f() and CG_NextWeapon_f() functions.

Author:  Herr W [ 10-05-2009 11:43 PM ]
Post subject:  Re: Spawn player without machinegun...

Cool! :cool: Would have searched for that forever... Thanks a lot again!

Author:  Perle [ 03-20-2022 01:35 PM ]
Post subject:  Re: Spawn player without machinegun...

Okay. This post is "only" 12 Years old. Is there a way to "disable" the gauntlet?

Author:  LegendGuard [ 06-09-2022 12:12 PM ]
Post subject:  Re: Spawn player without machinegun...

Perle wrote:
Okay. This post is "only" 12 Years old. Is there a way to "disable" the gauntlet?


The one way would be to create a cvar in the code.

- In game/g_main.c, add this where you can see the vmCvar_t list:
Code:
vmCvar_t   g_disableGauntlet;


After, inside static cvarTable_t gameCvarTable[] = { add this line under g_gametype one:
Code:
{ &g_disableGauntlet, "g_disableGauntlet", "0", CVAR_SERVERINFO | CVAR_USERINFO | CVAR_LATCH, 0, qfalse  },


And in G_RegisterCvars function, add this after g_gametype conditional if:
Code:
if ( g_disableGauntlet.integer >= 1 )
{
   G_Printf( "Gauntlet weapon disabled, to enable: 'g_disableGauntlet 0' and restart \n" );
   va("print \"Gauntlet weapon disabled, to enable: 'g_disableGauntlet 0' and restart.\n\"");
   trap_Cvar_Set( "g_disableGauntlet", "1" );
   trap_Cvar_Update( &g_disableGauntlet );
}



- In game/g_local.h, add this in extern vmCvar_t list:
Code:
extern vmCvar_t g_disableGauntlet;


- And finally in game/g_client.c, inside ClientSpawn() you will see these lines:
Code:
   client->ps.stats[STAT_WEAPONS] |= ( 1 << WP_GAUNTLET );
   client->ps.ammo[WP_GAUNTLET] = -1;


Then replace to this:
Code:
if( g_disableGauntlet.integer <= 0 )
{
   client->ps.stats[STAT_WEAPONS] |= ( 1 << WP_GAUNTLET );
   client->ps.ammo[WP_GAUNTLET] = -1;
}



Finally, compile the code, copy the compiled qvm, run the game, in console write and execute the cvar: \g_disableGauntlet 1
restart and enjoy without the gauntlet! :cool:



Image

Author:  CZghost [ 06-09-2022 09:38 PM ]
Post subject:  Re: Spawn player without machinegun...

Wouldn't mind a little tour through the Q3A source code. Would be super beneficial to creating the Infected mod.

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/