setcvar g_gametype problem

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
Deutsche Dogge
First Lieutenant
Posts: 183
Joined: Wed May 07, 2003 11:50 pm
Location: Quebec
Contact:

setcvar g_gametype problem

Post by Deutsche Dogge »

Hi guys, i tried to find revelant info in the forums but i can't find any answer.

I extracted the AA mohdmx/obj_teamx scr files to modify them and placed them in a "user_modname.pk3" of the main folder.

I added setcvar "g_gametype" "4" right after the main: of each map but it doesn't work.
Server keeps telling me cannot load objective map in non-objective mode though i set the correct values (2 for team/4 for obj)

I even tried set g_gametype 4 without success.
It works only with Spearhead but not with AA :?
Image
Click sig to visit the alternation modding community
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

i think the correct syntax should be :

Code: Select all

level.gametype = 4

and the scr have to be in a maps/obj folder
Deadly and slient.
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

maybe try setting the cvar after level waittill spawn so the map has time to load first .
Image
User avatar
Deutsche Dogge
First Lieutenant
Posts: 183
Joined: Wed May 07, 2003 11:50 pm
Location: Quebec
Contact:

Post by Deutsche Dogge »

the g_gametype must be specified first, thus the "Cannot load objective map in non-objective mode". message. Also, there is some verification if the level is roundbased before the waittil spawn

Code: Select all

main:

// putting it here works with SH but not in AA
setcvar "g_gametype" "2"

// set scoreboard messages
setcvar "g_obj_alliedtext1" "Southern France"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" "mohdm1"

	// call additional stuff for playing this map round based is needed
	if(level.roundbased)
		thread roundbasedthread
		
	level waittill prespawn

	//*** Precache Dm Stuff
	exec global/DMprecache.scr

	level.script = maps/dm/mohdm1.scr
	exec global/ambient.scr mohdm1

	//exec global/ambient.scr mohdm2

	//$world farplane 5000
	//$world farplane_color (.333 .333 .329)


	level waittill spawn
	$world farclipoverride -1
end

roundbasedthread:
 ...
calling additional map setup, so g_gametype must be before this line.

I haven't found solution yet. Why does it work in SH and not AA? :cry:
Image
Click sig to visit the alternation modding community
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

because the bsp was compiled as objective;0?
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

hmm usually you can set any cvar after the game has started but I never tried to set it myself .
Image
User avatar
Deutsche Dogge
First Lieutenant
Posts: 183
Joined: Wed May 07, 2003 11:50 pm
Location: Quebec
Contact:

Post by Deutsche Dogge »

Elgan wrote:because the bsp was compiled as objective;0?
:?:

You haven't read everything:

Setting g_gametype to 2 for dm maps and to 4 for obj maps.
works for SH , not works for AA
Image
Click sig to visit the alternation modding community
panTera
Brigadier General
Posts: 573
Joined: Wed Jan 29, 2003 11:46 pm
Location: The Netherlands
Contact:

Re: setcvar g_gametype problem

Post by panTera »

Deutsche Dogge wrote:I extracted the AA mohdmx/obj_teamx scr files to modify them and placed them in a "user_modname.pk3" of the main folder.
As far as I know in objective mode the game only reads the bsp files in the obj folder. You probably need to extract the .bsp-files too and place the DM maps in the obj-folder and the Objective maps in the dm-folder. (?)
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Re: setcvar g_gametype problem

Post by Elgan »

panTera wrote:
Deutsche Dogge wrote:I extracted the AA mohdmx/obj_teamx scr files to modify them and placed them in a "user_modname.pk3" of the main folder.
As far as I know in objective mode the game only reads the bsp files in the obj folder. You probably need to extract the .bsp-files too and place the DM maps in the obj-folder and the Objective maps in the dm-folder. (?)
that's prob the nail, it works on SP maps as they are not in dm or obj., the bsp was compiled as single and put in just maps.
User avatar
Deutsche Dogge
First Lieutenant
Posts: 183
Joined: Wed May 07, 2003 11:50 pm
Location: Quebec
Contact:

Post by Deutsche Dogge »

I solved the problem using this the bottom of my cfg file:

Code: Select all

// Cr?er les alias pour la rotation
set map01 "g_gametype 4; fraglimit 30; timelimit 10; roundlimit 0; map obj/obj_team1; set nextmap vstr map02" 
set map02 "g_gametype 2; fraglimit 30; timelimit 10; roundlimit 0; map dm/mohdm1; set nextmap vstr map03" 
set map03 "g_gametype 4; fraglimit 30; timelimit 10; roundlimit 0; map obj/obj_team2; set nextmap vstr map04" 
set map04 "g_gametype 2; fraglimit 30; timelimit 10; roundlimit 0; map dm/mohdm2; set nextmap vstr map05" 
set map05 "g_gametype 2; fraglimit 30; timelimit 10; roundlimit 0; map dm/mohdm3; set nextmap vstr map06" 
set map06 "g_gametype 4; fraglimit 30; timelimit 10; roundlimit 0; map obj/obj_team3; set nextmap vstr map07" 
set map07 "g_gametype 2; fraglimit 30; timelimit 10; roundlimit 0; map dm/mohdm4; set nextmap vstr map08" 
set map08 "g_gametype 2; fraglimit 30; timelimit 10; roundlimit 0; map dm/mohdm5; set nextmap vstr map09" 
set map09 "g_gametype 4; fraglimit 30; timelimit 10; roundlimit 0; map obj/obj_team4; set nextmap vstr map10" 
set map10 "g_gametype 2; fraglimit 30; timelimit 10; roundlimit 0; map dm/mohdm6; set nextmap vstr map11" 
set map11 "g_gametype 2; fraglimit 30; timelimit 10; roundlimit 0; map dm/mohdm7; set nextmap vstr map01

// laisser la variable sv_maplist vide
seta sv_maplist ""

//d?marrer la premi?re map de la rotation
vstr map01
and commented out the g_gametype in the maps .scr files.
Image
Click sig to visit the alternation modding community
Post Reply