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)
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. </head><body topmargin=2 leftmargin=2>
1
Re: Comparing math_counter Values
Posted by Campaignjunkie on Wed Oct 4th at 9:43pm 2006

Campaignjunkie
member
1309 posts
291 snarkmarks
Registered: Feb 12th 2002
Location: West Coast, USA
Occupation: Student
Posted by Campaignjunkie on Wed Oct 4th at 9:43pm 2006
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.
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.
Campaignjunkie
member
1309 posts
291 snarkmarks
Registered: Feb 12th 2002
Location: West Coast, USA
Occupation: Student
Re: Comparing math_counter Values
Posted by Lumiinex on Wed Oct 4th at 11:28pm 2006
Posted by Lumiinex on Wed Oct 4th at 11:28pm 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>
1
© Snarkpit.net 2001 - 2023, about us, donate, contact
Snarkpit v6.1.0 created this page in 0.0093 seconds.

Snarkpit v6.1.0 created this page in 0.0093 seconds.

