npc_template_maker

From Source Entities
Jump to navigation Jump to search

Present in:
Hl2.pngHL2
Hl2-episodes.pngEp1&2
Hl2dm-custom.pngHL2:DM
P1.pngPortal
Tf2.pngTF2
Asw.pngASW
P2.pngPortal 2

Code classes:

Npc maker.png

npc_template_maker is a point entity present in some Source games. It makes a clone of an NPC that's placed inside Hammer, and copies all of its properties and outputs.

Flags[edit | edit source]

  • 64: Do Not Drop - Makes the NPC fall to the ground instead of teleport to it.
  • 256: Always use radius spawn - If Radius is non-zero, the entity will spawn the NPC inside that radius.
  • 512: Don't preload template models - Does not function.

Keyvalues[edit | edit source]

Name of template NPC (TemplateName) <target_destination>
NPC to make clones of.
Radius (Radius) <float>
If Always use radius spawn is set or the SpawnNPCInRadius input is sent, the entity will try to find empty space within this radius to spawn NPCs.
Name of Destination Group (DestinationGroup) <target_destination>
Optionally, an info_npc_spawn_destination to spawn the NPCs at instead of the entity origin. If multiple info_npc_spawn_destinations of the specified name exist, the destination criteria below are used to choose which one to spawn the NPCs at.
Dest. Criterion
Visible to player? (CriterionVisibility) <choices>
If using multiple destinations of the same name, determine if the spawns should be visible to the player.
  • 0: Yes - NPCs will phase into existence right before the player's eyes.
  • 1: No - NPCs must not be visible when spawning.
  • 2: Don't care
Dest. Criterion
Distance to player? (CriterionDistance) <choices>
If using multiple destinations of the same name, determine the ideal spawn by its distance to the player.
  • 0: Nearest
  • 1: Farthest
  • 2: Don't Care
Minimum spawn distance from player (MinSpawnDistance) <integer>
If using Nearest or Farthest for Distance to player, spawns which are within this distance are considered too close.

Inputs[edit | edit source]

SpawnNPCInRadius
Spawns an NPC within Radius.
SpawnNPCInLine
Spawns NPCs together in a line. Works best when sent multiple times at once.
SpawnMultiple <integer>
Makes the specified number of NPCs all at once.
ChangeDestinationGroup <target_destination>
Sets Name of Destination Group.
SetMinimumSpawnDistance <integer>
Sets Minimum spawn distance from player.

See Also[edit | edit source]