User:ThePaperDog/Rotating Button: Difference between revisions
Thepaperdog (talk | contribs) m (User:ThePaperDog moved to User:ThePaperDog Rotating Button: To align with a consistent naming convention) |
Thepaperdog (talk | contribs) |
(No difference)
|
Revision as of 19:18, 3 March 2009
HOW TO MAKE A ROTATING BUTTON TURN (SWITCH ON/OFF)
During the game, players will come across some physics scenarios, where they will need to switch a rotating button on/off to achieve an effect or desired progress in the game. This page will describe steps on how to build a functional Rotating button prop for a custom map, where:
1) The Player can +USE the button object and it will turn 90 degrees (ON position).
2) With a toggle flag option set, the Player can repeat the +USE action and the button object will toggle back (OFF Position). (or... Without the Toggle Flag set, the button object will automatically return to OFF position.)
REQUIRED OBJECTS
1) Create a new texture brush and set it as a func_rot_button entity.
2) Ensure these flags are set for the function entity:
Not Solid Checked X Axis Checked Y Axis Checked Use Activates Checked
3) Create a new prop_dynamic entity and browse/set its world model/skin as model:
Recommended model: firetrap_button01a.mdl (The Button)
4) Create a new prop_static entity and browse/set its world model/skin as model:
Recommended model: firetrap_buttonpad.mdl (The Button Pad)
SET OBJECTS' PARENT/CHILD RELATIONSHIP
Bind the function entity with the button entity by making the function entity the parent of the button entity.
1) Set the Name property for each of the entities (Give each entity a unique, meaningful name). For example:
(func_rot_button) Name = MyButtonRotator (prop_dynamic) button Name = MyButton (prop_static) button pad Name = MyButtonPad
2) Set the Parent property of the prop_dynamic entity to the name of the momentary_rot_button entity:
(prop_dynamic) button Parent = MyButtonRotator
SET OUTPUTS
Set an output statement in the momentary_rot_button entity's OTIP settings (i.e. Output, Target, Input, Parameter Override settings in the entity's Properties | Outputs tab-page).
1) Use the following values:
Output... OnPressed Target... MyButton Input... SetAnimation
GROUP THE OBJECTS
Drag the function entity over the prop_dynamic button entity, making sure that the prop is completely enclosed by the brush.
Once the entities are properly aligned, it is recommended that they be locked together as group entity. (Also recommend saving that grouped entity as a Prefab in the Steam directory.)
NOTES
1) The func_rot_button brush placement/position will effect the precision of button prop's dynamics. For example, if the brush is moved away from its associated prop, the rotation performance of the prop will behave like a right/left/up/down lever, offset from the intended axis of the prop. A good practice is to make sure that the Origins for each entity are centered and aligned to each other. (You can experiment with the brush placement to illustrate this.)
2) The natural inclination is to place the button prop on a wall. Align the entities accordingly.
Updates pending: (button, rotating button, switch, switch pad, red button)
--The PaperDog 03:34, 18 February 2009 (UTC)--
Retrieved from "http://developer.valvesoftware.com/wiki/User_talk:ThePaperDog"