better custom startup() than simply overwriting;

see http://forums.fortress-forever.com/showthread.php?t=23070
This commit is contained in:
alaswell 2015-01-20 19:12:31 -07:00
parent 66fab40a5c
commit e1902e6f36

View file

@ -16,59 +16,13 @@ DEFENDERS_OBJECTIVE_ONCAP = true
DEFENDERS_OBJECTIVE_ONCARRIER = false --set to true to follow flag when carried
DEFENDERS_OBJECTIVE_ONFLAG = false --set to true to follow flag ALWAYS
-- custom startup
local startup_base = startup
function startup()
SetGameDescription( "Invade Defend" )
-- set up team limits
local team = GetTeam( Team.kBlue )
team:SetPlayerLimit( 0 )
team = GetTeam( Team.kRed )
team:SetPlayerLimit( 0 )
team = GetTeam( Team.kYellow )
team:SetPlayerLimit( -1 )
team = GetTeam( Team.kGreen )
team:SetPlayerLimit( -1 )
-- CTF maps generally don't have civilians,
-- so override in map LUA file if you want 'em
local team = GetTeam(Team.kBlue)
team:SetClassLimit(Player.kCivilian, -1)
team = GetTeam(Team.kRed)
team:SetClassLimit(Player.kCivilian, -1)
-- set them team names
SetTeamName( attackers, "Attackers" )
SetTeamName( defenders, "Defenders" )
-- start the timer for the points
AddScheduleRepeating("addpoints", PERIOD_TIME, addpoints)
setup_door_timer("start_gate", INITIAL_ROUND_DELAY)
cp1_flag.enabled = true
for i,v in ipairs({"cp1_flag", "cp2_flag", "cp3_flag", "cp4_flag", "cp5_flag", "cp6_flag", "cp7_flag", "cp8_flag"}) do
local flag = GetInfoScriptByName(v)
if flag then
flag:SetModel(_G[v].model)
flag:SetSkin(teamskins[attackers])
if i == 1 then
flag:Restore()
else
flag:Remove()
end
end
end
flags_set_team( attackers )
ATTACKERS_OBJECTIVE_ENTITY = GetEntityByName( "cp"..phase.."_flag" )
UpdateDefendersObjective()
UpdateTeamObjectiveIcon( GetTeam(attackers), ATTACKERS_OBJECTIVE_ENTITY )
startup_base()
-- palermo specific stuff
-- lower trigger_hurt damage in water
OutputEvent( "trigger_hurt", "SetDamage", "42" )
end