Creating indicator lights: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Removed (ontrigger) and (offtrigger) because OffTrigger does not exist. Valve also uses OnStartTouch and OnEndTouchAll with their buttons.)
m (Unicodifying, replaced: [[Image: → [[File: (3))
 
(19 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Back|Portal Level Creation}}
{{lang|Creating indicator lights}}
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]].
{{back | Portal Level Creation}}
{{DISPLAYTITLE: Portal - Tutorial - Indicator Lights}}
 
This tutorial will show you how to create indicators 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 ==
== Overlays ==


[[Image:Indicatorlights1.jpg|right|thumb|info_overlays all laid out.]]
[[File:portal_indicators_strips.png|right|thumb|Indicator strips laid out]]


The bulk of the lights are comprised of [[info_overlay]]s. The four textures used are:
The bulk of the lights are comprise [[info_overlay]]s. The four textures used are:


*<code>signage/indicator_lights/indicator_lights_floor</code>
*<code>signage/indicator_lights/indicator_lights_floor</code>
Line 13: Line 16:
*<code>signage/indicator_lights/indicator_lights_corner_floor</code>
*<code>signage/indicator_lights/indicator_lights_corner_floor</code>


# Create a path using the above <code>info_overlays</code> 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.
# Set up the lights, follow one of the following steps:
## 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.
## '''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.'''
##*[http://youtube.com/watch?v=_0ZlIst-v3c Watch a tutorial video here].


== Checkmark box ==
Indicators on the walls or ceiling will use the <code>signage/indicator_lights/indicator_lights_wall</code> and <code>signage/indicator_lights/indicator_lights_corner_wall</code> textures while the indicators on the floor will use the <code>signage/indicator_lights/indicator_lights_floor</code> and <code>signage/indicator_lights/indicator_lights_corner_floor</code> textures.


[[Image:Indicatorlights2.jpg|right|thumb|Where to put the frame.]]


1. Create a [[prop_static]] with the following properties:
Start the indicator strip from the activator to what the activator will activate, for instance, a button connecting to a door. Rename the indicators to anything. Resize the corners to 8x8 and resize the strips to 8x32 while [[Hammer_Map_Operations_Toolbar#Texture Lock| Texture Lock]] is enabled.
{{note| Letting go of the corners will make the strip look like it went to 10x32, this is because of the size of the overlay model but in actuality, the overlay size is the same. }}
 
 
If your strip needs to be shorter or longer than 32x8, disable '''Texture Lock''' and resize it. Be sure that there is a circle for every 8 units on the strip. Enable '''Texture Lock''' once you are finished with an individual strip.
 
{{clr}}
 
== Doorstate Indicators ==
 
These indicators are to be used with [[Test Chamber Door|Test Chamber Doors]].
 
[[File:Portal indicators doorstate.png|right|thumb|Where to put the doorstate indicator]]
 
Create a [[prop_static]] and enter the following properties:
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
Line 30: Line 40:
| World Model || models/props/sign_frame01/sign_frame01.mdl
| World Model || models/props/sign_frame01/sign_frame01.mdl
|}
|}
Align it so it will be at the end of your light path.
[[Image:Indicatorlights3.jpg|right|thumb|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 <code>prop_static</code> sign frame.


3. Tie the brush to a [[func_brush]] entity and give it the same name as your <code>info_overlay</code> entities.
Align the center of the side you need to the last indicator strip.
 
Create a </code>32Wx4Lx32H</code> block brush textured with </code>tools/toolsnodraw</code>. Texture the front with </code>signage/signage_doorstate</code>. Align this brush so it fits inside the <code>prop_static</code> sign frame.
 
Tie the brush to a [[func_brush]] entity and give it the same name as your <code>info_overlay</code> entities.
 
{{clr}}
 
==Ending indicators without doorstate==
 
[[File:Image 2022-03-21 033819.png|right|thumb|Corner End Indicators]]
This is quite simple, all you have to do is add a corner indicator to the end of your path, for instance, test chamber 06.
 
{{clr}}
{{clr}}


==Making it Work==
==Changing the color==
 
[[File:Portal indicators finished.png|right|thumb|Finished indicator]]


[[Image:Indicatorlights4.jpg|right|thumb|Final product]]
1. Create a [[env_texturetoggle]] entity somewhere near your overlays. Give it the following properties:
1. Create a [[env_texturetoggle]] entity somewhere near your overlays. Give it the following properties:
::{| class=standard-table
::{| class=standard-table
Line 53: Line 73:
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
|-
| [[Image:Io11.png]] || OnStartTouch || button_lights_toggle || SetTextureIndex || 1 || 0.00 || No
| [[File:Io11.png]] || OnStartTouch || button_lights_toggle || SetTextureIndex || 1 || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnEndTouchAll || button_lights_toggle || SetTextureIndex || 0 || 0.00 || No
| [[File:Io11.png]] || OnEndTouchAll || button_lights_toggle || SetTextureIndex || 0 || 0.00 || No
|}
|}


You now have helpful indicator lights to put around your map!
{{note|You can use any name you'd like, for this guide, "button_lights" and "button_lights_toggle" will be used for the targetnames}}
 
==Test Element Indicators==
 
Some testing elements have their own unique indicator rules.
 
===Test Chamber Doors===
 
Place the doorstate 64 units above the ground and place it 12 units away from the door it self.
 
===Lab Doors===
 
Place the indicator above it while centering it horizontally.
[[File:Portal indicators labdoor.png|left|thumb|Lab door indicator]]
 
{{clr}}
 
Lab doors that open to a catcher box will have the indicator centered below it.
[[File:Portal indicators labdoor catcher.png|left|thumb|Lab door indicator]]
 
{{clr}}
 
===Activator Testing Elements===
 
Almost all activator elements like Buttons, switches, Energy Ball Catchers, etc... have their indicator start from the center.
 
[[File:Portal indicators catcher.png|thumb|left|200px|Catcher Indicator]]
[[File:Portal indicators buttons.png|thumb|left|400px|Button Indicator]]
[[File:Portal indicators switches.png|thumb|left|400px|Switch Indicator]]
 
{{clr}}


== See also ==
== See also ==
* [[Portal Level Creation]]
* [[Portal Level Creation]]


[[Category:Level Design Tutorials]]
[[Category:Portal]]
[[Category:Portal]]
[[Category:Level Design]]
[[Category:Tutorials]]

Latest revision as of 00:12, 7 January 2024

English (en)Français (fr)Translate (Translate)
Portal Level Creation

Warning: Display title "Portal - Tutorial - Indicator Lights" overrides earlier display title "Creating indicator lights".

This tutorial will show you how to create indicators 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

Indicator strips laid out

The bulk of the lights are comprise 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


Indicators on the walls or ceiling will use the signage/indicator_lights/indicator_lights_wall and signage/indicator_lights/indicator_lights_corner_wall textures while the indicators on the floor will use the signage/indicator_lights/indicator_lights_floor and signage/indicator_lights/indicator_lights_corner_floor textures.


Start the indicator strip from the activator to what the activator will activate, for instance, a button connecting to a door. Rename the indicators to anything. Resize the corners to 8x8 and resize the strips to 8x32 while Texture Lock is enabled.

Note.pngNote: Letting go of the corners will make the strip look like it went to 10x32, this is because of the size of the overlay model but in actuality, the overlay size is the same.


If your strip needs to be shorter or longer than 32x8, disable Texture Lock and resize it. Be sure that there is a circle for every 8 units on the strip. Enable Texture Lock once you are finished with an individual strip.

Doorstate Indicators

These indicators are to be used with Test Chamber Doors.

Where to put the doorstate indicator

Create a prop_static and enter the following properties:

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

Align the center of the side you need to the last indicator strip.

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.

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

Ending indicators without doorstate

Corner End Indicators

This is quite simple, all you have to do is add a corner indicator to the end of your path, for instance, test chamber 06.

Changing the color

Finished indicator

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
Note.pngNote:You can use any name you'd like, for this guide, "button_lights" and "button_lights_toggle" will be used for the targetnames

Test Element Indicators

Some testing elements have their own unique indicator rules.

Test Chamber Doors

Place the doorstate 64 units above the ground and place it 12 units away from the door it self.

Lab Doors

Place the indicator above it while centering it horizontally.

Lab door indicator

Lab doors that open to a catcher box will have the indicator centered below it.

Lab door indicator

Activator Testing Elements

Almost all activator elements like Buttons, switches, Energy Ball Catchers, etc... have their indicator start from the center.

Catcher Indicator
Button Indicator
Switch Indicator

See also