I have a capturable forward spawn;
I want when the ‘main door’ is destroyed that the forward spawn goes to allies and it removes the axis spawn.
The problem I am having is that everything works well except if allies already have the forward spawn captured.
It works if Axis captured the spawn.
It works fine if no one has touched the flag.
If allies has the spawn captured and the main door is destroyed;
1- the allies flag is removed from the command map
2- the axis can still select it and spawn there.
Here’s the script sections that pertains to these functions;
The code that sets the forward spawn to allies when the main door is destroyed: (this is in game_manager)
trigger allies_broke_door
{
accum 2 abort_if_not_equal 0
wm_announce "Allied team has breached the Main Door and secured the Forward Shack!"
alertentity forwardbunker_spawns //alert the spawns
alertentity forwardbunker_wobj
setautospawn "Axis Main Bunker" 0 //set to axis
setautospawn "Forward Bunker" 1 //set to allies
wm_objective_status 2 1 1
wm_objective_status 2 0 0
wm_objective_status 3 1 1
wm_objective_status 3 0 0
trigger forwardbunker_flag kill // kill flag
}
The main door code:
bigwall_01 // main door
{
spawn
{
//accum 2 set 1 //sets wall alive
wait 200
constructible_class 3
}
death
{
accum 2 set 0 //sets wall is broke
trigger game_manager allies_broke_door
}
}
Finaly the forward spawn code:
trigger forwardbunker_flagblue
{
// Some kind of UI pop-up to alert players
wm_announce "Allies capture the Forward Bunker!"
wm_objective_status 3 1 1
wm_objective_status 3 0 0
setautospawn "Forward Bunker" 1 //set to allies
}
trigger forwardbunker_flagred
{
// Some kind of UI pop-up to alert players
wm_announce "Axis capture the forward Bunker!"
wm_objective_status 3 1 0
wm_objective_status 3 0 1
setautospawn "Forward Bunker" 0 //set to axis
}
}
// ============ the above is in game_manager ==============
//*========--------- obj 3 ----------=========*//
forwardbunker_spawns
{
spawn
{
}
}
forwardbunker_wobj
{
spawn
{
}
}
forwardbunker_flag
{
spawn
{
accum 0 set 0 // Who has the flag: 0-Axis, 1-Allied
}
trigger allied_capture
{
accum 0 abort_if_equal 1 // do Allies own flag?
trigger game_manager forwardbunker_flagblue
setstate forwardbunker_spawns default
setstate forwardbunker_wobj default
trigger forwardbunker_flag setallies
}
trigger setallies
{
accum 0 abort_if_equal 1
accum 0 set 1
alertentity forwardbunker_wobj
alertentity forwardbunker_spawns
}
trigger axis_capture
{
accum 0 abort_if_equal 0 // do Axis own flag?
trigger game_manager forwardbunker_flagred
setstate forwardbunker_spawns default
setstate forwardbunker_wobj default
//setstate flag_base default
trigger forwardbunker_flag setaxis
}
trigger setaxis
{
accum 0 abort_if_equal 0
accum 0 set 0
alertentity forwardbunker_wobj
alertentity forwardbunker_spawns
}
trigger kill
{
remove
}
}
Any help in figuring this out will be much appreciated.
It’s probably something silly but I have been trying to get this to work for 2 days. :\
but you have to set the globalaccums properly in the flag capture portion of the script otherwise it will do exactly as you said.
