Why not update the wm_setwinner as you go?
whenever there’s a cap, if it makes axis win, mark them as so, vica versa for allies.
If the cap makes the score level, how about you set the winner according to has just cap’ed? (they had the most recent capture, so they get the amazing ‘you win’ text’.
Or… much more complicated:
Have a team score, stored in each accum.
Each second, a timer calls a script that adds to each team’s score an amount equal to the number of flags captured they control.
Then you use this score to determine who is the winner in the event of a tie for caps (Ie use it to set the wm_setwinner). Obviously it’s over-ridden as soon as one team has more flags than the other, but it’d be a useful and accurate way of calculating who was the ‘better’ team in the event of a tie, since the winner is then the team that’s had the most flags for longest over the duration of the map.
It also prevents the annoying trick that I’ve used in the fun forest map for RTCW - whereby you simply sit next to the most obscure flag you can find, and then when time runs out, you cap it to win the game.
What you’d need for the above is:
in game_manager:
spawn
{
…
globalaccum 1 set 0
globalaccum 2 set 0
…
}
trigger setflagwinner
{
trigger self setaxiswinner
trigger self setallieswinner
trigger self setequalwinner
}
trigger setaxiswinner
{
globalaccum 1 abort_if_less_than 1
wm_setwinner 0 //axis I think!
}
trigger setallieswinner
{
globalaccum 1 abort_if_greater_than -1
wm_setwinner 1 //allies I think!
}
trigger setequalwinner
{
globalaccum 1 abort_if_not_equal 0
trigger self setequalaxiswinner
trigger self setequalallieswinner
}
trigger setequalaxiswinner
{
globalaccum 2 abort_if_less_than 1
wm_setwinner 0 //axis I think!
}
trigger setequalallieswinner
{
globalaccum 2 abort_if_greater_than -1
wm_setwinner 1 //allies I think!
}
in your flags:
axis_capture
{
…
globalaccum 1 inc 1
trigger game_manager setflagwinner
…
}
allies_capture
{
…
globalaccum 1 inc -1
trigger game_manager setflagwinner
…
}
then you need a func_timer pointing to a target_script_trigger, with scriptname of ‘flag_counter’ and target of ‘tick’, and:
flag_counter
{
trigger tick
{
globalaccum 1 trigger_if_equal -7 flag_counter dec7
globalaccum 1 trigger_if_equal -6 flag_counter dec6
globalaccum 1 trigger_if_equal -5 flag_counter dec5
globalaccum 1 trigger_if_equal -4 flag_counter dec4
globalaccum 1 trigger_if_equal -3 flag_counter dec3
globalaccum 1 trigger_if_equal -2 flag_counter dec2
globalaccum 1 trigger_if_equal -1 flag_counter dec1
globalaccum 1 trigger_if_equal 1 flag_counter inc1
globalaccum 1 trigger_if_equal 2 flag_counter inc2
globalaccum 1 trigger_if_equal 3 flag_counter inc3
globalaccum 1 trigger_if_equal 4 flag_counter inc4
globalaccum 1 trigger_if_equal 5 flag_counter inc5
globalaccum 1 trigger_if_equal 6 flag_counter inc6
globalaccum 1 trigger_if_equal 7 flag_counter inc7
}
trigger dec7
{
globalaccum 2 inc -7
}
trigger dec6
{
globalaccum 2 inc -6
}
trigger dec5
{
globalaccum 2 inc -5
}
trigger dec4
{
globalaccum 2 inc -4
}
trigger dec3
{
globalaccum 2 inc -3
}
trigger dec2
{
globalaccum 2 inc -2
}
trigger dec1
{
globalaccum 2 inc -1
}
trigger inc1
{
globalaccum 2 inc 1
}
trigger inc2
{
globalaccum 2 inc 2
}
trigger inc3
{
globalaccum 2 inc 3
}
trigger inc4
{
globalaccum 2 inc 4
}
trigger inc5
{
globalaccum 2 inc 5
}
trigger inc6
{
globalaccum 2 inc 6
}
trigger inc7
{
globalaccum 2 inc 7
}
}
Note the above is simply typed straight out and untested, but should give you the idea.
If needs be I could test it out I suppose.
There are now only 2 conveivable problem scenarios:
- Neither team ever makes a capture. Might be an empty map (so no problem with result), or REALLY shit teams. Either way, I wouldn’t worry unduly - I’d probably just set a wm_setwinner in the game_manager spawn function and be done with it.
- Equal number of flags at time up AND equal ‘flag points’ (the score tallied in globalaccum 2). If this is the case then I’d probably simply leave the winner as is (Ie do nothing, which the script above should do).
So all in all, a long-winded way of providing a winner should the flag count be equal, but also I feel a fair one. Remember - the above only kicks in if the flag count is equal.
Hmm that ended up being a longer post than I’d intended - hope it helps! 