WiseLaser: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Changed formatting)
m (Fixed some links)
Line 96: Line 96:


Settings for first path_track on the left side:
Settings for first path_track on the left side:
:Class: path_track
Class: [[path_track]]
* Name: ''Beam01path01 (Beam02path01 on the Right side)''
* Name: ''Beam01path01 (Beam02path01 on the Right side)''
* Next Stop Target: ''Beam01path02 (Beam02path02 on the Right side)''
* Next Stop Target: ''Beam01path02 (Beam02path02 on the Right side)''
Line 104: Line 104:
As you can see the visual effect of the laser, it’s speed and the tiny sprite can all be changed to your liking.
As you can see the visual effect of the laser, it’s speed and the tiny sprite can all be changed to your liking.


{{Tip|The reason I’m using a env_beam on each side rather than on one side only is I found the laser effect to be much better, you can experiment with this.}}
{{Tip|The reason I’m using a [[env_beam]] on each side rather than on one side only is I found the laser effect to be much better, you can experiment with this.}}


== Water Puddle ==
== Water Puddle ==
Line 114: Line 114:
* Material: ''decals/decalborealispuddle001a''
* Material: ''decals/decalborealispuddle001a''


I’ve placed an env_cubemap over this, a ambient_generic for the sound and a trigger_multiple to play the sound when the Player steps there.
I’ve placed an env_cubemap over this, an [[ambient_generic]] for the sound and a [[trigger_multiple]] to play the sound when the Player steps there.


Class: ambient_generic
Class: [[ambient_generic]]
* Name: ''WaterSound''
* Name: ''WaterSound''
* Sound name: ''Water.StepLeft''
* Sound name: ''Water.StepLeft''

Revision as of 11:39, 16 February 2008

Moving Laser

Moving Laser

In the image to the right the laser travels from both ends of that tunnel and will kill the player. I’ve placed the height so the player can jump over the laser each time. The player can not go under the laser at this height however.

There are several ways to create an effect like this, the settings and methods that is used in this tutorial can easily be changed to your liking. Notice the sprite placed on each side for a burning hot effect.

There’s a secondary ambient effect used in this tutorial, not related to the laser. A water puddle is created on the floor it will also make a splash sound.

An env_beam is used on each side of the tunnel to create the moving laser:

Class: env_beam

  • Name: Beam01 (Right side name = Beam02)
  • Parent: Beam01train (Right side parent = Beam02train)
  • Brightness: 75
  • Beam Color: 255 0 0
  • Life: 0 (Infinite)
  • Width of Beam: 0.7
  • Noise: 0
  • Sprite name: sprites/laserbeam.spr
  • Texture scroll rate: 40
  • Damage: 1000
  • Start Entity: Beam01 (Beam02 for the right side)
  • Ending Entity: Beam02 (Beam01 for the right side)
  • Touch Type: Not a tripwire
  • Flags:
  • Start On: Checked

Setup in Hammer

Setup in Hammer

To the right there's a shot from Hammer of the left side env_sprite, env_beam, func_tracktrain and first path_track.

Note.pngNote:The left and right sides are identical except for entity names.

Objects used

By looking at the image you can see the env_sprite is parented to the env_beam. The env_beam is parented to the invisible func_tracktrain. Our first path_track, the starting point, is nestled right in there with the other entities.

These are the settings for each env_sprite, which are only used for a slight effect.

Class: env_sprite

  • Parent: Beam01 (Beam02 for Right side)
  • Render FX: Normal
  • Render Mode: Additive
  • FX Amount: 150
  • FX Color: 255 0 0
  • Disable receiving shadows: Yes
  • Frame rate: 10.0
  • Sprite name: materials/sprites/glow03.vmt
  • Scale: 0.2
  • Size of Glow: 2.0
  • Flags:
  • Start on: Checked

Settings for each func_tracktrain:

Class: func_tracktrain

  • Name: Beam01train (Beam02train for the Right side)
  • Disable receiving shadows: Yes
  • Disable Shadows: Yes
  • First Stop Target: Beam01path01 (Beam02path01 for the Right side)
  • Max speed: 60
  • Initial Speed: 60
  • Change Velocity: Instantaneously
  • Change Angles: Near path_tracks
  • Distance between the wheels: 10
  • Height above the track: 0
  • Bank angle on turns: 0
  • Move sound: d3_citadel.weapon_zapper_beam_loop1 (Left side only)
  • Volume: 2
  • Flags:
  • No User Control: Checked
  • Passable: Checked
  • Fixed Orientation: Checked
  • Is unblockable by Player: Checked

Path Tracks

Setup in Hammer

Notice in the image to the right that there are only 4 path_track’s. (Two on each side, for each func_tracktrain)

On the left side the first path_track references the second path_track which in turn references the first path_track, which causes the lasers on each side to go in a loop back and forth.

Settings for first path_track on the left side: Class: path_track

  • Name: Beam01path01 (Beam02path01 on the Right side)
  • Next Stop Target: Beam01path02 (Beam02path02 on the Right side)

By adding more of these path_track’s you could cause the laser to travel in a zigzag pattern. You could also attach multiple lasers to each side, for a double effect as an example.

As you can see the visual effect of the laser, it’s speed and the tiny sprite can all be changed to your liking.

Tip.pngTip:The reason I’m using a env_beam on each side rather than on one side only is I found the laser effect to be much better, you can experiment with this.

Water Puddle

The Water Puddle effect is done with an info_overlay.

Water Puddle

Class: info_overlay

  • Material: decals/decalborealispuddle001a

I’ve placed an env_cubemap over this, an ambient_generic for the sound and a trigger_multiple to play the sound when the Player steps there.

Class: ambient_generic

  • Name: WaterSound
  • Sound name: Water.StepLeft
  • Volume: 4
  • Flags:
  • Start Silent: Checked
  • Is NOT Looped: Checked

Class: trigger_multiple

  • Start disabled: No
  • Delay before reset: 1
  • Flags:
  • Clients: Checked
  • Everything: Checked
  • Output:
  • OnStartTouch, WaterSound, PlaySound

Laser turning a corner.

Laser turning a corner

The trick to making the Laser turn a corner is to stop the inside train until the outside train catches up. Take a look at the Outputs for the path_tracks in the corner, should be straight-forward.

The next step is to make the Laser teleport to the first path_tracks so it can start over. To do that just check the flag Teleport to this path_track, in both of the first path_tracks.

The download for this tutorial contains two vmf projects. In the second example the Laser turns a corner and travels down another tunnel. Notice that I didnt use the sprites for this second example. Looked better without them.

Wrap up

There’s a lot more you can do, hopefully this article have stimulated your imagination.

Credits