Creating rotating panels: Difference between revisions
mNo edit summary |
Thunder4ik (talk | contribs) m (Unicodifying, replaced: [[Image: → [[File: (7)) |
||
(5 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{lang|Creating rotating panels}} | ||
| | |||
}} | |||
== Method A: Func_door_rotating == | == Method A: Func_door_rotating == | ||
1. Draw a brush with the [[ | 1. Draw a brush with the [[File:Hammer block.png]] '''Block Tool''' the size of the panel you need. Don't make it too thin as this could cause glitches when a portal is placed on it later. A thickness of 8 units is reliable. | ||
2. Tie this new brush to a [[func_door_rotating]]. For this tutorial, name it "flip_panel". | 2. Tie this new brush to a [[func_door_rotating]]. For this tutorial, name it "flip_panel". | ||
Line 37: | Line 35: | ||
The point of rotation can be changed through the alteration of the entities origin. The origin sets which point on the plane of movement the object will rotate through, think of it as a hinge for a door. With the ''show helpers'' option enabled in Hammer, the origin will appear as a small white circle in the center of the entity that can be dragged to a new location. | The point of rotation can be changed through the alteration of the entities origin. The origin sets which point on the plane of movement the object will rotate through, think of it as a hinge for a door. With the ''show helpers'' option enabled in Hammer, the origin will appear as a small white circle in the center of the entity that can be dragged to a new location. | ||
|- | |- | ||
| First thing to do is to find the axis we want the brush to rotate on. A good way to do this is to look through the grid views and find the view which shows exactly where we want to place the origin. Once found, drag the cursor to the upper left hand side of the view port to reveal which view port it is, '''1'''. This view only shows two of the three axes, the missing one is the one we want, which in this case would be the '''Y''' axis. Go to the flag section of the door's object properties, and check the <code>Y Axis</code> box. The other thing to keep in mind is by default, a <code>func_door_rotating</code> moves clockwise around the point of rotation in the 2D view, we want it to move the other way, so we also need to check the <code>Reverse Dir</code> box as well in the flags tab of the object properties. Now move the cursor over the door's origin, '''2'''.||[[ | | First thing to do is to find the axis we want the brush to rotate on. A good way to do this is to look through the grid views and find the view which shows exactly where we want to place the origin. Once found, drag the cursor to the upper left hand side of the view port to reveal which view port it is, '''1'''. This view only shows two of the three axes, the missing one is the one we want, which in this case would be the '''Y''' axis. Go to the flag section of the door's object properties, and check the <code>Y Axis</code> box. The other thing to keep in mind is by default, a <code>func_door_rotating</code> moves clockwise around the point of rotation in the 2D view, we want it to move the other way, so we also need to check the <code>Reverse Dir</code> box as well in the flags tab of the object properties. Now move the cursor over the door's origin, '''2'''.||[[File:Door_rotate_2.jpg]] | ||
|} | |} | ||
Line 55: | Line 53: | ||
== Method B: Func_Brush parented to | == Method B: Func_Brush parented to rotating model == | ||
[[File:Rotatepanel.png|thumb|250px|right|View in Hammer]] | [[File:Rotatepanel.png|thumb|250px|right|View in Hammer]] | ||
Line 75: | Line 73: | ||
| Name || trans_brush | | Name || trans_brush | ||
|- | |- | ||
| Parent || trans_panel | | Parent || trans_panel,panel_attach | ||
|} | |} | ||
{{Note|Hammer will indicate that the Parent value is invalid. Ignore it.}} | |||
3 | 3. Create a [[ambient_generic]] entity with the following settings: | ||
::{| class=standard-table | ::{| class=standard-table | ||
! Property Name || Value | ! Property Name || Value | ||
Line 101: | Line 90: | ||
4. Return to [[prop_dynamic]] entity and set up the output as follows: | |||
::{| class=standard-table | ::{| class=standard-table | ||
! || My Output || Target Entity || Target Input || Parameter || Delay || Only Once | ! || My Output || Target Entity || Target Input || Parameter || Delay || Only Once | ||
|- | |- | ||
| [[ | | [[File:Io11.png]] || OnAnimationDone || trans_sound_end || PlaySound || || 0.00 || No | ||
|} | |} | ||
5. Create a [[prop_button]] entity and set up the output as follows: | |||
::{| class=standard-table | ::{| class=standard-table | ||
! || My Output || Target Entity || Target Input || Parameter || Delay || Only Once | ! || My Output || Target Entity || Target Input || Parameter || Delay || Only Once | ||
|- | |- | ||
| [[ | | [[File:Io11.png]] || OnPressed || trans_panel || SetAnimation || rotate_180 || 0.00 || No | ||
|- | |- | ||
| [[ | | [[File:Io11.png]] || OnUnPressed || trans_panel || SetAnimation || rotate_180_reverse || 0.00 || No | ||
|} | |} | ||
This will rotate the panel along with brush. Second line will rotate the panel back to normal position after a delay. | This will rotate the panel along with brush. Second line will rotate the panel back to normal position after a delay. | ||
Line 123: | Line 112: | ||
! || My Output || Target Entity || Target Input || Parameter || Delay || Only Once | ! || My Output || Target Entity || Target Input || Parameter || Delay || Only Once | ||
|- | |- | ||
| [[ | | [[File:Io11.png]] || <your output> || trans_panel || SetAnimation || rotate_180 || 0.00 || No | ||
|- | |- | ||
| [[ | | [[File:Io11.png]] || <your output> || trans_panel || SetAnimation || rotate_180_reverse || 0.00 || No | ||
|} | |} | ||
---- | ---- | ||
Line 131: | Line 120: | ||
''Cleaned up and polished by LemonLake'' | ''Cleaned up and polished by LemonLake'' | ||
[http://forums. | [http://forums.thinking.withportals.com/downloads.php?view=detail&df_id=369 Download panels_rotate Prefab] | ||
===Comparison=== | ===Comparison=== | ||
Line 139: | Line 126: | ||
While it might sound complicated to set up the func_door_rotating in Method A at first, the advantage of this method is that it saves two ambient_generics, one prop_dynamic and a lot of inputs for parenting and rotating. | While it might sound complicated to set up the func_door_rotating in Method A at first, the advantage of this method is that it saves two ambient_generics, one prop_dynamic and a lot of inputs for parenting and rotating. | ||
However, this method has one disadvantage over Method B: The simple_panel rotation animation has a "lively" effect of over-rotating and then snapping back into place while the func_door_rotating just stops after rotating. | However, this method has one disadvantage over Method B: The simple_panel rotation animation has a "lively" effect of over-rotating and then snapping back into place while the func_door_rotating just stops after rotating. | ||
== See also == | == See also == |
Latest revision as of 00:22, 7 January 2024
Method A: Func_door_rotating
1. Draw a brush with the Block Tool the size of the panel you need. Don't make it too thin as this could cause glitches when a portal is placed on it later. A thickness of 8 units is reliable.
2. Tie this new brush to a func_door_rotating. For this tutorial, name it "flip_panel".
3. Depending on what you need, adjust the key values:
Property Name Value Comments Name flip_panel Needed to later send an input to the panel. Speed 380 The speed of the rotation. Set to whatever you prefer. The Flip Panel of the Puzzle Maker uses 380. Start Sound a3_jump_intro_rotating_panel_travel_01.wav If wanted, set a sound that will always play when the flip panel starts to rotate. It is not needed to add an aditional ambient_generic. Stop Sound a3_jump_intro_rotating_panel_arrival_01.wav If wanted, set a sound that will always play when the flip panel comes to halt. Again, it is not needed to add an aditional ambient_generic. Delay Before Reset (-1 stay) -1 Once the panel has rotated, it will automatically rotate back after the amount of seconds set here. If you set -1, it will not flip back automatically but wait for an input to do so. Spawn Position Closed This can be set to either Open or Closed. It doesn't matter which one you choose, but the later inputs depend on what you used here. For this tutorial, leave this at Closed. Distance 180 This is the is distance in degrees that the panel will rotate. We want a panel that rotates from front to back so we choose 180 degrees.
4. Find the correct axe to rotate on. We set the brush to rotate 180 degrees, but we didn't specify on which axe it should rotate so it actually flips around. The easiest way to do this is the method described in func_door_rotating.
5. Create inputs to make the flip panel flip. You could use a prop_floor_button for example.
My Output Target Entity Target Input OnPressed flip_panel Open OnUnPressed flip_panel Close
Method B: Func_Brush parented to rotating model
1. Create a prop_dynamic entity with the following settings:
Property Name Value Name trans_panel Pitch Yaw Roll (X Y Z) 90 0 0 World Model models/anim_wp/simple_panel_transforms/simple_panel.mdl
2. Create a block brush of any size you wish (64x16x64 recommended) and align it with the model. Tie it to a func_brush entity with the following settings:
Property Name Value Name trans_brush Parent trans_panel,panel_attach

3. Create a ambient_generic entity with the following settings:
Property Name Value Name trans_sound_end Sound name World.SpeedFlingRotatingPanelStop Volume 2
4. Return to prop_dynamic entity and set up the output as follows:
5. Create a prop_button entity and set up the output as follows:
This will rotate the panel along with brush. Second line will rotate the panel back to normal position after a delay.
You can also connect the rotating panel to any other kind of input. Set the outputs to this:
Cleaned up and polished by LemonLake
Comparison
While it might sound complicated to set up the func_door_rotating in Method A at first, the advantage of this method is that it saves two ambient_generics, one prop_dynamic and a lot of inputs for parenting and rotating.
However, this method has one disadvantage over Method B: The simple_panel rotation animation has a "lively" effect of over-rotating and then snapping back into place while the func_door_rotating just stops after rotating.