Do you think you can explain this a little more in depth? I'm attempting to implement this in game and I'm getting extremely lost :/
From what I'm seeing it still has the problem with having to add and subtract.
As a starting note, I just want to ask why you couldn't just use respawn times to balance out the game depending on how many capture points each team has? This makes logic simpler, since you just need the AddRedTeamRespawnWaveTime and AddBlueTeamRespawnWaveTime inputs into the tf_gamerules entity to do this, and these inputs can take negative numbers, so can be used to reduce a team's respawn time as well.
Also doing it with respawn times means that engineers don't need to constantly make new teleport entrances, as their team's spawn isn't changing.
Anyway, onto the logic setup:
I'm going to walk you through the setup for all the logic for red's counter, and once you've set all of this up, you'll need to copy
Take this step by step, as there's a few things that you will need.
The Entities
To start off with, set up a
math_counter. (Let's call this
red_counter) Don't worry about setting max or min values for either of these.
You will also need a
logic_compare entity. (Let's call this
red_compare) The initial value should be 0, and the compare value should be 2.
For each control point, you will need a
logic_relay (let's call this
red_lost_point_a for capture point A), which is to start disabled (set in the class info). This relay will be triggered when red
loses the capture point.
The Logic
Now to set inputs and outputs for all of these.
For your
trigger_capture_area for point A, the outputs should be as follows:
My output named
|
Target entities named
|
Via this input
|
With a parameter override of
|
After a delay in seconds of
|
Fire only once
OnCapTeam1|red_counter|Add|1|0|No
OnCapTeam2|red_lost_point_a|Trigger|-|0|No
OnCapTeam1|red_lost_point_a|Enable|-|1|Yes
Make sure that for each point, the a's are replaced with the corresponding letter (e.g. for point B, replace blu_lost_point_a with blu_lost_point_b). Also make special note of which outputs are OnCapTeam1 and which ones are OnCapTeam2. (Team 1 is RED and Team 2 is BLU)
For your
red_lost_point_a, your output should be:
My output named
|
Target entities named
|
Via this input
|
With a parameter override of
|
After a delay in seconds of
|
Fire only once
OnTrigger|red_counter|Subtract|1|0|No
For your
red_counter, your outputs should be:
My output named
|
Target entities named
|
Via this input
|
With a parameter override of
|
After a delay in seconds of
|
Fire only once
OutValue|red_compare|SetValue|-|0|No
OutValue|red_compare|Compare|-|0.1|No
Make sure that you have the delay for the compare, otherwise unexpected results can happen (with the comparison happening with the previous value of the counter)
For your
red_compare, your outputs should be:
My output named
|
Target entities named
|
Via this input
|
With a parameter override of
|
After a delay in seconds of
|
Fire only once
OnEqualTo|[Red forward spawn entities]|Enable|-|0|No
OnEqualTo|[Red main spawn entities]|Disable|-|0.1|No
OnLessThan|[Red main spawn entities]|Enable|-|0|No
OnLessThan|[Red forward spawn entities]|Disable|-|0.1|No
(Note: I usually like having a bit of an overlap for enabling and disabling spawn points to ensure that people will always spawn at one of their team's spawn points, rather than source stuffing up and spawning teams at opposing spawns. Not really needed, but it's what I do. Players don't tend to notice it anyway)
Once all of that is set up, make sure that you do all of blu's logic, test it out and ask again if there's any problems.