Creating indicator lights

From Valve Developer Community
Jump to: navigation, search
Portal Level Creation
Final product

This tutorial will show you how to make those indicator strips on the ground and walls that change color when the trigger is activated. It assumes you have moderate knowledge on the Hammer Overlay Tool.

Overlays

info_overlays all laid out.

The bulk of the lights are comprised of info_overlays. The four textures used are:

  • signage/indicator_lights/indicator_lights_floor
  • signage/indicator_lights/indicator_lights_wall
  • signage/indicator_lights/indicator_lights_corner_wall
  • signage/indicator_lights/indicator_lights_corner_floor
  1. Create a path using the above info_overlays from your trigger to whatever they should activate. Give them all the same name; in this example we will use button_lights. The strips should all be 8 units wide and any length.


For a straight length of lightstrip that is longer than the length of one strip (four circles), you can adjust the overlay properties to make it longer rather than make duplicates of the strip. This is accomplished by editing the U Start or U End keyvalue in the properties window for the overlay.

When you first place a strip with the overlay tool, either U Start or U End will be 1. This is a multiplier for repeating the overlay - how many strips long the overlay will be. So if you change the value to 2, this will make the overlay have two lengths of strip, which effectively puts 8 circles into it. Note this does not change the length of the overlay, and you have to stretch the overlay to fit the desired length of the strip so the circles are the correct aspect ratio.

Note:You can use decimal values to fine-tune the strip's length - for example, a U Start or U End of 1.25 will make the strip 5 circles long, and 2.5 will make the strip 10 circles long.

Checkmark box

Where to put the frame.

1. Create a prop_static with the following properties:

Property Name Value
World Model models/props/sign_frame01/sign_frame01.mdl

Align it so it will be at the end of your light path.

Where to put the brush.

2. Create a 32Wx4Lx32H block brush textured with tools/toolsnodraw. Texture the front with signage/signage_doorstate. Align this brush so it fits inside the prop_static sign frame.

3. Tie the brush to a func_brush entity and give it the same name as your info_overlay entities.

Making it Work

Final product

1. Create a env_texturetoggle entity somewhere near your overlays. Give it the following properties:

Property Name Value
Name button_lights_toggle
Target Brush(es) button_lights (or whatever you named the overlays/func_brush)

2. Now just add the following output to the trigger for your button/switch/etc:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnStartTouch button_lights_toggle SetTextureIndex 1 0.00 No
Io11.png OnEndTouchAll button_lights_toggle SetTextureIndex 0 0.00 No

You now have helpful indicator lights to put around your map!

See also

External links

  • Example map Example map using this tutorial. VMF included.