..... Its pretty easy actually. Why are you guys having troubles? The devs were very smart by implementing it because the gamemode possiblilities are endless. Ok, if your making a ctf map all you have to do is copy one of the lua files thats already in your maps folder and change the name to your mapname. For example, say your mapname was ff_balls and its standard 2 team ctf. Here is the lua for it
IncludeScript("base_ctf")
IncludeScript("base_location");
IncludeScript("base_respawnturret");
-----------------------------------------------------------------------------
-- startup
-----------------------------------------------------------------------------
function startup()
-- set up team limits
local team = GetTeam( Team.kBlue )
team:SetPlayerLimit( 0 )
team:SetClassLimit( Player.kCivilian, -1 )
team = GetTeam( Team.kRed )
team:SetPlayerLimit( 0 )
team:SetClassLimit( Player.kCivilian, -1 )
team = GetTeam( Team.kYellow )
team:SetPlayerLimit( -1 )
team = GetTeam( Team.kGreen )
team:SetPlayerLimit( -1 )
end
-----------------------------------------------------------------------------
-- global overrides
-----------------------------------------------------------------------------
POINTS_PER_CAPTURE = 10
FLAG_RETURN_TIME = 60
Thats it, the code above will get you a perfect ctf map. Remember that if you copy and paste this that you'll have to change the extension to .lua from .txt!!!!
Now, I will break this down to better explain it for you guys.
IncludeScript("base_ctf")<-------------this is the base lua that is for ctf
IncludeScript("base_location");<-----------------this is if your using locations
IncludeScript("base_respawnturret"); <---------------this is if you have respawn turrets in your spawnrooms
-----------------------------------------------------------------------------
-- startup
-----------------------------------------------------------------------------
function startup()
-- set up team limits
local team = GetTeam( Team.kBlue )<------Team blue
team:SetPlayerLimit( 0 )<------------0 means active team
team:SetClassLimit( Player.kCivilian, -1 )<---- -1 means that the civilian class cannot be picked at all, you can do this with any class!!!
team = GetTeam( Team.kRed )
team:SetPlayerLimit( 0 )
team:SetClassLimit( Player.kCivilian, -1 )
team = GetTeam( Team.kYellow )
team:SetPlayerLimit( -1 ) <---------- the -1 for the yellow and the green team below is -1 because they will not be used, hence 2 team ctf.
team = GetTeam( Team.kGreen )
team:SetPlayerLimit( -1 )
end
-----------------------------------------------------------------------------
-- global overrides
-----------------------------------------------------------------------------
POINTS_PER_CAPTURE = 10<--------set this number for how many points you want each player to get per capture
FLAG_RETURN_TIME = 60<-----------set this number for how long you want the flag to sit before it returns to its base if no one has it