Cleanup is going to take awhile, so the site is back up but editing has been disabled.

Npc template maker

From HalfLife 2 Knowledge Base

Jump to: navigation, search

Contents

npc_template_maker

Source(core) Point Entity


description

An entity that creates NPCs. The NPCs it creates are clones of a template NPC. NPCs are spawned around this maker's origin, or at specified destination points.

The NPC that will serve as template MUST have its "Template NPC" flag ticked.

properties

  • Start Disabled StartDisabled(choices)
    1
    • 0 - No
    • 1 - Yes
  • Num. of NPCs MaxNPCCount(integer) - default: 1
    Number of NPCs that will spawn before this spawner is exhausted.
  • Frequency SpawnFrequency(string) - default: 5
    How often (in seconds) a new NPC will be spawned. If set to -1, a new NPC will be made when the last NPC dies.
  • Max Live NPCs MaxLiveChildren(integer) - default: 5
    Maximum number of live children allowed at any one time (New ones will not be made until one dies). If set to -1, no limit is applied.
  • Name of template NPC TemplateName(target_destination)
    Template NPC that this maker should be creating clones of.
  • Radius Radius(float) - default: 256
    Radius around this maker within which NPCs are to be placed. Spawned NPCs will try and find empty space within this radius to spawn.
  • Name of Destination Group DestinationGroup(target_destination)
    If you'd like spawned NPCs to be created at an info_npc_spawn_destination entity, enter the name of that entity here. If you have more than one destination entity by that name, the Destination Criteria will be used to select one from the group.
  • Dest. Criterion CriterionVisibility(Choices) - default: 2
    Visible to player?
    • 0 - Yes
    • 1 - No
    • 2 - Don't Care
  • Dest. Criterion CriterionDistance(Choices) - default: 2
    Distance to player?
    • 0 - Nearest
    • 1 - Farthest
    • 2 - Don't Care


spawn flags

  • 16: Fade Corpse - default: OFF
  • 32: Infinite Children - default: OFF
  • 64: Do Not Drop - default: OFF
  • 128: Don't Spawn While Visible - default: OFF
  • 256: Always use radius spawn - default: OFF
  • 512: Don't preload template models - default: OFF


inputs

  • Spawn(void)
    Spawns an NPC.
  • Toggle(void)
    Toggles the spawner enabled/disabled state.
  • Enable(void)
    Enables the spawner.
  • Disable(void)
    Disables the spawner.
  • AddMaxChildren(integer)
    Adds to the number of NPCs that can spawn before the spawner is exhausted. If an exhausted spawner is given some children to spawn, it still wont begin spawning until it is re-enabled with the Enable input.
  • SetMaxChildren(integer)
    Sets the number of NPCs that can spawn before the spawner is exhausted. If an exhausted spawner is given some children to spawn, it still wont begin spawning until it is re-enabled with the Enable input.
  • SetMaxLiveChildren(integer)
    Sets the maximum number of NPCs that can be alive at any one time from this spawner.
  • SetSpawnFrequency(float)
    Sets how often (in seconds) a new NPC will be spawned.


outputs

  • OnSpawnNPC(string)
    Fired when an NPC is spawned. The activator is the NPC, and the string is the name of the NPC.
  • OnAllSpawned(void)
    Fired when the spawned is exhausted (all children have been spawned).
  • OnAllSpawnedDead(void)
    Fired when the spawner is exhausted (all children have been spawned) and all spawned children have died.


related tutorials

Personal tools