Sparking Rope Tutorial

First thing, set up your map.

The entity we need first, is a move_rope. This will be the upper end of the rope.
Name it rope1 (or similar) and set
Next KeyFrame to rope2. Choose Subdivision values as you like, you might leave them at the default.

The next entity is the keyframe_rope, the ending point of the rope.
It is called rope2, so that it completes the rope that started with the move_rope. Don't forget to set
Parent: box

Next, make a little brush, about 16x16x16 and center it onto the keyframe_rope. Texture it with the nodraw texture, and click ctrl + t to make it a func_physbox, adjusting these values:

Name: box
Disable Shadows: Yes
Material Type: Metal
Mass Scale: 1
Not Solid to world: Passes through world

Check these flags:
Ignore +USE for Pickup
Not affected by rotorwash
Don't take physics damage
Don't allow bullet penetration

Now we make the box hang on the rope.
Create a logic_measure_movement, and add:

Entity to measure: box
Measure Reference: rope1
Entity to move: rope2
Movement Reference: rope1

Place the logic_measure_movement about 2/3 up the rope.
The next thing we need is a phys_lengthconstraint.
Place it right onto the keyframe_rope and the func_physbox.

Adjust these values:
Entity 1: box
Additional length: 20.

Uncheck the "No collision until break" flag.

Then make sure to have "Toggle helpers" switched on (The sphere in Hammer's toolbar) and drag the little white circle up, about 1/2 of the rope.

news post image

Then we create an env_spark, which also sits in the very middle of the box and the keyframe_rope.

Give it these values:
Name: sparks
Parent: box

You can adjust Magnitude and Spark Trail Length as you wish.

This is how it should look like:
news post image

Now, we are going to make it move around.

Build a env_physexplosion and add these values:
Name: explosion
Magnitude: 400
Clamp Radius: 64
Limit to Entity: box

Check only the "No damage - Only Force" flag.
Drag the explosion into the near vincinity to the func_physbox.

Now we are almost done:
Create an ambient_generic.
Name: sound
Sound Name: Breakable.Spark

Start Silent
Is not Looped

The next and final step is triggering all these things: Make a logic_auto and a logic_timer.

For the logic_auto, we set these values:
Outputs: On Map Spawn - timer - Enable - 0 - no

For the logic_timer:
Name: timer
Start disabled: Yes
Use Random Time: Yes
Minimum Random Interval: 1
Maximum Random Interval: 3

OnTimer - explosion - Explode - 0 - No
OnTimer - sound - PlaySound - 0 - No

And that wraps it up! Now it should look like this:
news post image

Have fun!


View comments ( 4 )

Back to top