how do I make a rotating wheel to open a gate
Post Reply
Quote
Re: how do I make a rotating wheel to open a gate
Posted by Zechro on Mon Jul 2nd at 1:42am 2007


I am having trouble trying to figure out how to make one of those gates in Chapter 4: water hazard. The one where you turn the wheel to slowly open the gate and if you let go of the wheel before completely turning it, the gate closes again.Maybe you can help me.

The answer is either really obvious or really hard





Quote
Re: how do I make a rotating wheel to open a gate
Posted by Riven on Mon Jul 2nd at 4:15am 2007


Yea, it's pretty strait forward...

Ok, you just need two entities to get this to work. A momentary_rot_button and a func_movelinear; both of which are brush based entities. The func_movelinear will become your door. Mind you, a door that moves side to side, or up and down, that's about it. The func_movelinear is best represented by covering it with the nodraw texture and make a wheel prop (ideally the one used in the level you mentioned: models/props_borealis/door_wheel001a.mdl [use prop_dynamic]) parented to that invisible momentary_rot_button.

Now you're pretty much free to do whatever you want with the keyvalues, but note that if you want the door to slam back down when the player is not turning the wheel, then you need to leave the "toggle" flag unchecked in the momentary_rot_button's flags and assign a number at which the speed for the door to close back when not in motion under the "auto-return speed" keyvalue.

But the real magic happens between the two entities' I/O systems...

For the momentary_rot_button's outputs, just put:

My output named: Position
Target entities named: The name you gave your func_movelinear.
Via this input: Set Position
No parameters, fire more than once, and no delay.

space

Now, for your func_movelinear we will create TWO outputs:

-Output 1-
My output named: OnFullyOpened
Target entities named: your momentary_rot_button
Via this input: Set Parent
No parameters, fire more than once, and no delay.

-Output 2-
My output named: OnFullyOpened
Target entities named: your momentary_rot_button
Via this input: Set Position
No parameters, fire more than once, and no delay.

And that's it! Just make sure your door and wheel are moving in the right direction, and you have "use activates" selected for the momentary_rot_button, and you should be set to go! After which, I would go back and tweak the settings some.







Quote
Re: how do I make a rotating wheel to open a gate
Posted by Zechro on Tue Jul 3rd at 3:45am 2007


Okay it works except the door doesn't stay open when it's fully open





Quote
Re: how do I make a rotating wheel to open a gate
Posted by Riven on Tue Jul 3rd at 5:00am 2007


Like I already noted:

? quoting myself
"Note that if you want the door to slam back down when the player is not turning the wheel, then you need to leave the "toggle" flag unchecked in the momentary_rot_button's flags and assign a number at which the speed for the door to close back when not in motion under the "auto-return speed" keyvalue."

If you don't want it to close back (which I thought you did based on the description of what you wanted in your original post) then you need to do the opposite. That is, DO check the "toggle" flag!







Quote
Re: how do I make a rotating wheel to open a gate
Posted by quanta on Fri Jul 6th at 6:30pm 2007


If you want the door to stay open when it's fully opened, then add this output to the momentary_rot_button:

MyOutput: OnFullyOpened
Target Entities Named: !self
Via This Input: Lock

If this doesn't work, try changing all of the OnFullyOpened outputs to OnFullyClosed outputs.




People its snarkpit.net not snarkpit.com! Be sure to check this when you add links!



Quote
Re: how do I make a rotating wheel to open a gate
Posted by Zechro on Mon Jul 9th at 7:40am 2007


ok I must've made a mistake before it works now thanks




Post Reply