CPointTemplate

From Source Entities
(Redirected from Point template)
Jump to navigation Jump to search

CPointTemplate is a code class in all Source games. It causes an entity or set of entities to spawn any number of times.

Classnames:

  • point_template

If an entity in the template has some dependency on one also in the template (such as I/O connections or parenting), the names used by both will automatically change to unique ones when spawned to avoid potential conflicts between multiple instances of the template. The unique names will look like this: entname&0000 with the 0000 potentially being any number. Every spawned entity can be targeted with entname*. Also note that this name changing is not done to input parameters, and the numbers assigned are not always reliable and predictable between map loads.

When activated, this entity will spawn the entities in the template at the same positions, relative to this entity, that they had when this entity was created. This will be their original positions if the point_template has not been moved.

Note: L4d2-small.pngpoint_templates that are compiled into entity groups are converted to the entity point_script_template.

Flags[edit | edit source]

  • 1: Don't remove template entities - Keeps the original entities in the map. Normally the entity assumes those ones should be deleted immediately.
  • 2: Preserve entity names (Don't do name fixup) - Makes the entity not do the name changing described above.

Keyvalues[edit | edit source]

Template 1 (Template01) to Template 16 (Template16) <target_destination>
Entities to spawn. Multiple entities can be specified in a single keyvalue by giving them identical names or by using wildcards. There doesn't seem to be a limit on how many entities can be spawned at once.

Inputs[edit | edit source]

ForceSpawn
Spawns all entities specified in the keyvalues.

Outputs[edit | edit source]

OnEntitySpawned
Fires when ForceSpawn is sent and the entities successfully spawned.

See Also[edit | edit source]