This article's documentation is for anything that uses the Source engine. Click here for more information.

Env instructor hint: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(New keyvalue)
(→‎Keyvalues: Add The Stanley Parable keyvalue hint_nofadeout)
 
(42 intermediate revisions by 19 users not shown)
Line 1: Line 1:
[[File:env_instructor_hint.gif|left|link=]]
{{LanguageBar}}
{{this is a|point entity|name=env_instructor_hint|since=Left 4 Dead 2|sprite=env_instructor_hint.gif}} {{also|{{mapbase}}}}
{{CD|CEnvInstructorHint|file1=env_instructor_hint.cpp}}
It is used to instruct the player to do some things, such as not shoot teammates.


{{L4d2 point|env_instructor_hint}} It allows creation and control of instructor lessons by map logic.
[[File:Instructorhint.png|right|thumb|Example from Portal 2.]]
{{note|env_instructor_hint currently cannot display more than one hint at the same time.}}
{{clr}}


== Keyvalues ==
[[File:Hint_017_show_key_bindings.jpg‎‎‎|thumb|right|This example sets '''Bound Command''' to "jump" (without quotations) with '''Caption''' set to "Bet you can't jump over me!" (without quotations).]]
{{KV|Target Entity|target_destination|The entity to show this hint on top of. The entity used must exist on the client, [[info_target_instructor_hint]] can be parented to server only entities for this purpose.}}
{{KV|Positioning|choices|Either show at the position of the Target Entity. Or show the hint directly on the hud at a fixed position.}}
:* 0 : Follow the Target Entity
:* 1 : Show on the hud
{{KV|Allow invisible target|choices|Do we allow the hint to follow entites with nodraw set?}}
:* 0 : End immediately on nodraw
:* 1 : Yes
{{KV|Caption|string|The text of your hint.}}
{{KV|Caption Color|color255|The color of the caption text}}
{{KV|Force caption|choices|Do we show the caption text even if the hint is occluded by a wall?}}
:* 0 : No
:* 1 : Show when occluded
{{KV|Onscreen Icon|choices|The [[#Icons|icon]] to use when the hint is within the player's view.}}
{{KV|Offscreen Icon|choices|The [[#Icons|icon]] to use when the hint is outside the player's view.}}
{{KV|Show offscreen|choices|When the hint is offscreen, do we show an icon and arrow?}}
:* 0 : Show
:* 1 : Don't show
{{KV|Bound Command|string|If using 'show key bindings' for the onscreen icon, this field should be the command we want to show bindings for}}
{{KV|Icon Height Offset|float|A height offset from the target entity's origin to display the hint}}
{{KV|Size Pulsing|choices|The icon size can pulsate}}
:* 0 : No Pulse
:* 1 : Slow Pulse
:* 2 : Fast Pulse
:* 3 : Urgent Pulse
{{KV|Alpha Pulsing|choices|The icon alpha can pulsate}}
:* 0 : No Pulse
:* 1 : Slow Pulse
:* 2 : Fast Pulse
:* 3 : Urgent Pulse
{{KV|Shaking|choices|The icon can shake}}
:* 0 : No Shaking
:* 1 : Narrow Shake
:* 2 : Wide Shake
{{KV|Timeout|integer|The automatic timeout for the hint. 0 will persist until stopped with <code>EndHint</code>.}}
{{KV|Display Range|float|The visible range of the hint. 0 will show it at any distance.}}
{{KV|Show on First Sight|boolean|When the player first sees it, it will automatically show for them.}}
{{KV|Gamepad Bound Command|string|If using 'show key bindings' for the onscreen icon, this field should be the command we want to show bindings for when gamepad is enabled (and PS3/X360)|since=p2}}
{{KV Targetname}}


== Inputs ==
__TOC__
{{IO|ShowHint|Start showing the hint. If an entity name is passed as a parameter, the hint is shown only to that entity.}}
{{IO|EndHint|Stop showing the hint if it hasn't already timed out.}}
{{I Targetname}}


== Outputs ==
==Icons==
{{O Targetname}}
{| class="standard-table"
 
== Icons ==
{| class="standard-table" style="text-align: center; float: left;"
|-
|-
!Icon Name
!Icon Name
!Icon
!Icon
|-
| icon_tip
| [[Image:Hint_001_icon_tip.jpg]]
|-
| icon_info
| [[Image:Hint_002_icon_info.jpg]]
|-
| icon_shield
| [[Image:Hint_003_icon_shield.jpg]]
|-
| icon_alert
| [[Image:Hint_004_icon_alert.jpg]]
|-
| icon_alert_red
| [[Image:Hint_005_icon_alert_red.jpg]]
|-
| icon_tip (again)
| [[Image:Hint_006_icon_tip_(again).jpg]]
|-
| icon_skull
| [[Image:Hint_007_icon_skull.jpg]]
|-
| icon_no
| [[Image:Hint_008_icon_no.jpg]]
|}
{| class="standard-table" style="text-align: center; float: left;"
|-
!Icon Name
!Icon Name
!Icon
!Icon
|-
|-
| icon_interact
|{{code|icon_tip}}
| [[Image:Hint_009_icon_interact.jpg]]
|[[File:Env_instructor_hint_-_icon_tip.png|64px|Icon of {{code|icon_tip}}, located in {{path|materials\vgui\hud\iconsheet|vtf}} on {{l4d2|4}}.]]
|-
|{{code|icon_interact}}
| icon_button
|[[File:Env_instructor_hint_-_icon_interact.png|64px|Icon of {{code|icon_interact}}, located in {{path|materials\vgui\hud\gameinstructor_iconsheet1|vtf}} on {{csgo|4|nt=csgocol}}.]]
| [[Image:Hint_010_icon_button.jpg]]
|-
|-
| icon_door
|{{code|icon_info}} {{not|{{csgo}}}}
| [[Image:Hint_011_icon_door.jpg]]
|[[File:Env_instructor_hint_-_icon_info.png|64px|Icon of {{code|icon_info}}, located in {{path|materials\vgui\hud\iconsheet|vtf}} on {{l4d2|4}}.]]
|{{code|icon_button}}</br>(blank in {{csgo}})
|[[File:Env_instructor_hint_-_icon_button.png|64px|Icon of {{code|icon_button}}, located in {{path|materials\vgui\hud\iconsheet|vtf}} on {{l4d2|4}}.]]
|-
|-
| icon_arrow_plain
|{{code|icon_shield}} {{not|{{csgo}}}}
| [[Image:Hint_012_icon_arrow_plain.jpg]]
|[[File:Env instructor hint - icon_shield.png|64px|Icon of {{code|icon_shield}}, located in {{path|materials\vgui\hud\iconsheet|vtf}} on {{l4d2|4}}.]]
|{{code|icon_door}}
|[[File:Env instructor hint - icon_door.png|64px|Icon of {{code|icon_door}}, located in {{path|materials\vgui\hud\gameinstructor_iconsheet1|vtf}} on {{csgo|4|nt=csgocol}}.]]
|-
|-
| icon_arrow_plain_white_dn
|{{code|icon_alert}}
| [[Image:Hint_013_icon_arrow_plain_white_dn.jpg]]
|[[File:Env instructor hint - icon_alert.png|64px|Icon of {{code|icon_alert}}, located in {{path|materials\vgui\hud\gameinstructor_iconsheet1|vtf}} on {{csgo|4|nt=csgocol}}.]]
|{{code|icon_arrow_plain}} {{not|{{csgo}}}}
|[[File:Env instructor hint - icon_arrow_plain.png|64px|Icon of {{code|icon_arrow_plain}}, located in {{path|materials\vgui\hud\iconsheet|vtf}} on {{l4d2|4}}.]]
|-
|-
| icon_arrow_plain_white_up
|{{code|icon_alert_red}}</br>{{code|icon_caution}} {{csgo}} (blank)
| [[Image:Hint_014_icon_arrow_plain_white_up.jpg]]
|[[File:Hint_005_icon_alert_red.jpg]]
|{{code|icon_arrow_plain_white_dn}}
|[[File:Hint_013_icon_arrow_plain_white_dn.jpg]]
|-
|-
| icon_arrow_up
|{{code|icon_tip}} (again)</br>{{code|icon_bulb}} {{csgo}}
| [[Image:Hint_015_icon_arrow_up.jpg]]
|[[File:Hint_006_icon_tip_(again).jpg]]
|{{code|icon_arrow_plain_white_up}}
|[[File:Hint_014_icon_arrow_plain_white_up.jpg]]
|-
|-
| icon_arrow_right
|{{code|icon_skull}}
| [[Image:Hint_016_icon_arrow_right.jpg]]
|[[File:Hint_007_icon_skull.jpg]]
|{{code|icon_arrow_up}}
|[[File:Hint_015_icon_arrow_up.jpg]]
|-
|-
|{{code|icon_no}}
|[[File:Hint_008_icon_no.jpg]]
|{{code|icon_arrow_right}}
|[[File:Hint_016_icon_arrow_right.jpg]]
|}
|}


{{clr}}
{{note|This entity is not limited to the icons listed above, refer to {{code|scripts/mod_textures.txt}} ({{l4dseries}}, {{as}}, {{p2}}, etc.) or {{code|scripts/instructor_textures.txt}} ({{csgo}}) located in the main {{path|pak01_dir.vpk}}, or on the "csgo" folder for more icon options. In CS:GO or some Source games, the icon may be blank.
{{note|env_instructor_hint is not limited to icons listed above, please refer to '''scripts/mod_textures.txt''' located in the main pak01_dir.vpk for more icon options.}}
}}
 
==Keyvalues==
{{KV Targetname}}
{{KV|Target Entity|intn=hint_target|target_destination|The entity to show this hint on top of. The entity used must be one that is replicated on the client, or the hint will never show up. The {{ent|info_target_instructor_hint}} entity is designed for this purpose, allowing the hint to be placed in empty space or parented to a specific location on another entity.
 
{{note|If an {{ent|info_target}} entity is used, the spawnflag to always transmit to the client must be checked.}}}}
{{KV|Positioning|intn=hint_static|choices|Either show at the position of the '''Target Entity''', or show the hint directly on the [[HUD]] at a fixed position.
:*0: Follow the '''Target Entity'''.
:*1: Show on the HUD.}}
{{KV|Allow invisible target|intn=hint_allow_nodraw_target|choices|Do we allow the hint to follow entities with nodraw set? {{confirm|{{ent|EF_NODRAW}}?}}
:*0: End immediately on nodraw
:*1: Yes}}
{{KV|Caption|intn=hint_caption|string|The text of your hint. 100 character limit.}}
{{KV|Caption Color|intn=hint_color|color255|The color of the caption text.}}
{{KV|Activator Caption|intn=hint_activator_caption|color255|since=AS|The color of the caption text, as seen by the {{ent|!activator}}.}}
{{KV|Force caption|intn=hint_forcecaption|choices|Do we show the caption text even if the hint is occluded by (hidden behind) a wall?
:*0: No
:*1: Show when occluded}}
{{KV|Onscreen Icon|intn=hint_icon_onscreen|choices|The icon to use when the hint is within the player's view.}}
{{KV|Offscreen Icon|intn=hint_icon_offscreen|choices|The icon to use when the hint is outside the player's view.}}
{{KV|Show offscreen|intn=hint_nooffscreen|choices|When the hint is offscreen, do we show an icon and arrow?
:*0: Show
:*1: Don't show}}
{{KV|Bound Command|intn=hint_binding|string|If using the '''use_binding''' setting for the '''Onscreen Icon''' or '''Offscreen Icon''', this field should be the command we want to show bindings for. Use {{ent|key_listboundkeys}} to see all bound keys.}}
{{KV|Icon Height Offset|intn=hint_icon_offset|float|A height offset from the '''Target Entity''''s origin to display the hint.}}
{{KV|Size Pulsing|intn=hint_pulseoption|choices|Speed for which the icon should grow and shrink, as a way to nag the player about the object.
:*0: No Pulse
:*1: Slow Pulse
:*2: Fast Pulse
:*3: Urgent Pulse}}
{{KV|Alpha Pulsing|intn=hint_alphaoption|choices|Speed for which icon will become more or less transparent.
:*0: No Pulse
:*1: Slow Pulse
:*2: Fast Pulse
:*3: Urgent Pulse}}
{{KV|Shaking|intn=hint_shakeoption|choices|The icon can shake.
:*0: No Shaking
:*1: Narrow Shake
:*2: Wide Shake}}
{{KV|Timeout|intn=hint_timeout|integer|The automatic timeout for the hint. 0 will persist until stopped with <code>EndHint</code>.}}
{{KV|No Fade|intn=hint_nofadeout|boolean|only={{tsp}}|If true, this hint won't fade out when expired.}}
{{KV|Display Range|intn=hint_range|float|The visible range of the hint. 0 will show it at any distance.}}
{{KV|Show on First Sight|intn=hint_auto_start|boolean|When the player first has [[LOS]] to the target, it will automatically show for them. {{l4d2}} only.}}
{{KV|Lesson Name|intn=hint_name|string|Hints with the same lesson name use a common base and are treated as instances the same lesson type. {{l4d2}} only.}}
{{KV|Display Limit|intn=hint_display_limit|integer|The number of times a hint can be seen. 0 means unlimited. {{l4d2}} only.}}
{{KV|Instance Type|intn=hint_instance_type|choices|How many instances of a single lesson type can be open or active at the same time. {{l4d2}} only.
:*0: Multiple
:*1: Single Open (Prevents new hints from opening.)
:*2: Fixed Replace (Ends other hints when a new one is shown.)
:*3: Single Active (Hides other hints when a new one is shown.)}}
{{KV|Suppress rest before moving|intn=hint_suppress_rest|choices|Suppress the initial icon display in center of screen? {{l4d2}} only.
:*0: No
:*1: Yes}}
{{KV|Only Local Player|intn=hint_local_player_only|boolean|since=AS|Shows the hint ''only'' to the first player to join/create the server.


=== show key bindings ===
:{{note|This keyvalue appears to have not been coded into the [[FGD]] correctly. You must put 0 for "No" and 1 for "Yes".}}}}
This is a special icon that requires setting entity property Bound Command. The following example sets Bound Command to "jump" (without quotations) with Caption set to "Bet you can't jump over me!" (without quotations).  
{{KV|Gamepad Bound Command|intn=hint_gamepad_binding|string|since=p2|If using the '''show key bindings''' setting for the '''Onscreen Icon''' or '''Offscreen Icon''', this field should be the command we want to show bindings for, when the user is using a console/non-keyboard controller of some kind (or PS3/X360).}}


[[File:Hint_017_show_key_bindings.jpg‎‎‎]]
==Inputs==
{{I|ShowHint|param=targetname|Start showing this hint. If an entity [[targetname]] is passed as the parameter, the hint is shown only to that entity.


In this case, "+jump" is bound to "SPACE", the space bar on the keyboard. More commands can be found in the Left 4 Dead 2 cfg folder. Open config.cfg in a text editor to review which commands are currently bound to the client.
:{{warning|In {{l4d2}}, hints triggered by this input are only visible to the {{ent|!activator}}.}}
:{{Workaround|A {{ent|point_template}} may be used to spawn in the desired env_instructor_hint entity; if '''Show On First Sight''' is enabled, this will cause the hint to immediately be shown to players who have line of sight to it.}}
:{{note|In {{portal2}}, you cannot display more than one hint at the same time.}}}}
{{I|EndHint|Stop showing the hint if it hasn't already timed out.}}


== See also ==
==See also==
* [[L4D2 Level Design/Instructor Hints]]
*[[L4D2 Level Design/Instructor Hints]]
*{{ent|env_hudhint}} - Similar entity used in previous Source games.
[[Category:GUI Entities]]
[[Category:Mapbase entities]]

Latest revision as of 22:35, 24 June 2025

English (en)中文 (zh)Translate (Translate)
Env instructor hint.gif

env_instructor_hint is a point entity available in all Source Source games since Left 4 Dead 2 Left 4 Dead 2. (also in Mapbase)

C++ Class hierarchy
CEnvInstructorHint
CPointEntity
CBaseEntity
C++ env_instructor_hint.cpp

It is used to instruct the player to do some things, such as not shoot teammates.

Example from Portal 2.
This example sets Bound Command to "jump" (without quotations) with Caption set to "Bet you can't jump over me!" (without quotations).

Icons

Icon Name Icon Icon Name Icon
icon_tip Icon of icon_tip, located in materials\vgui\hud\iconsheet.vtf on Left 4 Dead 2. icon_interact Icon of icon_interact, located in materials\vgui\hud\gameinstructor_iconsheet1.vtf on CS:GO.
icon_info (not in Counter-Strike: Global Offensive) Icon of icon_info, located in materials\vgui\hud\iconsheet.vtf on Left 4 Dead 2. icon_button
(blank in Counter-Strike: Global Offensive)
Icon of icon_button, located in materials\vgui\hud\iconsheet.vtf on Left 4 Dead 2.
icon_shield (not in Counter-Strike: Global Offensive) Icon of icon_shield, located in materials\vgui\hud\iconsheet.vtf on Left 4 Dead 2. icon_door Icon of icon_door, located in materials\vgui\hud\gameinstructor_iconsheet1.vtf on CS:GO.
icon_alert Icon of icon_alert, located in materials\vgui\hud\gameinstructor_iconsheet1.vtf on CS:GO. icon_arrow_plain (not in Counter-Strike: Global Offensive) Icon of icon_arrow_plain, located in materials\vgui\hud\iconsheet.vtf on Left 4 Dead 2.
icon_alert_red
icon_caution Counter-Strike: Global Offensive (blank)
Hint 005 icon alert red.jpg icon_arrow_plain_white_dn Hint 013 icon arrow plain white dn.jpg
icon_tip (again)
icon_bulb Counter-Strike: Global Offensive
Hint 006 icon tip (again).jpg icon_arrow_plain_white_up Hint 014 icon arrow plain white up.jpg
icon_skull Hint 007 icon skull.jpg icon_arrow_up Hint 015 icon arrow up.jpg
icon_no Hint 008 icon no.jpg icon_arrow_right Hint 016 icon arrow right.jpg
Note.pngNote:This entity is not limited to the icons listed above, refer to scripts/mod_textures.txt (Left 4 Dead seriesLeft 4 Dead series, Alien Swarm, Portal 2, etc.) or scripts/instructor_textures.txt (Counter-Strike: Global Offensive) located in the main 🖿pak01_dir.vpk, or on the "csgo" folder for more icon options. In CS:GO or some Source games, the icon may be blank.

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Target Entity (hint_target) <targetname>
The entity to show this hint on top of. The entity used must be one that is replicated on the client, or the hint will never show up. The info_target_instructor_hint entity is designed for this purpose, allowing the hint to be placed in empty space or parented to a specific location on another entity.
Note.pngNote:If an info_target entity is used, the spawnflag to always transmit to the client must be checked.
Positioning (hint_static) <choices>
Either show at the position of the Target Entity, or show the hint directly on the HUD at a fixed position.
  • 0: Follow the Target Entity.
  • 1: Show on the HUD.
Allow invisible target (hint_allow_nodraw_target) <choices>
Do we allow the hint to follow entities with nodraw set?
Confirm:EF_NODRAW?
  • 0: End immediately on nodraw
  • 1: Yes
Caption (hint_caption) <string>
The text of your hint. 100 character limit.
Caption Color (hint_color) <color255>
The color of the caption text.
Activator Caption (hint_activator_caption) <color255> (in all games since Alien Swarm)
The color of the caption text, as seen by the !activator.
Force caption (hint_forcecaption) <choices>
Do we show the caption text even if the hint is occluded by (hidden behind) a wall?
  • 0: No
  • 1: Show when occluded
Onscreen Icon (hint_icon_onscreen) <choices>
The icon to use when the hint is within the player's view.
Offscreen Icon (hint_icon_offscreen) <choices>
The icon to use when the hint is outside the player's view.
Show offscreen (hint_nooffscreen) <choices>
When the hint is offscreen, do we show an icon and arrow?
  • 0: Show
  • 1: Don't show
Bound Command (hint_binding) <string>
If using the use_binding setting for the Onscreen Icon or Offscreen Icon, this field should be the command we want to show bindings for. Use key_listboundkeys to see all bound keys.
Icon Height Offset (hint_icon_offset) <float>
A height offset from the Target Entity's origin to display the hint.
Size Pulsing (hint_pulseoption) <choices>
Speed for which the icon should grow and shrink, as a way to nag the player about the object.
  • 0: No Pulse
  • 1: Slow Pulse
  • 2: Fast Pulse
  • 3: Urgent Pulse
Alpha Pulsing (hint_alphaoption) <choices>
Speed for which icon will become more or less transparent.
  • 0: No Pulse
  • 1: Slow Pulse
  • 2: Fast Pulse
  • 3: Urgent Pulse
Shaking (hint_shakeoption) <choices>
The icon can shake.
  • 0: No Shaking
  • 1: Narrow Shake
  • 2: Wide Shake
Timeout (hint_timeout) <integer>
The automatic timeout for the hint. 0 will persist until stopped with EndHint.
No Fade (hint_nofadeout) <boolean> (only in The Stanley Parable)
If true, this hint won't fade out when expired.
Display Range (hint_range) <float>
The visible range of the hint. 0 will show it at any distance.
Show on First Sight (hint_auto_start) <boolean>
When the player first has LOS to the target, it will automatically show for them. Left 4 Dead 2 only.
Lesson Name (hint_name) <string>
Hints with the same lesson name use a common base and are treated as instances the same lesson type. Left 4 Dead 2 only.
Display Limit (hint_display_limit) <integer>
The number of times a hint can be seen. 0 means unlimited. Left 4 Dead 2 only.
Instance Type (hint_instance_type) <choices>
How many instances of a single lesson type can be open or active at the same time. Left 4 Dead 2 only.
  • 0: Multiple
  • 1: Single Open (Prevents new hints from opening.)
  • 2: Fixed Replace (Ends other hints when a new one is shown.)
  • 3: Single Active (Hides other hints when a new one is shown.)
Suppress rest before moving (hint_suppress_rest) <choices>
Suppress the initial icon display in center of screen? Left 4 Dead 2 only.
  • 0: No
  • 1: Yes
Only Local Player (hint_local_player_only) <boolean> (in all games since Alien Swarm)
Shows the hint only to the first player to join/create the server.
Note.pngNote:This keyvalue appears to have not been coded into the FGD correctly. You must put 0 for "No" and 1 for "Yes".
Gamepad Bound Command (hint_gamepad_binding) <string> (in all games since Portal 2)
If using the show key bindings setting for the Onscreen Icon or Offscreen Icon, this field should be the command we want to show bindings for, when the user is using a console/non-keyboard controller of some kind (or PS3/X360).

Inputs

ShowHint <targetnameRedirectInput/string>
Start showing this hint. If an entity targetname is passed as the parameter, the hint is shown only to that entity.
Warning.pngWarning:In Left 4 Dead 2, hints triggered by this input are only visible to the !activator.
PlacementTip.pngWorkaround:A point_template may be used to spawn in the desired env_instructor_hint entity; if Show On First Sight is enabled, this will cause the hint to immediately be shown to players who have line of sight to it.
Note.pngNote:In Portal 2, you cannot display more than one hint at the same time.
EndHint
Stop showing the hint if it hasn't already timed out.

See also