Class SpawnGroup
Namespace: ValveResourceFormat.Renderer.World
Assembly: Renderer.dll
A set of entities spawned together, which unload together. Every load makes one: the map itself, each map it places such as a 3D sky or prefab, each info_world_layer that spawns, each info_spawngroup_load_unload load and each point_template instance.
public sealed class SpawnGroupInheritance
object ← SpawnGroup
Remarks
Whoever loads a group only describes it: the world it spawns from, the entity lump, the placement, the name fixups and the owner. SpawnGroupManager.LoadSpawnGroup(SpawnGroup) loads it, and SpawnGroupManager.SynchronouslySpawnGroup(SpawnGroup) spawns it there and then, or the next tick spawns it.
A group's entities are created first, then the groups they place finish spawning, then the group spawns and activates its own entities as one batch. Unloading a group unloads its child groups first, then removes the entities it owns. A group with an SpawnGroup.Owner adds its entities to the owner instead. Once spawned, it hands its child groups to the owner and unloads, leaving nothing behind.
The manager gives a group its world before any of its entities spawn. A group that names an entity lump spawns it from the loaded world of that name. A group that spawns a whole map loads a copy of the map at the group's SpawnGroup.Transform. Only a group with SpawnGroup.HasOwnScene, such as a 3D sky, unloads the geometry and collision of that map. A group loaded into the scene of the map that placed it, such as a prefab, leaves them in that scene, so spawning the map at the same place again finds them.
Constructors
SpawnGroup(string, Scene, Matrix4x4)
Initializes a new instance of the SpawnGroup class.
public SpawnGroup(string mapName, Scene scene, Matrix4x4 transform)Parameters
mapName string
scene Scene
transform Matrix4x4
Properties
DescriptiveName
Gets what loaded the group, such as point_template or world_layer, or empty for a map.
public string DescriptiveName { get; init; }Property Value
string
Entities
Gets the keyvalues of the entities the group spawns, once it has spawned.
public IReadOnlyList<EntityLump.Entity> Entities { get; }Property Value
IReadOnlyList<EntityLump.Entity>
EntityLumpName
Gets the entity lump of the world the group spawns, such as a template's or a layer's, or null for the lumps the world spawns when it loads.
public string? EntityLumpName { get; init; }Property Value
string?
HasOwnScene
Gets whether SpawnGroup.Scene belongs to this group alone, drawn once the group spawns and released when it unloads.
public bool HasOwnScene { get; }Property Value
bool
IsLoaded
Gets whether the group is loaded, from SpawnGroupManager.LoadSpawnGroup(SpawnGroup) until it unloads.
public bool IsLoaded { get; }Property Value
bool
IsSpawned
Gets whether the group's entities have spawned.
public bool IsSpawned { get; }Property Value
bool
Layers
Gets the layers every node of the group's entities is on, such as a world layer for the entities of its entity lump.
public ImmutableArray<WorldLayer> Layers { get; }Property Value
MapName
Gets the world the group spawns from, e.g. maps/prefabs/de_dust2/de_dust2_skybox.
public string MapName { get; }Property Value
string
NameFixup
Gets what the group puts in place of the markers in its entities' names.
public EntityNameFixup NameFixup { get; init; }Property Value
Owner
Gets the group the entities join instead of this one, or null when they join this one.
public SpawnGroup? Owner { get; init; }Property Value
Scene
Gets the scene holding the group's nodes, shared with the map that placed it unless it was given one of its own.
public Scene Scene { get; }Property Value
Transform
Gets the placement of the group, already applied to everything it loaded.
public Matrix4x4 Transform { get; }Property Value
WorldGroup
Gets the world group, such as skyboxWorldGroup0 for a 3D sky, or null for the main world.
public string? WorldGroup { get; }Property Value
string?
Methods
EntityOriginToWorld(Vector3)
Maps an authored entity origin to viewer world space.
public Vector3 EntityOriginToWorld(Vector3 origin)Parameters
origin Vector3

