Page 2 of 2

Posted: Tue May 18, 2004 8:14 am
by wacko
This is it:

Code: Select all

game_type_depending_stuff:
level.gametype=getcvar g_gametype
if (level.gametype == "2") //will be executed only in TDM
// if (level.gametype == "1") //will be executed only in FFA
{
your stuff here
}
end

Posted: Tue May 18, 2004 10:03 am
by bdbodger
another way is the switch statement . What are the gametype numbers ? I have not use them before or yet .

Code: Select all

switch (int(getcvar g_gametype)) 
{
case 0:
	statement
	...
	statement
	break	

case 1:
	statement
	...
	statement
	break

default:
	statement
	...
	statement
	break
}

Posted: Tue May 18, 2004 2:34 pm
by lizardkid
g_gametype is jsut the type of game it returns. just a function that returns 1,2,3,4, for SH,5, and for BT,6. (TOW and Liberation are 5, 6)

getcvar

Posted: Tue May 18, 2004 10:57 pm
by tltrude
I knew you guys would catch on quick! There are a lot of "cvars" you can "get" while the script is running. Start up a map and then type "cvarlist" in the console.

Hint: You can even change them (some of them) with "setcvar".

// set scoreboard messages
setcvar "g_obj_alliedtext1" "This game is: "
setcvar "g_obj_alliedtext2" "" (getcvar g_gametypestring)

Posted: Wed May 19, 2004 5:39 am
by bdbodger
I know what g_gametype is just didn't know what number for what gametype also I know you can set g_gametypestring in your script but can you start a map and change the g_gametype number . I mean that stock dm maps made into obj games for example you can run the map and change the g_gametypestring but the axis win does not work I think , so can you change the g_gametype and have it work the same as for an obj game .

obj_dm.scr

Posted: Wed May 19, 2004 2:31 pm
by tltrude
I don't think you can run an objective game, if the bsp and script are in the dm folder--I could be wrong. Although, an objective game can be run as a roundbased game without moving the files.

The numbers are 1 - 4 in mohaa and correspond with the list on the multiplayer game selection screen.

Posted: Sun May 23, 2004 1:28 pm
by Cobra {sfx}
I think you would need to make a custom script where objectives / none objectives are disabled or added. I run most of the stock maps as Tdm (including obj maps) which ive disabled the objective on and enabled respawning, and its set to win by kills which works fine.

Cobra

Posted: Mon May 31, 2004 11:58 am
by Bjarne BZR
Cobra {sfx} wrote:I think you would need to make a custom script where objectives / none objectives are disabled or added.
That's the way I only make one map for both OBJ and DM versions. Tut here.