Creating indicator lights: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (fix)
(rewrote abortion of an explanation of u start and u end to be intelligible)
Line 15: Line 15:




If a strip reaches the end of a [[brush]] so that a circle is partly cut off, you may be able to correct the problem using these steps as an alternative to simply moving the strips.
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.  
# Set the U Start to 0 and U End to length divided by 32, rounded to the nearest 0.25.  This will distort the circles of the indicators slightly, but the indicator strip will end without a partial circle light. This is appropriate for longer strips.
 
# If one of the ends of the strips is concealed by a switch, button, or other object, set the U Start to 0 and U End to length divided by 32, exactly. If your U End is not divisible by 0.25, look at which end of your indicator strips ends with a partial circle light. To switch which end of the strip has the partial light, change your U Start to your old U End value, and change U End to 0.
When you first place a strip with the overlay tool, either '''U Start''' or '''U End''' will be ''1''. This is a multiplier for 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.
# '''The easiest way is to resize the overlay to 8*32, then turn off [[Hammer_Tools_Menu#Texture_Lock_.3CShift.2BL.3E|texture lock]] and resize it's length to requirements.'''
{{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.}}
#*[http://youtube.com/watch?v=_0ZlIst-v3c Watch a tutorial video here].


== Checkmark box ==
== Checkmark box ==

Revision as of 15:59, 3 October 2010

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 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.pngNote: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.