[TUTORIAL] func_rotating replacement

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,776
7,673
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:
OUTPUT|TARGET|INPUT
OnFullyClosed|rotate_relay|Trigger

Create a logic_relay and name it rotate_relay. Give it the following:
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:
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:
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.
 
Last edited:

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814
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:

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,776
7,673
I managed to get it manually working using a normal solid trigger

edit2: Is it possible to change the buttons direction of movement using I/O?
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.
 

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814
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.
 

bitpanther

L1: Registered
Nov 7, 2011
2
0
how do you orientate the axis at which your brush spins? I can only get it to spin horizontally
 

Tehrasha

L3: Member
Nov 5, 2009
115
28
Sorry to massively necrobump, but can you give any more details on this? Being able to reverse these would save me hours of work.

To reverse it, you need to give it a negative distance.

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.
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,776
7,673
There is no Distance input to set the distance key, hence my comment about AddOutput. Aside from adding outputs, it can overwrite/add keys.

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.
 

Thorval

L1: Registered
Feb 15, 2014
38
68
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?
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,776
7,673
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.
 

Thorval

L1: Registered
Feb 15, 2014
38
68
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.
Can I add you on steam // Skype so you can see my test map I've made it in? ^^
 

Thorval

L1: Registered
Feb 15, 2014
38
68
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)