Post your scripting questions / solutions here
Moderator: Moderators
ViPER
General
Posts: 1058 Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:
Post
by ViPER » Thu May 17, 2007 5:43 pm
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
tltrude
Chuck Norris
Posts: 4774 Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:
Post
by tltrude » Thu May 17, 2007 7:52 pm
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,
ViPER
General
Posts: 1058 Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:
Post
by ViPER » Fri May 18, 2007 1:13 am
level.vars are reset with restart so im saving to cvars- otherwise im not sure what you mean.
ViPER
General
Posts: 1058 Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:
Post
by ViPER » Fri May 18, 2007 7:30 am
Thanks - never mind. threading this before waittill spawn was killing gametype. thread from after spawn and it works fine now.