[TUTORIAL] func_rotating replacement

Discussion in 'Tutorials & Resources' started by A Boojum Snark, Oct 20, 2008.

  1. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,531
    After figuring this out I found the two other workarounds, but I think mine is cleaner and more streamlined. It has only one extra entity (no matter how many rotators you want) and has no clipping/solidity issues.


    Basic functionality:
    Make your rotating entity the neglected oddball momentary_rot_button. Set the speed to what you need, and set the distance to a multiple of 360, this is important for making the rotation appear seamless. For purposes of of I/O efficiency, I recommend making the distance roughly 10 times the speed so that it takes around 10 seconds for it to complete it's distance cycle. Give the m_r_b the following:
    Column 1 Column 2 Column 3
    OUTPUT TARGET INPUT
    OnFullyClosed rotate_relay Trigger


    Create a logic_relay and name it rotate_relay. Give it the following:
    Column 1 Column 2 Column 3 Column 4 Column 5
    OUTPUT TARGET INPUT PARAMETER DELAY
    OnTrigger !activator SetPositionImmediately 0.0 0.00
    OnTrigger !activator SetPosition 1.0 0.01
    OnSpawn momentary_rot_button SetPosition 1.0

    Also enable the Allow fast retrigger flag on the relay.

    The last output will appear as a broken output in Hammer, but in-game it will be sent to every m_r_b in the map without having to name them.


    Stopping & restarting:
    If you wish to stop an m_r_b once started send it the following sequence:
    Column 1 Column 2
    INPUT DELAY
    Lock 0.00
    Unlock 0.01

    The lock will stop it from moving and the unlock will allow it to be restarted again.
    To restart it send:
    Column 1 Column 2
    INPUT PARAMETER
    SetPosition 1.0



    Extra notes:
    To make an m_r_b rotate in the opposite direction, use a negative distance. The start direction key does not appear to do anything.

    If you want to individually control multiple m_r_b obviously you will need to name them, but leave the logic_relay as it is, !activator will reply to whichever entity called upon the relay.
     
    • Thanks Thanks x 64
    Last edited: Mar 8, 2010
  2. FaTony

    FaTony Banned

    Messages:
    902
    Positive Ratings:
    160
  3. Altaco

    Altaco L7: Fancy Member

    Messages:
    485
    Positive Ratings:
    121
    Very clever, nice!
     
  4. Ninjilla

    Ninjilla L7: Fancy Member

    Messages:
    445
    Positive Ratings:
    55
    Great stuff! Thanks Boojumsnark :]
     
  5. grazr

    aa grazr Old Man Mutant Ninja Turtle

    Messages:
    5,436
    Positive Ratings:
    3,564
    ninja bump, ninjilla.

    But it does give me some ideas.
     
    Last edited: Jun 22, 2009
  6. grazr

    aa grazr Old Man Mutant Ninja Turtle

    Messages:
    5,436
    Positive Ratings:
    3,564
    Where do we put the negative direction if the start direction does nothing? Or do you mean negative distance?

    edit: Yea, negative distance reverses the rotation, might wanna correct that phrase.

    I managed to get it manually working using a normal solid trigger but that tends to stops eraticly, i have to move within the trigger to trigger the movement again. But it seems completely random for each time the rotating disc stops, sometimes it stops after barely a seconds movement, sometimes it stops after 5 seconds or sometimes not at all.

    That one is a little odd.

    edit2: Is it possible to change the buttons direction of movement using I/O?

    edit3: Just thought i would share my test vmf with people.
    http://forums.tf2maps.net/downloads.php?do=file&id=1728
     
    Last edited: Jun 22, 2009
  7. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,531
    eh? like a trigger_multiple? I don't understand what you mean or why you would do what I think you're saying...

    and it might be possible to overwrite the speed or distance key using AddOutput to reverse it.
     
  8. grazr

    aa grazr Old Man Mutant Ninja Turtle

    Messages:
    5,436
    Positive Ratings:
    3,564
    Woops, forgot about this question.

    Well what i had in mind was a waterwheel, that starts stationary. When captured by one team it starts spinning one way, then if the other team captures it, it would then start spinning in the other direction.
     
  9. bitpanther

    bitpanther L1: Registered

    Messages:
    2
    Positive Ratings:
    0
    how do you orientate the axis at which your brush spins? I can only get it to spin horizontally
     
  10. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,531
    In the Flags tab in the properties dialog, there should be checks for X or Y.
     
    • Thanks Thanks x 1
  11. bitpanther

    bitpanther L1: Registered

    Messages:
    2
    Positive Ratings:
    0
    that worked, thanks
     
  12. LeSwordfish

    aa LeSwordfish semi-trained quasi-professional

    Messages:
    4,109
    Positive Ratings:
    6,058
    Sorry to massively necrobump, but can you give any more details on this? Being able to reverse these would save me hours of work.
     
  13. Tehrasha

    Tehrasha L3: Member

    Messages:
    115
    Positive Ratings:
    26
    To reverse it, you need to give it a negative distance.

    Column 1 Column 2 Column 3 Column 4 Column 5
    OUTPUT TARGET INPUT PARAMETER DELAY
    OnTrigger !activator Distance -360 -
    OnTrigger !activator Speed 200 -


    I'm doing this from memory, so forgive me if it is way off...
    It has been over a year since I messed with this, but I seem to remember that if a trigger inserts new speed/distance values, you must also perform a lock/unlock for the change to take effect.
     
    • Thanks Thanks x 1
  14. LeSwordfish

    aa LeSwordfish semi-trained quasi-professional

    Messages:
    4,109
    Positive Ratings:
    6,058
    Ah! Thank you. That looks just the sort of thing i need.
     
  15. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,531
    There is no Distance input to set the distance key, hence my comment about AddOutput. Aside from adding outputs, it can overwrite/add keys.

    Column 1 Column 2 Column 3 Column 4
    OUTPUT TARGET INPUT PARAMETER
    OnTrigger !activator AddOutput distance -360


    You can see the actual key name for anything by turning off smart edit, many that lack an input can be overwritten this way, but some won't work when changed at runtime.
     
    • Thanks Thanks x 1
  16. Vengeance

    Vengeance L1: Registered

    Messages:
    20
    Positive Ratings:
    2
    awesome, thanks bro
     
  17. Thorval

    Thorval L1: Registered

    Messages:
    36
    Positive Ratings:
    55
    So I think I did something wrong It spins for about 1-2 sec and then it stops anyone know how to get it in an invinite loop?
     
  18. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,531
    Show what you did, dunno how else to help because everything I'd say is already up there. If it is only completing one rotation, it may be that you have the direction outputs flipfloped the wrong way.
     
  19. Thorval

    Thorval L1: Registered

    Messages:
    36
    Positive Ratings:
    55
    Can I add you on steam // Skype so you can see my test map I've made it in? ^^
     
  20. Thorval

    Thorval L1: Registered

    Messages:
    36
    Positive Ratings:
    55
    I also get this error in the console: !! ERROR: bad input/output link:
    !! momentary_rot_button(momentary_rot_button,SetPositionImmediately) doesn't match type from logic_relay(rotate_relay)