Jump to content

Toggling a Func_Rotating?


Recommended Posts

Is there any entity or script setup that would allow players to make a func_rotating start and stop rotating while in-game? For instance, one button makes the func_rotating stop rotating, and another button makes it start again. Or, with scripting and conditionals, one button could perform both functions.

 

I tried targeting a trigger_multiple at a func_rotating, but when I used the trigger in-game, all it did was make the func_rotating disappear. The only way to make it reappear was to load the map. So it seems like directly targeting the entity is not the answer.

 

If this is not possible, feel free to share alternate ways of achieving the same result. All I want is a rotating object that can be started and stopped at will.

Link to comment

I don't know what you could be doing wrong, but I just tried with a func_rotating and a func_usable and it stopped / started without problems.

 

To be more precise it stops and gets back to the original angles. Perhaps that's a hint.

Wow really? Would you mind listing the exact keys/values for both entities when they were working like that?

 

Going back to the original angles is fine for my purposes. I just need the object to be always visible, and only rotate under specific conditions (such as a button having been pressed).

Link to comment

Wow really? Would you mind listing the exact keys/values for both entities when they were working like that?

 

Going back to the original angles is fine for my purposes. I just need the object to be always visible, and only rotate under specific conditions (such as a button having been pressed).

 

It's nothing much really, I merely created a func_usable, ticked the always_on and player_use options, a wait value of 3, linked it to the func_rotating, with the start_on button ticked. Also make sure that your func_rotating has an origin brush at its center of rotation (system/origin) - I'm not sure if that could be the cause, but other than that I don't know.

Link to comment

I tried the exact setup you described and got the same result as before. Except this time, I had a suspicion--after the func_rotating disappeared, I noclipped back to the map's origin (coordinates 0, 0, 0), and sure enough, there was the func_rotating, still rotating just as before. Using it had caused it to fly back to the map origin for some reason, without affecting the rotation.

 

Interestingly, when I tried moving the entity with a script, that made the rotation stop. But I couldn't figure out how to get the rotation going again.

 

If you get a chance, could you attach or send me the .map file where you got it to work? If I can't replicate your results using the setup you described, I should at least be able to get the same results by using the same .map file. If I compile your map and it still doesn't work for me, there's something a lot weirder going on.

Link to comment

Hey thanks for the PM @@Ramikad! Well, it looks like I should have cleared up something very obvious right from the start: I'm trying to get this to work in MP. When I loaded your map in MP and it still didn't work, I wondered if you had been using SP instead...sure enough, in SP, it worked just as you described. 

 

So it appears that toggling a func_rotating in MP does not work the same as it does in SP--if it works at all. Does anyone know of a way to make it work in an MP map?

 

So far my best solution is to not use a func_rotating at all, but to make a func_static and use a script with an infinite loop to repeatedly rotate it in 90-degree increments. "If" statements are then used to check variables at each increment and see if rotation should continue. The script is continuously running in the background during gameplay, so that it's ready whenever a variable changes. Very clunky, and very tedious to script, but it does basically work. I'm hoping for a more elegant solution...thus, this thread.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...