point_script_template

From Valve Developer Community
Jump to: navigation, search
Info.png
This entity is not in the FGD by default .
It should not be put directly in a map because point_template already is an accessible option.
class hierarchy
CPointScriptTemplate
CPointTemplate
CLogicalEntity
CServerOnlyEntity
CBaseEntity

point_script_template is a point entity available in Left 4 Dead 2 Left 4 Dead 2. It is also available in Team Fortress 2 Team Fortress 2. It is a version of point_template readjusted to work for spawning-on-runtime, such as VScripts.

Thepoint_templateentity relies on compiled data from the map file to function properly, so trying to spawn entities with apoint_templatemade by scripts will return it having no templates and fail, even though it still can delete its own template entities.

This entity is similar to topoint_template, however it does NOT have precaching or name fixups. The number of templates is unlimited unlike point_template, although they can only be added by the AddTemplate function. See the VScript documentation for details on usage.

When compiling Entity Groups,point_template entities are converted topoint_script_template.

Vscript functions

Function Signature Description
AddTemplate void AddTemplate(string classname, handle keyvalues) Add an entity to the template spawner with the specified classnames (similar to SpawnEntityFromTable}
SetGroupSpawnTables void SetGroupSpawnTables(handle, handle) Cache the group spawn tables.

Keyvalues


Targetname:
Name (targetname) <string>
The targetname that other entities refer to this entity by.
Template 1 (Template01) to Template 16 <targetname>
Targetname(s) to search for entities to template. These can be exact matches, or wildcards (*). If multiple entities are matched, all entities will be included in the template.


Inputs

ForceSpawn
Spawn an instance of the template at the original position.


Outputs

OnEntitySpawned
Fired after spawning an instance of this template.

See also