From Valve Developer Community
Jump to: navigation, search
Env instructor hint.gif
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).

env_instructor_hint is a point entity available in all Source games since <Left 4 Dead 2> Left 4 Dead 2. It it used to instruct the player to do some things, such as not shoot teammates.

In code, it is represented by class CEnvInstructorHint, defined in env_instructor_hint.cpp.


Icon Name Icon Icon Name Icon
icon_tip Hint 001 icon tip.jpg icon_interact Hint 009 icon interact.jpg
icon_info Hint 002 icon info.jpg icon_button Hint 010 icon button.jpg
icon_shield Hint 003 icon shield.jpg icon_door Hint 011 icon door.jpg
icon_alert Hint 004 icon alert.jpg icon_arrow_plain Hint 012 icon arrow plain.jpg
icon_alert_red Hint 005 icon alert red.jpg icon_arrow_plain_white_dn Hint 013 icon arrow plain white dn.jpg
icon_tip (again) 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.png Note: This entity is not limited to the icons listed above, refer to scripts/mod_textures.txt located in the main pak01_dir.vpk for more icon options.


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.png Note: 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?
  • 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 show key bindings 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.
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.png Note: 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).


Classname (classname) <string>
The classname defines the type of entity. Classnames can be changed using AddOutput, which will influence how the engine deals with the entity in certain circumstances.
Name (targetname) <string>
The name that other entities refer to this entity by.
Global Entity Name (globalname) <string>
Name by which this entity is linked to another entity in a different map. When the player transitions to a new map, entities in the new map with globalnames matching entities in the previous map will have the previous map's state copied over their state.
Parent (parentname) <targetname>
Specifies a movement parent. An entity will maintain its initial offset from its parent. An attachment point can be added to the end of the name, separated by a comma. Every entity can be parented, even point entities. Entities which are parented will be forced to transition to the next map, such as from a trigger_transition. Some entities which aren't intended to be parented may not function correctly. phys_constraint can be used as a workaround to parenting.
Origin (X Y Z) (origin) <coordinates>
The position of this entity's center in the world. Rotating entities typically rotate around their origin.
Pitch Yaw Roll (X Y Z) (angles) <angle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
Note.png Note: This works on brush entities, although Hammer doesn't show the new angles.
Flags (spawnflags) <integer>
Toggles features of an entity, its specific number is determined by the combination of flags added.
Response Contexts (ResponseContext) <string>
Pre-defined response system contexts for this entity. Format is key:value,key:value,.... Contexts may be filtered.
Effects (effects) <integer> !FGD
Combination of effect flags to use.
Local Time (ltime) <float> !FGD
The local time of the entity, independent of the global clock. Used mainly for physics calculations.
Next Think (nextthink) <float> !FGD
Amount of time before the entity thinks again.
Hammer ID (hammerid) <integer> !FGD
The entity's Hammer ID. Mainly used by plugins and debugging commands, such as ent_keyvalue. Can be manually assigned with the "hammerid" or "id" keyvalue. Entities spawned at run-time are not assigned any Hammer ID.
Disable for Xbox 360 (disableX360) <boolean> (in all games since <Left 4 Dead 2>) !FGD
If Yes, disables this entity on the Xbox 360 version of Source.
Entity Scripts (vscripts) <scriptlist> (in all games since <Left 4 Dead 2>)
Space delimited list of VScript files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.
Script think function (thinkfunction) <string> (in all games since <Left 4 Dead 2>)
Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call. Try to avoid expensive operations in this function, as it may cause performance problems.
Lag Compensation (LagCompensate) <boolean> (in all games since <Left 4 Dead 2>) !FGD
Set to Yes to lag compensate this entity. Should be used very sparingly!
Is Automatic-Aim Target (is_autoaim_target) <boolean> (in all games since <Counter-Strike: Global Offensive>) !FGD
If set to 1, this entity will slow down aiming movement for consoles and joystick controllers when the entity is under the crosshairs.


ShowHint <targetname>
Start showing this hint. If an entity targetname is passed as the parameter, the hint is shown only to that entity.
Bug.png Bug: In <Left 4 Dead 2>, hints triggered by this input are only visible to the !activator.
Note.png Note: In [Portal 2], you cannot display more than one hint at the same time.
Stop showing the hint if it hasn't already timed out.


Removes this entity and any entities parented to it from the world.
Functions the same as Kill, although this entity and any entities parented to it are killed on the same frame, being marginally faster than Kill.
SetParent <string>
Move with this entity. See Entity Hierarchy (parenting).
SetParentAttachment <string>
Change this entity to attach to a specific attachment point on its parent. The entity will teleport so that the position of its root bone matches that of the attachment. Entities must be parented before being sent this input.
SetParentAttachmentMaintainOffset <string>
As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.
Removes this entity from the the movement hierarchy, leaving it free to move independently.
AddOutput <string>
Evaluates a keyvalue/output on this entity.
Format: <key> <value>
Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>
FireUser1 to FireUser4
Fire the OnUser outputs; see User Inputs and Outputs.
Use  !FGD
Same as a player invoking +use; may not do anything. Can also be invoked by creating an output that does not specify an input.
This input is not included in Valve's FGDs.
DispatchEffect <string> (removed in <Left 4 Dead>) !FGD
Dispatches a special effect from the entity's origin. Removed and replaced entirely by the particle system since <Left 4 Dead>.
DispatchResponse <string> !FGD
Dispatches a response to the entity. See Response and Concept.
AddContext <string>
Adds to the entity's list of response contexts. Format is <key>:<value>.
RemoveContext <string>
Remove a context from this entity's list. The name should match the key of an existing context.
ClearContext <string>
Removes all contexts from this entity's list.
RunScriptFile <script> (in all games since <Left 4 Dead 2>)
Execute a VScript file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.
RunScriptCode <string> (in all games since <Left 4 Dead 2>)
Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console.
Bug.png Bug:  In <Left 4 Dead 2>, the code is executed in the script scope of the entity that fires the output, not the one receiving the input.
Warning.png Warning: Never try to pass string parameters to a script function with this input. It will corrupt the VMF structure because of the nested quotation marks, which then must be removed manually with a text editor.
CallScriptFunction <string> (in all games since <Left 4 Dead 2>) !FGD
Execute a VScript function in the scope of the receiving entity.
SetLocalOrigin <coordinates> (in all games since <Alien Swarm>) !FGD
Send this entity to a spot in the map. If the entity is parented to something, it will be offset from the parent by this amount.
SetLocalAngles <angles> (in all games since <Alien Swarm>) !FGD
Set this entity's angles.



OnUser1 to OnUser4
These outputs each fire in response to the firing of the like-numbered FireUser1 to FireUser4 Input; see User Inputs and Outputs.

See Also