Npc template maker: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Robot: Automated text replacement (-\{\|\r +{| class=standard-table))
Line 23: Line 23:


* '''DestinationGroup'''
* '''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.
: <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. '''Warning:''' Using wildcards in doesn't work, and will crash the game.


* '''CriterionVisibility'''
* '''CriterionVisibility'''

Revision as of 10:17, 2 March 2009

Template:Wrongtitle Template:Base point

Entity description

Npc maker.png

Used for spawning clones of particular template NPCs when triggered, either to provide enemies for an ambush or to replace killed enemies in a standoff-type situation. For a simpler version which doesn't use template entities, see the npc_maker entity, or alternatively see the point_template entity which is more suited for spawning an entire squad into the appropriate positions.

For this to work, the target NPC must be marked as a template NPC. The easiest way to do this is to set the "Template NPC" spawnflag on the NPC.

  • See also npc_maker - simpler version which doesn't use a template NPC entity.
  • See also point_template - spawns NPCs (or other entities) in-place; can deal with up to sixteen different targetnames simultaneously, and multiple entities per targetname.

Keyvalues

  • BaseNPCMaker:
Num. of NPCs (MaxNPCCount) <integer>
Number of NPCs that will spawn before this spawner is exhausted.
Frequency (SpawnFrequency) <string>
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>
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.


  • TemplateName
<target_destination> Template NPC that this maker should be creating clones of.
  • Radius
<float> Radius around this maker within which NPCs are to be placed. Spawned NPCs will try and find empty space within this radius to spawn.
  • 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. Warning: Using wildcards in doesn't work, and will crash the game.
  • CriterionVisibility
<choices> Should the NPC try to spawn at a destination that the player can see? Only applicable if a Destination Group is being used.
Literal Value Description
0 Yes
1 No
2 Don't Care
  • CriterionDistance
<choices> Should the NPC try to spawn nearest to or farthest from the player's current location? Only applicable if a Destination Group is being used.
Literal Value Description
0 Nearest
1 Farthest
2 Don't Care
  • MinSpawnDistance (in all games since Half-Life 2: Episode One)
<integer> Minimum spawn distance from player
The spawn destination node distance to the player will have to be further or equal than this value.

Flags

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

Inputs

  • BaseNPCMaker:
Spawn
Spawns an NPC.
Toggle
Toggles the spawner enabled/disabled state.
Enable
Enables the spawner.
Disable
Disables the spawner.
AddMaxChildren <integerRedirectInput/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 <integerRedirectInput/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 won't begin spawning until it is re-enabled with the Enable input.
SetMaxLiveChildren <integerRedirectInput/integer>
Sets the maximum number of NPCs that can be alive at any one time from this spawner.
SetSpawnFrequency <floatRedirectInput/float>
Sets how often (in seconds) a new NPC will be spawned.


  • SpawnNPCInRadius
Spawn an NPC somewhere within the maker's radius.
  • SpawnNPCInLine
Spawn an NPC somewhere within a line behind the maker.
  • ChangeDestinationGroup <string>
Switch to a different set of Destination entities.
  • SetMinimumSpawnDistance <integer> (in all games since Half-Life 2: Episode One)
Set the minimum spawn distance from player to destination node.

Outputs

  • BaseNPCMaker:
OnSpawnNPC <targetname*RedirectOutput/ehandle>
Fired when an NPC is spawned. The activator is the NPC, and the string is the name of the NPC.
OnAllSpawned
Fired when the spawned is exhausted (all children have been spawned).
OnAllSpawnedDead
Fired when the spawner is exhausted (all children have been spawned) and all spawned children have died.
OnAllLiveChildrenDead
Fired when all spawned children have died. This does not mean the spawned is exhausted, so a new child may be spawned any time after this (unless the maker is disabled).