Change CTF game mode ?

CafeineMan

L2: Junior Member
Jul 31, 2010
95
17
Hello,

I am just finishing a little capture the flag map and would like to know if you think that possible to change the original capture the flag game mode like this :

- limited time (30mn for exemple the game)
- the team who capture most flags win
- in case of equality => sudden death (no more limited time) : the first who capture a new flag win.

PS: sorry for my bad english.
 

Egan

aa
Feb 14, 2010
1,375
1,720
It's possible to do the first part of that, but as far as I know stalemate/suddendeath option is controlled by a server variable, one that might not revert back to its normal state if you were to change its value in the map (it will revert if it's value is set up in the server.cfg).

For the first part, you will need: 2 math_counter, 3 game_round_win, 1 team_round_timer, 1 logic_compare, and the base CTF gamemode entities:
kg5Qcj0.png


The idea is to track the scores of each team's captures with the math_counters, and then from the team_round_timer compare the two when the round ends.

You can set this up like so:
gjUH80f.png

On the func_capturezone for team 1, Output of:
  • OnCapture - math_counter - Add - 1
0KViKKA.png

On the math_counter for team 1, Output of:
  • OutValue - logic_compare - SetValue - [blank parameter override]
OszPysD.png

On the math_counter for team 2, Output of:
  • OutValue - logic_compare - SetCompareValue - [blank parameter override]
EItHjyi.png

On the team_round_timer, Output of:
  • OnFinished - logic_compare - Compare
gRb5ZIZ.png

On the logic_compare, Outputs of:
  • OnEqualTo - win_stalemate - RoundWin
  • OnGreaterThan - win_red - RoundWin
  • OnLessThan - win_blue - RoundWin

9s5OTuN.png

Keyvalues set up for the team_round_timer

s5rUT8S.png

Keyvalues set up for the logic_compare

ld5abj8.png

Keyvalues set up for the game_round_win (this one for stalemate)

To mention a bit more about the logic_compare, there are two values it stores: a value, and a 'compare' value. You can set the compare value to something different than the value, and then compare the two with the output of Compare. You can see all the available outputs of an entity by clicking on the Help button in the property window:
4phShUA.png


Also the OutValue of a math_counter will mean that every time the value of the math_counter changes it will spit out the value to the target:
3P92NLs.png
 
Last edited:

CafeineMan

L2: Junior Member
Jul 31, 2010
95
17
Wow !! I did'nt expect such a complete response (and how fast) ! You're very kind !
It seems a little bit complex, but i'll try this !
Thanks !