PDA

View Full Version : [TUTORIAL] func_rotating replacement


A Boojum Snark
10-20-2008, 09:50 PM
After figuring this out I found the two (http://forums.tf2maps.net/showthread.php?t=3269) other (http://forums.tf2maps.net/showthread.php?t=3067) 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.

FaTony
10-21-2008, 06:53 AM
Cool!

Altaco
10-31-2008, 10:09 PM
Very clever, nice!

Ninjilla
06-21-2009, 09:38 PM
Great stuff! Thanks Boojumsnark :]

grazr
06-22-2009, 05:27 AM
ninja bump, ninjilla.

But it does give me some ideas.

grazr
06-22-2009, 06:11 AM
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

A Boojum Snark
06-22-2009, 09:35 AM
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
07-17-2009, 09:00 AM
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
11-07-2011, 06:46 PM
how do you orientate the axis at which your brush spins? I can only get it to spin horizontally

A Boojum Snark
11-07-2011, 06:52 PM
In the Flags tab in the properties dialog, there should be checks for X or Y.

bitpanther
11-07-2011, 08:48 PM
that worked, thanks

LeSwordfish
01-06-2012, 12:40 PM
and it might be possible to overwrite the speed or distance key using AddOutput to reverse it.

Sorry to massively necrobump, but can you give any more details on this? Being able to reverse these would save me hours of work.

Tehrasha
01-06-2012, 04:33 PM
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.

LeSwordfish
01-06-2012, 04:45 PM
Ah! Thank you. That looks just the sort of thing i need.

A Boojum Snark
01-07-2012, 12:21 AM
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.

Vengeance
01-23-2012, 06:30 PM
awesome, thanks bro