Suspended Object Trap

From Valve Developer Community
Revision as of 04:53, 12 September 2006 by Nfpartridge (talk | contribs) (polish and grammar/spelling)
Jump to navigation Jump to search

Introduction

An example of what this tutorial will accomplish

This tutorial explains the process of creating a trap consisting of a heavy object suspended by a dynamic rope which can then be triggered to fall with devastating effect. This is an advanced tutorial covering entity creation, parenting, I/O configuration, keyframe editing, and flag manipulation. Overall completion time is estimated at fourty-five minutes to one hour.

The Source Hammer editor does not allow a user to directly attach an object to a rope. However, there is a workaround. The basic idea involves parenting the end of a rope to a secondary entity. This secondary entity is then used in conjunction with a few physics entities that measure the movement of the secondary entity and translate its movements back to the rope. We'll also be creating a trigger that will break the rope when it gets damaged causing the previously suspended object to crash down! Sounds complicated but don't worry, it'll make sense once it's done. Let's get started!

Entity Creation

Entity Placement

Entity Properties Configuration

Naming:

Naming your entities is arbitrary- you can chose what names you want. For the purposes of this tutorial the nomenclature is:

As you can see, each entity has the prefix dynamicXX and a descriptive suffix. This is a useful naming system when you have several dynamic systems and need to keep them separate.

Key Values for Rope Workaround:

Here comes the tricky part where most errors are made.

  • set the dynamic01_move_rope's Next KeyFrame to dynamic01_keyframe_rope
  • set the dynamic01_move_rope's Slack to 0
  • set the dynamic01_keyframe_rope's Slack to 0
  • set the dynamic01_env_spark's parent to dynamic01_prop_phyics_override
  • set the dynamic01_phys_lengthconstraint Entity1 to dynamic01_prop_phyics_override
  • set the following values of the dynamic01_logic_measuremovement to:
    • Entity to Measure to dynamic01_env_spark
    • Measure Reference to dynamic01_move_rope
    • Entity to Move to dynamic01_keyframe_rope
    • Movement Reference to dynamic01_move_rope
Trap Trigger Creation

Select the dynamic01_func_button entity and:

  • set the Parent to dynamic01_prop_phyics_override
  • set the Disable Receiving Shadows to Yes
  • set the Move Direction (Pitch Yaw Roll) to 0 0 0
  • set the Speed to 0
  • set the Lip to 0
  • configure the Flags tab like in the image below:
File:Trap trigger flag config.jpg
  • configure the Outputs tab like in the image below:
File:Trap trigger output config.jpg