math_counter as func_door_rotating's speed

Discussion in 'Mapping Questions & Discussion' started by Officer Ushanka ツ, Oct 8, 2017.

  1. Officer Ushanka ツ

    Officer Ushanka ツ L1: Registered

    Messages:
    14
    Positive Ratings:
    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: Oct 8, 2017
  2. TheMightyGerbil

    TheMightyGerbil L1: Registered

    Messages:
    36
    Positive Ratings:
    8
    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.
     
    • Thanks Thanks x 1
    • Like Like x 1
    • Respectfully Disagree Respectfully Disagree x 1
    Last edited: Oct 9, 2017
  3. Lampenpam

    aa Lampenpam

    Messages:
    1,019
    Positive Ratings:
    337
    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 Thanks x 1
    • Agree Agree x 1
  4. TheMightyGerbil

    TheMightyGerbil L1: Registered

    Messages:
    36
    Positive Ratings:
    8
    Yeah that should work, over complicated it. Not sure if/how a func_door_rotating can make full rotations though.
     
    • Thanks Thanks x 1
  5. Officer Ushanka ツ

    Officer Ushanka ツ L1: Registered

    Messages:
    14
    Positive Ratings:
    0
    Thanks, This works perfectly!