Re: Comparing math_counter Values
Posted by Lumiinex on
Wed Oct 4th 2006 at 12:00am
Posted
2006-10-04 12:00am
2 posts
0 snarkmarks
Registered:
Oct 3rd 2006
<span style="color: lightblue;">Hi, I'm making a map where there are rounds of gameplay. A logic_timer starts and executes a bunch of inputs through a logic_relay. The round ends and another set of inputs executes, signifying the end of the round. Here is my problem, I want to add a button that adds 30 seconds to the round length. I thought up a pretty good idea, but it doesn't seem to work right.
I have a math_counter that corresponds to the button. On pressing the button, 1 is added to the counter. I have another math_counter that is added to every 30 seconds. A logic timer counts 30 seconds then fires it's OnTimer output which adds 1 to the second math counter. I have a logic_compare that compares the values of the counters, and executes the second logic_relay to stop the round.
In short, a player presses a button to set how many 30 second time intervals are added to the total time of the round. When the round starts, the timer adds 1 to another math_counter every 30 seconds. This way you get one counter as the max and the other counting upwards towards it. When they are equal, the round should stop, but it doesn't.
This is how I'm doing the math_counters:
(On the output page)
OutValue logic_comparename SetValue
(And for the other one)
</span><span style="color: lightblue;">OutValue logic_comparename SetValueCompare
Should this work? Am I doing everything correctly? I am open to suggestions to new methods of doing this same type of function</span><span style="color: lightblue;">. </span></head><body topmargin=2 leftmargin=2>
Re: Comparing math_counter Values
Posted by Campaignjunkie on
Wed Oct 4th 2006 at 9:43pm
1309 posts
329 snarkmarks
Registered:
Feb 12th 2002
Occupation: Student
Location: West Coast, USA
Hmm, I'm not sure either, it sounds like it should work. Try turning on "developer 2" in the console so you can get more verbose entity feedback on what's happening in-game.
You might want to isolate certain pieces of your setup so you can see where it's going wrong - like instead of having the player press a button to set the first math_counter, set it to a static value by default and see if it all works as intended.
Re: Comparing math_counter Values
Posted by Lumiinex on
Wed Oct 4th 2006 at 11:28pm
Posted
2006-10-04 11:28pm
2 posts
0 snarkmarks
Registered:
Oct 3rd 2006
I found the problem. I used the keyvalues "SetValueCompare" and "SetCompareValue". There is also another keyvalue called "SetValue" which I'm not sure how to use. Too many "values" and "compares" for that to make any sense if you ask me. =/<html><head><link rel="stylesheet" href="themes/standard.css" type="text/css"></head><body topmargin=2 leftmargin=2>