Adding a class editor to the engine?

Discuss programming topics for the various GPL'd game engine sources.
Post Reply
drm_wayne
Posts: 232
Joined: Sat Feb 11, 2012 5:47 pm

Adding a class editor to the engine?

Post by drm_wayne »

Hi,

Most of you know the classic shirt/pants color selector i nthe multiplayer options...
But since i am kinda bad at enginecoding i have a question:

It it possible to use the shirt/pants color selector as a class editor, meaning:

Player can select 2 weapons from there for multiplayer gaming,
the first row will be used for primary weapons (IT_NAILGUN etc..),
second row for secondary / sidearm weapons (IT_SHOTGUN etc..)...

I know in quake the starting weapons are defined in client.qc.

I am using Bakers newest ProQuake.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Adding a class editor to the engine?

Post by Spike »

using quakeworld, you can use the setinfo console command paired with the infokey builtin to read a user's settings. this includes their "topcolor" and "bottomcolor" fields.
using vanilla NQ, you are only able to read their bottomcolor value via the .team field, the topcolor value is inaccessible.
using DP, you can define a .clientcolors field which gets set to some bitfield of the upper and lower values.
using baker's newest proquake, you may need to use qccx hacks instead, I don't know if he added either infokey or clientcolors.

from an engine-hack perspective, you'd want to edit the menu.c code to display text instead of images. sprintf combined with some M_DrawString call or something would do the job.
The alternative is a centerprint menu, combined with stuffcmd(self, "color ", bottom, top, "\n") to save it.
Beware that not all clients will save colours that are sent from a server over map changes, to avoid TF breaking overriding people's configs.
drm_wayne
Posts: 232
Joined: Sat Feb 11, 2012 5:47 pm

Re: Adding a class editor to the engine?

Post by drm_wayne »

no i think u understand me wrong lol:

i want to remove the shirt/pants color thing and add a selector to define the players start weapons...

kinda a custom class editor similar to the call of duty games, you can select your 2 weapons here..

atm quake does that in client.qc:

Code: Select all

void() SetNewParms =
{
	parm1 = IT_SHOTGUN | IT_NAILGUN; // I want to able to select my start lineup from the engine ;)
	parm2 = 110;
	parm3 = 0;
	parm4 = 88;
	parm5 = 88;
	parm6 = 0;
	parm6 = 0;
	parm8 = IT_NAILGUN; // I want to able to select my start lineup from the engine ;)
	parm9 = 0;
};
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Adding a class editor to the engine?

Post by Spike »

SetNewParms is called before the player entity is valid, and cannot reference 'self'. You cannot do any class specific stuff within it. All you can do is set some parm to 'unknown', and choose properly later on (ie: within putclientinserver).
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: Adding a class editor to the engine?

Post by ceriux »

he wants to edit the engine, so that the engine is defining the IT_*** fields rather than QC. he wants the players to pick a primary and secondary weapon defined in qc but chosen in the multiplayer options menu.

(select your weapon set in multiplayer options.)
drm_wayne
Posts: 232
Joined: Sat Feb 11, 2012 5:47 pm

Re: Adding a class editor to the engine?

Post by drm_wayne »

Maybe it can be done with using impulse commands in the menu?

example: If you select "Class Bla1" you will get IT_SHOTGUN and IT_NAILGUN via an impulsecommand,
and you can only change the class when you are dead in multiplayer...
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: Adding a class editor to the engine?

Post by ceriux »

wouldnt that require having more buttons? or making the player always travel to an accept option after death? maybe, only once and the begginging of the game?

if the menu's up the player cant spawn really with or without impulse commands.

not to mention everytime the menu's up it'll probably cause lag. centerprint menu's seem to work best in short spurts.
Post Reply