Please or Register to create posts and topics.

[Solved] Rotating the panel 90 degrees

PreviousPage 2 of 2
dhavalmistry wrote:
No, I only want the panel to turn in one direction.

Four directions then?

?????????????????????????????TWP Releases | My Workshop
chickenmobile wrote:
Four directions then?

Press the button --> Panel turns 90 degrees counter clockwise

Press the button again --> Panel turns another 90 degrees counter clockwise (180 degrees from starting position)

Press the button third time --> Panel turns (180+90) 270 degrees

Press the button 4th time --> Panel turns (270+90) 360 degrees a.k.a. starting position.

and it keeps doing that as long as the player wants.

Rand0mNumbers wrote:
Try a momentary_rot_button and send it SetPosition inputs. That's what is used in here: http://www.youtube.com/watch?v=-Epr3khsZUg

It won't go out of alignment, but I don't know how you'd keep it rotating continuously. The button doesn't wrap around to rotate from 270 to 0, it rewinds. Perhaps momentarily toggling the startdirection keyvalue would help.

Hey, I tried doing like you suggested but its not working. Maybe I am doing something wrong. Is there a vmf I can look at or can you make me one with a room and one panel rotating on press of a button please?

Thanks in advance!

Just an edit of my image is what you want, but the button tells the door to open and not the OnFullyClosed output.

Targetnames:
panel - the thing you want to rotate
doorparent - the thing panel gets parented to that's got a distance of 90 and set to rotate along the same axis as the panel
button: Button to rotate the panel.

Output, Targetname, Input, Parameter, Delay

button:

OnPressed, !self, Lock, , 0
OnPressed, panel, SetParent, doorparent, 0
OnPressed, doorparent, Open, , 0.01

doorparent:

OnFullyOpen, panel, ClearParent, , 0
OnFullyOpen, !self, Close, , 0.01
OnFullyClosed, button, UnLock, , 0

Kasc wrote:
Just an edit of my image is what you want, but the button tells the door to open and not the OnFullyClosed output.

Targetnames:
panel - the thing you want to rotate
doorparent - the thing panel gets parented to that's got a distance of 90 and set to rotate along the same axis as the panel
button: Button to rotate the panel.

Output, Targetname, Input, Parameter, Delay

button:

OnPressed, !self, Lock, , 0
OnPressed, panel, SetParent, doorparent, 0
OnPressed, doorparent, Open, , 0.01

doorparent:

OnFullyOpen, panel, ClearParent, , 0
OnFullyOpen, !self, Close, , 0.01
OnFullyClosed, button, UnLock, , 0

I am at work right now so I cant test but just by reading it, it makes sense!

Kasc wrote:
Just an edit of my image is what you want, but the button tells the door to open and not the OnFullyClosed output.

Targetnames:
panel - the thing you want to rotate
doorparent - the thing panel gets parented to that's got a distance of 90 and set to rotate along the same axis as the panel
button: Button to rotate the panel.

Output, Targetname, Input, Parameter, Delay

button:

OnPressed, !self, Lock, , 0
OnPressed, panel, SetParent, doorparent, 0
OnPressed, doorparent, Open, , 0.01

doorparent:

OnFullyOpen, panel, ClearParent, , 0
OnFullyOpen, !self, Close, , 0.01
OnFullyClosed, button, UnLock, , 0

You my friend are a GENIUS!! :D

It works!!

No problemo!

dhavalmistry wrote:
Hey, I tried doing like you suggested but its not working. Maybe I am doing something wrong. Is there a vmf I can look at or can you make me one with a room and one panel rotating on press of a button please?

Thanks in advance!

From your last post, you have it working, but I've attached the vmf anyways.
I don't know how to stop the panel from wrapping around. Math_counter handles integers, but not doubles, so I don't know what to do right now.

Pressing the button will place the panel in 4 different positions sequentially. Once you reach the end, it will rewind itself and start again.

Rand0mNumbers wrote:
From your last post, you have it working, but I've attached the vmf anyways.

Yes I have it working and thanks for the vmf. I am sure I will learn a thing or two from your map!

PreviousPage 2 of 2