modded FFA

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

modded FFA

Post by ViPER »

Im trying to mod ffa to play set # of rounds with a modified timelimit then after the rounds are done chang the map. It works except the next rounds there is no score - kills are not recorded on the ffa scoreboard.

any ideas

Code: Select all

doffa:

   	local.rnd = (int(getcvar mmffard)) //keep track of round

  	if(local.rnd == 0 || local.rnd == "") //first time around set default
		local.rnd = 1

   	local.numrnd = (int(getcvar mazeffarounds)) //set custom number of rounds

  	if(local.numrnd == 0 || local.numrnd == "") //not set - set default
		local.rnd = 4

	local.mazeffatime = int(getcvar mazeffatime) //get custom time setting

	if(local.mazeffatime == "" ||local.mazeffatime == 0 ) // if not set get default
		local.mazeffatime = 4

	local.ffatime = (local.mazeffatime * 60) //convert to sec

	level.temptl = (getcvar g_timelimit) //get server timelimt

	setcvar timelimit local.mazeffatime // change to custom timelimit

	local.mt = (local.ffatime - 7) //end round time

	wait local.mt //wait till end round


	if(local.rnd == local.numrnd) // if last round - change map
	 {
	 local.rnd = 1
	 setcvar mmffard local.rnd

	 setcvar timelimit level.temptl //set server timelimit

 	 local.restart = spawn trigger_changelevel ( 0 0 0 )
	 trigger local.restart
	 }
	else // end round and advance count
	 {

	 local.rnd++
	 setcvar mmffard local.rnd

	 setcvar timelimit level.temptl //set server timelimit

	 setcvar g_gametype 4
	 teamwin allies

	 setcvar g_gametype 1
	 }

	//wait 5

end
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

game

Post by tltrude »

Predefined object references
============================

1) game
Refers to the unique game object which maintains its state across levels. Only primitive values (integers/floats/strings/vectors) will persist across levels.

2) level
Refers to the unique level object which maintains its state for the duration of a level.

3) local
Refers to the thread executing the current command.
Tom Trude,

Image
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

level.vars are reset with restart so im saving to cvars- otherwise im not sure what you mean.
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

Thanks - never mind. threading this before waittill spawn was killing gametype. thread from after spawn and it works fine now.
Post Reply