Rotating brushes with buttons

ok, basically, what I want to do is have a number of rotating assemblies which have to be lined up to a specific configuration in order to open a door, fairly basic stuff from most puzzle games and what-have-you. anyway, the bit I’m having problems with is finding a system that lets me rotate one of those assemblies at 45 degree increments using two buttons. left and right (clockwise and counter clockwise) there’s got to be no limit to the number of rotations it can do.
the basic system is that you hit a button, and the assembly rotates 45 degrees from where it is at that point. and stops. you can then hit the button again to go another 45 degrees or hit the other button to go back 45 degs.

any thoughts?

nobody?

I’m surprised.
to clarify, I’m having problems identifying which type of brush entity would do what I want to do.

Try a func_rotating.
Func_rot_momentary?

func_rot_momentary sounds likely, func_rotating occurred to me, but looking at the functions, I can’t see any way to rotate it in increments.

Update: having checked…can’t find any func_rot_momentary function.

Both tend to quickly lose angular precision. The following setup should be more resistant, but I haven’t tested it.

  1. Make two func_door_rotatings set to rotate 45 degrees in opposite directions.
  2. Make two func_buttons.
  3. Connect the OnPressed output of each func_button to the Lock input of both func_buttons.
  4. Connect the OnPressed output of each func_button to the assembly’s SetParent input. The parameter is the name of the func_door_rotating rotating in the desired direction.
  5. Connect the OnPressed output of each func_button to the Open input of the respective func_door_rotating.
  6. Connect the OnFullyOpen output of each func_door_rotating to the assembly’s ClearParent input.
  7. Connect the OnFullyOpen output of each func_door_rotating to its own Close input.
  8. Connect the OnFullyClosed output of each func_door_rotating to the Unlock input on both func_buttons.

Add a slight delay between outputs so nothing happens too soon.

When the doors finish opening, might have them temporarily increase speed to close faster.

hey wow, thanks Terrenteller, that sounds like it’ll work fantastically well. I’ll test it right now.

[editline]12:48AM[/editline]

ok, testing finished, again thanks very much Terrenteller, it worked absolutely how I wanted.
I can post the testbed vmf/bsp up if people want, but really its not very impressive, all fullbright and the whole system functions quite slowly. should convert nicely for my later ones though.