math_counter as func_door_rotating's speed

Officer Ushanka ツ

L1: Registered
Oct 21, 2015
14
0
Hi, I'm working on a map for Death Run.

There is a minigame that makes players jump over a blade that spins faster and faster as it goes on.

How would I make a func_door_rotating's speed increase as time goes by? (I'm using math_counter as the speed.)
 
Last edited:

TheMightyGerbil

L2: Junior Member
Dec 23, 2012
79
21
If you are making a blade that makes full rotations, and not back and forth, you may want to look at using a phys_motor with an attached func_physbox. I've used those entities for a continually spinning fan and radar dish in the past which worked fine. Phys_motor has a spin up time setting and you should be able to parent a trigger_hurt to the func_physbox for damage. Please note though I haven't actually tested it for your purpose and not every entity in hammer plays nice with others.

Be sure to check "Damaging it Doesn't push it" to yes on the func_physbox unless you want your players manipulating it.

I'm not sure you can get a smooth result with a math_counter and func_door_rotating but it may be possible to use a logic_case that sends different speeds to the door for each case. Have the math_counter send an OutValue output of InValue to the logic_case. As the math_counter counts up it "should", quote marks because I haven't tested it, cycle up through the choices.
 
Last edited:
Mar 23, 2013
1,013
347
make a math_counter, and a logic_timer. Give the logic timer the output: "OnTimer - math_counter's targetname - Add - 20"

So if you set the logic_timer to 5 seconds, it will add "20" to the math_counter every five seconds.

Now give the math_counter this output "OutValue - door's targetname - setSpeed"

The OutValue will be fired each time the counter's value changes, plus it will use the new value as parameter of this output" so if the counter had a starting value of 100 and recieves the "Add - 20" input, it will give the door the input: "SetSpeed - 120".
If you let the timer running, then after then next 5 seconds it will give the door a "SetSpeed 140" input. Now just play around with the starting values of the counter and the timer interval of the timer.
 

TheMightyGerbil

L2: Junior Member
Dec 23, 2012
79
21
make a math_counter, and a logic_timer. Give the logic timer the output: "OnTimer - math_counter's targetname - Add - 20"

So if you set the logic_timer to 5 seconds, it will add "20" to the math_counter every five seconds.

Now give the math_counter this output "OutValue - door's targetname - setSpeed"

The OutValue will be fired each time the counter's value changes, plus it will use the new value as parameter of this output" so if the counter had a starting value of 100 and recieves the "Add - 20" input, it will give the door the input: "SetSpeed - 120".
If you let the timer running, then after then next 5 seconds it will give the door a "SetSpeed 140" input. Now just play around with the starting values of the counter and the timer interval of the timer.

Yeah that should work, over complicated it. Not sure if/how a func_door_rotating can make full rotations though.
 

Officer Ushanka ツ

L1: Registered
Oct 21, 2015
14
0
make a math_counter, and a logic_timer. Give the logic timer the output: "OnTimer - math_counter's targetname - Add - 20"

So if you set the logic_timer to 5 seconds, it will add "20" to the math_counter every five seconds.

Now give the math_counter this output "OutValue - door's targetname - setSpeed"

The OutValue will be fired each time the counter's value changes, plus it will use the new value as parameter of this output" so if the counter had a starting value of 100 and recieves the "Add - 20" input, it will give the door the input: "SetSpeed - 120".
If you let the timer running, then after then next 5 seconds it will give the door a "SetSpeed 140" input. Now just play around with the starting values of the counter and the timer interval of the timer.
Thanks, This works perfectly!