Indicator Lights (Portal 2)

From Valve Developer Community
Revision as of 00:52, 11 May 2011 by Baggie (talk | contribs) (A quick and dirty description and tutorial about Indicator Lights.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Indicator Lights are lines of small lights that are present in test chambers to indicate the interaction between two or more entities in the map, typically between a button and another entity in the world. The typical usage of the lights are the lights being blue when inactive, and orange when active.

How to make Indicator Lights

This tutorial assumes basic knowledge of Hammer.

Step 1

Create a Button, and an entity named "env_texturetoggle".

Step 2

Select a texture for the lights in the texture browser, for this tutorial use "signage/indicator_lights/indicator_lights_floor" (Easily found by typing "indicator" in the filter bar).

Step 3

Select the decal option in hammer, and place your light decals as desired. Functionally it doesn't matter how they're placed, though a logical line between the entities interacting is desired. You can also use decals with different textures if desired.

Step 4

Select the decals you just placed (and ONLY the decals you want) and change their names using alt-enter to the same name. Use "indlights_1" for this tutorial. Then open up the env_texturetoggle you previously placed, and enter the same name into the Target Brush(es) field. Then name the env_texturetoggle "texturetoggle_lights_01"

Step 5

Select the button entity, and go to the outputs menu. Add a new variable, set output name to "OnPressed", set Target entities to the name you gave the env_texturetoggle, set Via this input to "SetTextureIndex" and set the parameter overide to 1. This will change the texture to the appropriate orange texture. Then, make another entity with the same settings, except change the output named to "OnButtonReset" and change the parameter override to 0.

Done, your indicator lights should now be working!