Use a ConVar.

ConVar g_gametype("g_gametype", "1", FCVAR_REPLICATED | FCVAR_ARCHIVE,
"Selects the gametype.");

Then, to determine which game rules to run simply have InstallGameRules have
some logic so that it calls CreateGameRulesObjective depending on what you
want.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sebastian
'Darth.Hunter' Kreutz
Sent: Monday, November 13, 2006 3:24 AM
To: [email protected]
Subject: [hlcoders] Gametype console variable

This is a multi-part message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
Good morning, everyone!
I'm sending this submission for our coder EmielRegis who currently can't
submit any mails:

Our team is new to the Source engine, yet we would like to create a basic
framework to deal with several different multiplayer gametypes and a
singleplayer campaign in addition.
Our coder EmielRegis is used to JKA's modified id engine which had a console
variable "g_gametype" with a numeric value to define what gametype a server
is running on.

The basic idea is to have different gametypes with different game mechanics
(such as CTF, TDM and Team Assault). EmielRegis couldn't find a good way of
dealing with that. He thought about a console variable, but can they be
transmitted between server and client? If so - how?

Of course, that variable should also be set from the game menu.

Any help on getting a better understanding of the given structures and how
to use them would be highly appreciated. Thanks in advance!

Darth.Hunter

on behalf of Emiel Regis
www.moviebattles.com
http://tne.invision-games.com
--



_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders


__________ NOD32 1.1820 (20061020) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to