Wheelvalve: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Editing)
m (Wisdurm moved page User:ThePaperDog/Wheelvalve to Wheelvalve: Useful page which is finished enough to warrant being moved out of user space)
 
(16 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== '''HOW TO MAKE A VALVEWHEEL TURN (OPEN AND CLOSE)''' ==
{{essay}}
HL2, EP1, EP2: During the game, players will come across some physics scenarios, where they will need to turn a pipe valve on and/or off to achieve an effect or desired progress in the game.
== '''HOW TO MAKE A WHEELVALVE TURN (OPEN AND CLOSE)''' ==
[[file:ValveWheel1.png]]
----
'''Introduction'''


This page will describe steps on how to build a functional valvewheel prop for a custom map, where:
During the game, players will encounter various scenarios, where they will need to turn a pipe (wheelvalve) on and/or off to achieve an effect or desired progress in the game.  This page will describe steps on how to build a functional wheelvalve prop for a custom map, where:


1) ''The Player can ''+USE'' the valve object and it will turn (to open). ''
*The Player can ''+USE'' the valve object and it will turn (to open position).
*The Player can repeat the ''+USE'' action and the valve object will toggle back (to closed position)...OR...
*With the '''Toggle (Disable Auto Return)''' Flag '''un-checked''', the valve object will automatically return to closed position.
== REQUIRED ENTITIES AND OBJECTS ==
1) '''MOMENTARY_ROT_BUTTON''' (This is a brush-model entity.)
:a) Create a new texture brush on your map.
:b) Use your editor's 'MOVE SELECTED TO:' feature to convert the brush from World to Entity.
:c) Set the entity's class as a ''momentary_rot_button''.
:d) Name the entity as "FM1"
:e) Select and apply the brush-texture: "Invisible" to the entity.  
:f) For ''vertical position'' of the valve, set the following flags:
::*Not Solid Checked
::*Toggle Unchecked (optional)
::*X Axis Checked
::*Y Axis Checked
::*Use Activates Checked
:g) For ''Horizontal position'' of the valve, set the following flags:
::*Not Solid Checked
::*Toggle Unchecked (optional)
::*Use Activates Checked


2) ''The Player can repeat the ''+USE'' action and the valve object will toggle back (to close).''


== REQUIRED OBJECTS ==
2) '''PROP_DYNAMIC''' (This is a point entity (Wheelvalve prop).)
:a) Place a new prop_dynamic entity on your map.
:b) Choose and select its world model skin from one of the following, as:
::*[models\props_pipes\valvewheel001.mdl]
::*[models\props_pipes\valvewheel002.mdl]
::*[models\props_pipes\valvewheel002a.mdl]  --- ''Note: This model is larger.''
:c) Name the entity as "W1"
:d) Select its Parent as [Func_for_Valve]


1)  Create a new texture brush and set it as a '''momentary_rot_button''' entity.


2) Ensure these flags are set:
3) '''PROP_STATIC''' (This is a point entity (Pipe-valve prop))
      '''Not Solid      ''' ''Checked''     
:a) Place a new prop_static entity on your map.
      '''Toggle'''          ''Checked''
:b) Choose and select its world model skin from one of the following, as:  
      '''Use Activates  ''' ''Checked''
::*[models\props_pipes\valve001.mdl] --- ''Note: Best if used with the larger wheelvalve model.''
3) Create a new '''prop_dynamic''' entity and browse/set its world model/skin as model:
::*[models\props_pipes\valve002.mdl]  
    ''Recommended model:''  valvewheel001.mdl
:c) Naming this entity is not required
== SET INPUTS/OUTPUTS (I/O)==
1) Set the following output trigger(s) in the (FM1) brush's I/O.  


== SET OBJECTS' PARENT/CHILD RELATIONSHIP ==
[[file:I O WheelValve.png]]
Bind the two new objects together, making the '''momentary_rot_button''' entity as the ''parent'' of the '''prop_dynamic''' entity.
==PLACE, ALIGN AND GROUP THE OBJECTS ==
 
Follow these steps:
1)  Set the '''Name''' property for each of the entities (Give each entity a unique, meaningful name).  For example:
    (momentary_rot_button)  Name = MyValveRotator
    (prop_dynamic)          Name = MyValve
2) Set the '''Parent''' property of the '''prop_dynamic''' entity to the name of the '''momentary_rot_button''' entity:
    (prop_dynamic)          Parent = MyValveRotator
 
== SET OUTPUTS ==
Set an output statemet 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...    '''MyValve'''
  Input...    '''SetAnimation'''
 
== GROUP THE OBJECTS ==
Drag the '''momentary_rot_button''' brush over the '''prop_dynamic''' 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.)


*Center the origin of the prop_static entity (pipe system).
*Place the prop_dynamic entity '''"W1"''' into the desired position on the pipe system.
*Set the desired Pitch Yaw Roll (Y Z X ) values for entity "W1". 
*Center the origin for "W1".
*Align "W1"'s origin with the prop_static's origin ''as close as possible''.
*Place the momentary_rot_button brush entity '''"FM1"''' over "W1", making sure that "FM1" completely encloses "W1".  Allow enough extension of "FM1" for the player to ''touch'' it.
*Center the origin for "FM1".
*Align "FM1"'s origin with "W1"'s origin ''as close as possible''. 
*Set the (Y) value for "FM1" equal to the (Y) value of "W1".  (''Note; If you move and/or re-orient these objects to a different position in the map, repeat this step.'')
*Group all the objects. (You can also save the finished group as a pre-fab)
== NOTES ==   
== NOTES ==   
The '''momentary_rot_button''' brush placement/position will effect the precision of 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.) ''
Updates pending:  ''(valve, valvewheel, pipe-valve, pipe-valvewheel, pipe)''


-- The PaperDog 21:22, 16 February 2009 (UTC)
Also see paragraph on '''Exploiting Origin''' in:
*[[User:ThePaperDog/WORKING WITH AXIS ORIENTATION ORIGIN | WORKING WITH AXIS, ORIENTATION AND ORIGIN]]




== Editing ==
--The PaperDog 05:57, 15 March 2009 (UTC)
Hi, ThePaperDog. Great to watch you busy with your User Page. But please bear in mind that all those minor changes become visible to all of us within the Recent Changes page. Which generates a big list of minor changes. If editing, use the 'Show Preview' button before posting. Thanks from us all :) --[[User:JurgenKnops|Jurgen Knops]] 12:33, 18 February 2009 (UTC)

Latest revision as of 13:59, 7 June 2024

Icon-essay.png
This is an essay.
It contains the advice or opinions of one or more of the Valve Developer Community's contributors.
This page is not an encyclopedia article, nor is it one of the Valve Developer Community's policies or guidelines, as it has not been thoroughly vetted by the community.
Some essays represent widespread norms; others only represent minority viewpoints.

HOW TO MAKE A WHEELVALVE TURN (OPEN AND CLOSE)

ValveWheel1.png


Introduction

During the game, players will encounter various scenarios, where they will need to turn a pipe (wheelvalve) on and/or off to achieve an effect or desired progress in the game. This page will describe steps on how to build a functional wheelvalve prop for a custom map, where:

  • The Player can +USE the valve object and it will turn (to open position).
  • The Player can repeat the +USE action and the valve object will toggle back (to closed position)...OR...
  • With the Toggle (Disable Auto Return) Flag un-checked, the valve object will automatically return to closed position.

REQUIRED ENTITIES AND OBJECTS

1) MOMENTARY_ROT_BUTTON (This is a brush-model entity.)

a) Create a new texture brush on your map.
b) Use your editor's 'MOVE SELECTED TO:' feature to convert the brush from World to Entity.
c) Set the entity's class as a momentary_rot_button.
d) Name the entity as "FM1"
e) Select and apply the brush-texture: "Invisible" to the entity.
f) For vertical position of the valve, set the following flags:
  • Not Solid Checked
  • Toggle Unchecked (optional)
  • X Axis Checked
  • Y Axis Checked
  • Use Activates Checked
g) For Horizontal position of the valve, set the following flags:
  • Not Solid Checked
  • Toggle Unchecked (optional)
  • Use Activates Checked


2) PROP_DYNAMIC (This is a point entity (Wheelvalve prop).)

a) Place a new prop_dynamic entity on your map.
b) Choose and select its world model skin from one of the following, as:
  • [models\props_pipes\valvewheel001.mdl]
  • [models\props_pipes\valvewheel002.mdl]
  • [models\props_pipes\valvewheel002a.mdl] --- Note: This model is larger.
c) Name the entity as "W1"
d) Select its Parent as [Func_for_Valve]


3) PROP_STATIC (This is a point entity (Pipe-valve prop))

a) Place a new prop_static entity on your map.
b) Choose and select its world model skin from one of the following, as:
  • [models\props_pipes\valve001.mdl] --- Note: Best if used with the larger wheelvalve model.
  • [models\props_pipes\valve002.mdl]
c) Naming this entity is not required

SET INPUTS/OUTPUTS (I/O)

1) Set the following output trigger(s) in the (FM1) brush's I/O.

I O WheelValve.png

PLACE, ALIGN AND GROUP THE OBJECTS

Follow these steps:

  • Center the origin of the prop_static entity (pipe system).
  • Place the prop_dynamic entity "W1" into the desired position on the pipe system.
  • Set the desired Pitch Yaw Roll (Y Z X ) values for entity "W1".
  • Center the origin for "W1".
  • Align "W1"'s origin with the prop_static's origin as close as possible.
  • Place the momentary_rot_button brush entity "FM1" over "W1", making sure that "FM1" completely encloses "W1". Allow enough extension of "FM1" for the player to touch it.
  • Center the origin for "FM1".
  • Align "FM1"'s origin with "W1"'s origin as close as possible.
  • Set the (Y) value for "FM1" equal to the (Y) value of "W1". (Note; If you move and/or re-orient these objects to a different position in the map, repeat this step.)
  • Group all the objects. (You can also save the finished group as a pre-fab)

NOTES

Also see paragraph on Exploiting Origin in:


--The PaperDog 05:57, 15 March 2009 (UTC)