OK - My wrong I guess - don’t know where I got the idea there was a problem with forward spawning and central spawn flags!
This is how I’ve built my map and coded my script, seems to test OK, but is it correct?
32 team_CTF_redplayer and 32 team_CTF_blueplayer for the intial spawns.
32 team_CTF_redspawn at intial Axis spawn position, 16 of these with a target name of axisbackspawn.
32 team_CTF_bluespawn at initial Allied spawn position, 16 of these with a target of alliedbackspawn.
16 team_CTF_redspawn at central spawn location, with a target of axisforwardspawn.
16 team_CTF_bluespawn at central spawn location, with a target of alliedforwardspawn.
team_WOLF_checkpoint at central spawn location, with a scriptname of flag_respawn_obj.
Phew… OK, here’s the code.
Outside of game_manager
flag_respawn_obj // RESPAWN FLAG
{
trigger axis_capture
{
trigger game_manager obj_flagred
}
trigger allied_capture
{
trigger game_manager obj_flagblue
}
}
Inside game_manager, spawn section
accum 2 set 0 // Set to 1 if Axis have captured it at least once
accum 3 set 0 // Set to 1 if Allied have captured it at least once
and these triggers.
trigger obj_flagred
{
// Change the objective state internally, so UI can update, etc.
// Axis takes control of objective #5
wm_set_objective_status 5 0
// Some kind of UI pop-up to alert players
wm_announce "Axis captures the Foundry Deployment Area!"
accum 2 set 1
alertentity axisforwardspawn
alertentity axisbackspawn
accum 3 abort_if_equal 0
alertentity alliedforwardspawn
alertentity alliedbackspawn
}
trigger obj_flagblue
{
// Change the objective state internally, so UI can update, etc.
// Allied takes control of objective #5
wm_set_objective_status 5 1
// Some kind of UI pop-up to alert players
wm_announce "Allies capture the Foundry Deployment Area!"
accum 3 set 1
alertentity alliedforwardspawn
alertentity alliedbackspawn
accum 2 abort_if_equal 0
alertentity axisforwardspawn
alertentity axisbackspawn
}
Phew, again, so…
Each side will start with initial spawns at home base. If they capture the flag, then the forward spawns for that side are activated, and the 16 back spawns are turned off. If the other side has the forward spawns at the moment, then their forward spawns are deactivated. That means there will always be 16 spawns available at base, and 16 other “floating” spawns. Like reyalIP says, the chance of 16 players wanted to respawn all at the same time is pretty small.
Accum 2 and 3 are used to check if there is a need to reset the spawns for the other side.
Well, what do you think, is this OK?
DeMoNeye