Limbo Menu > Player Classes >different Wpns in dffrnt


(FREAK!!!) #1

(at first sry for bad english in some sentences)

ok, i already know, that i must change the code bg_classes.c & g_client.c to add new Weapons for a Player Class.

but, that has an effect for all Gametypes in the Game. But i want, that this new Weapons only are avilalbe in my 2 new Gametypes.

i tried to add the following in bg_classes.c

if ( cgs.gametype != GT_WOLF_EAS && cgs.gametype != GT_WOLF_EAT )
{

// the old, standard weapon list for the standard gametypes
bg_playerclass_t bg_allies_playerclasses[NUM_PLAYER_CLASSES] = {
	{	
.
.
.
.
	};

} else {

// and here follows my new Weapon list for the new gametypes
...
}

but, then i got a cyntax-error “if”

has anyone an idea, how i can resolve this problem?


(fretn) #2

in g_client.c you can set if a player can spawn with a weapon or not (I lost the name of the function), just give the players the weapon if it’s your gametype

to update the limbo menu, perform some checks on the gametype and then draw the weaponpic if it’s available and when its not, draw something like ‘out of stock’ pics


(FREAK!!!) #3

ok, i created sone new server-side cvars

like ea_panzerfaust, to enalbe/disable the panzerfaust and it works fine
(i did all changes in in g_client.c to get it work)


{ &ea_panzerfaust, "ea_panzerfaust", "0", CVAR_ARCHIVE|CVAR_SERVERINFO,0, qfalse, qtrue },

So, to get this CVar transmitted to the Client i put CVAR_SERVERINFO in the definition line.

then i created sone client-side cvars
like ea_LMpanzerfaust and linked it to ea_panzerfaust, which came from the server

{ &ea_LMpanzerfaust, "ea_panzerfaust", "0", 0 },

then i went on to cg_limbopanel.c, cause their is the weapon handling/counting for the limbo menu, but this doesn’t work, because the allowed weapons are still in bg_classes.c

even when i comment this weapons out

		PC_SOLDIER,
		"characters/temperate/allied/soldier.char",
		"ui/assets/mp_gun_blue.tga",
		"ui/assets/mp_arrow_blue.tga",
		{ 
			WP_THOMPSON,
			WP_MOBILE_MG42,
			WP_FLAMETHROWER,
//			WP_PANZERFAUST,
//			WP_MORTAR
		},
	},

are they still listed in the limbo menu.

any ideas?


(FREAK!!!) #4

now i have an other idea, which could be really works, with out big trouble. (i hope so)

the weapons can still be listed in the menu, but the pic of the weapon is changed by a new one with a big red Disabled.
so i only must say the client to take an other pic for the list.

but i can’t find the routine, where all weapon pics are loaded!?


(fretn) #5

that’s what I said :wink:


([RW]FRED) #6

but i can’t find the routine, where all weapon pics are loaded!?

weapon icons for limbo menus are loaded from CG_LimboPanel_GetWeaponCardIconData from cg_limbopanel.c the weapon cards are registered in CG_RegisterGraphics…

in the ingame hud weapon icons are displayed from CG_DrawPlayerStatus calling CG_DrawPlayerWeaponIcon in cg_draw.c. Icons are registered from weapon config files loaded in cg_weapons.c

Regards