Class PointTemplate
Namespace: ValveResourceFormat.Renderer.Entities
Assembly: Renderer.dll
point_template. Spawns the entities compiled into its entity lump as a new instance each time it is told to, placed at itself or at another entity. Each instance loads a spawn group of its own, which the entities join or not as PointTemplate.SpawnGroupType says.
public sealed class PointTemplate : BaseEntityInheritance
object ← BaseEntity ← PointTemplate
Inherited Members
BaseEntity.Scene, BaseEntity.RootNode, BaseEntity.Transform, BaseEntity.RigidTransform, BaseEntity.LayerName, BaseEntity.EntitySystem, BaseEntity.Data, BaseEntity.SpawnData, BaseEntity.NameFixup, BaseEntity.SpawnGroup, BaseEntity.Classname, BaseEntity.TargetName, BaseEntity.SpawnFlags, BaseEntity.SpawnTransform, BaseEntity.Owner, BaseEntity.MoveParent, BaseEntity.EntityScale, BaseEntity.ModelName, BaseEntity.Origin, BaseEntity.Angles, BaseEntity.WorldOrigin, BaseEntity.WorldAngles, BaseEntity.Velocity, BaseEntity.AngularVelocity, BaseEntity.NextThink, BaseEntity.MoveDoneTime, BaseEntity.IsRemoved, BaseEntity.Collider, BaseEntity.IsSolid, BaseEntity.IsTrigger, BaseEntity.IsDrawn, BaseEntity.IsShown, BaseEntity.IsCollidable, BaseEntity.TouchingEntities, BaseEntity.HasSpawnFlags<TSpawnFlags>(TSpawnFlags), BaseEntity.Spawn(), BaseEntity.Activate(), BaseEntity.Think(), BaseEntity.RoundStart(), BaseEntity.MoveDone(), BaseEntity.TryGetTouchBounds(out Vector3, out Vector3), BaseEntity.ObjectCaps, BaseEntity.Use(BaseEntity?), BaseEntity.Teleport(Vector3, Vector3?), BaseEntity.AcceptInput(string, EntityInputData), BaseEntity.SetNextThink(float), BaseEntity.SetMoveDoneTime(float), BaseEntity.GetSurfaceVelocity(Vector3), BaseEntity.AngleMod(float)
Remarks
The game spawns nothing of a template when the map loads. A world spawned while stopped, as an editor shows it, spawns each template's entities once where they were authored instead, on WorldLoader.TemplateLayerName.
The template only describes an instance's spawn group: the world and entity lump to spawn, the placement, the name fixups and the owner. The SpawnGroupManager loads it and spawns the lump from the loaded world of that name, within the call, or on the next tick for an asynchronous template, then tells the template what spawned.
The entityFilterName filter is game code, so every entity of the lump spawns. Entities spawned after load are not bound to the scene's cubemaps and light probes, which are only assigned when the scene is first initialized.
Constructors
PointTemplate(EntitySystem, EntitySpawnInfo)
Initializes a point_template from its keyvalues.
public PointTemplate(EntitySystem system, EntitySpawnInfo spawnInfo)Parameters
system EntitySystem
spawnInfo EntitySpawnInfo
Properties
EntityLumpName
Gets the name of the entity lump holding the template's entities, empty when it has none.
public string EntityLumpName { get; }Property Value
string
IsAsynchronous
Gets whether the instances spawn on the tick after they load rather than within the call.
public bool IsAsynchronous { get; }Property Value
bool
SpawnGroupType
Gets which spawn group the entities of an instance join.
public PointTemplate.OwnerSpawnGroupType SpawnGroupType { get; }Property Value
PointTemplate.OwnerSpawnGroupType
SpawnedEntities
Gets what the instances spawned, gathered across them until PointTemplate.DeleteCreatedSpawnGroups(). An entity removed since drops out at the next instance.
public IReadOnlyList<BaseEntity> SpawnedEntities { get; }Property Value
WorldName
Gets the world holding the template's entity lump, such as maps/de_dust2.
public string WorldName { get; }Property Value
string
Methods
Activate()
Called once every entity of its spawn group has spawned, to resolve other entities by name.
public override void Activate()Remarks
The game spawns nothing of a template here. A stopped world shows its entities where they were authored.
DeleteCreatedSpawnGroups()
Unloads the spawn groups the instances created, with their entities. Unless the template is asynchronous, every entity in PointTemplate.SpawnedEntities is removed too. The template stays.
public void DeleteCreatedSpawnGroups()ForceSpawn()
Spawns an instance at the template, as the ForceSpawn input does.
public void ForceSpawn()OnRemove()
Called as the entity leaves the world, before its nodes leave the scene. Release anything the entity started here, such as a playing sound.
protected override void OnRemove()Remarks
Entities the instances spawned into other spawn groups stay.
Spawn()
Sets up the entity (model, class keyvalues, first think). Called by EntityFactory right after construction, before the entity enters the world.
public override void Spawn()
