- Apr 9, 2008
- 1,706
- 1,491
FYI, this is for a PLR map with a round timer. 
Currently I'm trying to measure the distance that a tracktrain has travelled. So far for each cart I have 1 math_counter and 1 logic_case. For the trigger_capture_area I have another output which is sent to the logic_case that outputs the value of NumTrainCappers.
When the player (or players) push the cart, the value of NumTrainCappers is sent to the logic_case. The logic_case then executes a series of outputs that add to the math_counter.
When the round ends, the values of each math_counter are compared against each using a logic_compare and the winner is determined. This is all fine and dandy and it works.
Now, my problem. Logically, using NumTraincappers makes no sense. It only sends an InValue once for everytime the cart is pushed or for when the number of people pushing changes. So when 1 person pushes the cart, the math_counter is only updated once whilst somebody could keep entering and leaving the trigger push to retrigger the InValue, constantly adding 1 to the math_counter.
This means that REDs cart could be pushed 10ft in a single push (thus adding 1 to the math counter) whilst BLUs cart could be pushed the same distance in multiple pushes which keep adding 1 for everytime a player enters and leaves the trigger thus giving BLU's counter an astronomical figure and causing them to win.
So how do I consistently add a value to my math_counters whilst it's moving and not when it's begun to be pushed as well as accurately accounting for changes in speed?
Currently I'm trying to measure the distance that a tracktrain has travelled. So far for each cart I have 1 math_counter and 1 logic_case. For the trigger_capture_area I have another output which is sent to the logic_case that outputs the value of NumTrainCappers.
When the player (or players) push the cart, the value of NumTrainCappers is sent to the logic_case. The logic_case then executes a series of outputs that add to the math_counter.
- If the cart is not moving then the counter is disabled
- If the cart is moving at 1x speed, the counter is enabled and a value of 1 is added.
- If the cart is moving at 2x speed, the counter is enabled and a value of 2 is added.
- If the cart is moving at 3x speed, the counter is enabled and a value of 3 is added.
When the round ends, the values of each math_counter are compared against each using a logic_compare and the winner is determined. This is all fine and dandy and it works.
Now, my problem. Logically, using NumTraincappers makes no sense. It only sends an InValue once for everytime the cart is pushed or for when the number of people pushing changes. So when 1 person pushes the cart, the math_counter is only updated once whilst somebody could keep entering and leaving the trigger push to retrigger the InValue, constantly adding 1 to the math_counter.
This means that REDs cart could be pushed 10ft in a single push (thus adding 1 to the math counter) whilst BLUs cart could be pushed the same distance in multiple pushes which keep adding 1 for everytime a player enters and leaves the trigger thus giving BLU's counter an astronomical figure and causing them to win.
So how do I consistently add a value to my math_counters whilst it's moving and not when it's begun to be pushed as well as accurately accounting for changes in speed?
Last edited: