Path corner: Difference between revisions
Jump to navigation
Jump to search
In code, it is represented by the
(-added class hierarchy, cleanup) |
m (Updated old entity format to {{this is a}}. This action was perfomed by a bot.) |
||
Line 1: | Line 1: | ||
{{lang | <!-- When this page is updated to {{langsp}} or {{language subpage}} instead of {{lang}}, please move {{this is a}} to the base page, as it is automatically translated. -->{{lang}}{{infotable | ||
|path_corner | |path_corner | ||
|img=[[Image:path_corner.png]] | |img=[[Image:path_corner.png]] | ||
Line 7: | Line 7: | ||
}} | }} | ||
{{CD|CPathCorner|file1=pathcorner.cpp}} | {{CD|CPathCorner|file1=pathcorner.cpp}} | ||
{{ | {{this is a|e0|name=path_corner}} | ||
==Entity description== | ==Entity description== | ||
Line 47: | Line 47: | ||
==Outputs== | ==Outputs== | ||
{{IO|OnPass|Fires when a path follower passes this point. {{activator|train | {{IO|OnPass|Fires when a path follower passes this point. {{activator|train}} | ||
[[Category:AI]][[Category:Entities]] | [[Category:AI]][[Category:Entities]] |
Revision as of 12:19, 4 January 2024
path_corner | |
---|---|
![]() | |
Type | Point entity |
Engine | ![]() |
Availability | In all games |
![]() |
---|
CPathCorner |
![]() |
path_corner
is an e0 available in all Source games.
Entity description
Notes
- A path_corner is a corner in a path, either for a func_train or an NPC. path_corners can be chained together to form complex routes. To create a path_corner chain simply shift+drag an existing path_corner. The values will automatically be filled in. To manually make a chain (or link one up in a circle), edit the Next stop target property.
- A path_corner_crash is identical to a path_corner, but can be enabled and disabled for a crash point; when an NPC is searching for a crash point, it will not search for generic path_corners
- The path_corner entity is !FGD for base.fgd, so it only will appear in Hammer for Half-Life 2

CPathCorner
class, defined in thepathcorner.cpp
file.
NPCs
A path_corner can be a destination for an NPC. When told to, NPCs will stop other movement and walk steadily towards a path_corner. It is entirely scripted behavior. Note that the Train Speed and wait values do not affect NPCs.
To make an NPC move to a path_corner edit the Target Path Corner keyvalue, either in Hammer or through the I/O system. Alternatively, an NPC can be made to follow a path_corner chain by using the aiscripted_schedule or scripted_sequence entities.
- See also Assaults for an alternative way to create NPC routes without using path_corner.
Limitations and bugs
- A path_corner (or the first path_corner on a chain) must be within 576 units for NPCs to find it.
- It is either difficult or impossible to tell an NPC which direction to face once they've reached a path corner. If this is important, you may want to consider using Assaults instead.
Examples
- See the apc_on_path and the npc_scanner_on_path prefabs for examples on usage.
- Download Example (VMF)
Note that the example map does not have any info_nodes. They are not needed to have an NPC follow a path.
Keyvalues
- Name (targetname) <string>[ Edit ]
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentname
ortarget
).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
- Next stop target (target) <string>
- Wait here (secs) (wait) <float>
- New train speed (speed) <float>
- Leave at zero to leave path follower's speed the same
Flags
- Wait for retrigger : [1]
- Teleport to THIS path_corner : [2]
Inputs
- SetNextPathCorner <targetname >
- Set target path_corner
Outputs
{{IO|OnPass|Fires when a path follower passes this point. (!activator is the train)