Skip to main content

SpawnCommandModule

A static class in Root.Township, Alta.Console.Commands.

Console module spawn: spawns prefabs, saved-object strings and population areas in front of players. Play mode only; on simple servers needs debug_features. Spawned entities become the console selection.

Fields​

1 private and internal field
MemberWhat it is
private static Logger loggerNLog logger shared by this module and its submodules.

Methods​

MemberWhat it is
static IEnumerable<HashedItemInfo> ListPopulations()Server: spawn population-list lists all population definitions.
static NetworkEntity Spawn(NetworkPrefab prefab, int count, Chunk chunk, Vector3 position, Quaternion rotation, string[] arguments)Spawns a prefab at a position, passes arguments to its ISpawnArguments components, puts stackable counts above 1 in a pouch, sets the chunk and selects it.
static NetworkEntityInfo SpawnPopulation(Player player, PopulationDefinition population, SpawnCommandModule.PopulationType populationType = 0, float size = 5, int startingPopulation = 5, int maxPopulation = 20)Server: spawn population places a disk, sphere or directional population spawn area on the ground in front of the player and sets it up.
12 private and internal methods
MemberWhat it is
private static IEnumerable<HashedItemInfo> FindPrefab(string name)spawn find: lists command-spawnable prefabs whose name contains the text.
private static IEnumerable<NetworkEntityInfo> FindPrefabAndSpawn(PlayerList players, string name, string[] args)spawn multi: spawns every command-spawnable prefab whose name contains the text for the players.
private static IEnumerable<NetworkEntityInfo> For(PlayerList players, NetworkPrefab prefab)Server: spawn spawns a prefab 2 units in front of each player's head (or at the original spawn point with no players), passing extra arguments on.
private static IEnumerable<NetworkEntityInfo> For(PlayerList players, NetworkPrefab prefab, params string[] arguments)Server: spawn spawns a prefab 2 units in front of each player's head (or at the original spawn point with no players), passing extra arguments on.
private static IEnumerable<PrefabInfoDump> InfoDump() (iterator)Server: spawn infodump returns info for every command-spawnable prefab.
private static int ParseSpawnCount(string[] arguments)Returns the first whole-number argument of at least 1 as the spawn count, or 1.
private static NetworkEntityInfo SpawnAtPosition(Vector3 position, Vector3 rotation, NetworkPrefab prefab, params string[] arguments)Server: spawn exact spawns a prefab at a given position and Euler rotation.
private static NetworkEntity SpawnFull(NetworkPrefab prefab, int count, Vector3 position, Quaternion? rotation, params string[] arguments)Spawns a prefab at a position in the best containing location chunk. Used by the spawn commands.
private static IEnumerable<NetworkEntityInfo> SpawnLocal(NetworkPrefab prefab)spawn local (dev only): spawns a prefab unchunked on the local player's side only.
private static IEnumerable<NetworkEntityInfo> SpawnString(PlayerList players)spawn string: spawns a saved-object string (or the clipboard) 2 units in front of each player in their chunk.
private static IEnumerable<NetworkEntityInfo> SpawnString(PlayerList players, string value) (iterator)spawn string: spawns a saved-object string (or the clipboard) 2 units in front of each player in their chunk.
private static NetworkEntityInfo SpawnStringRaw(string value)spawn string-raw: spawns a saved-object string at its saved position and selects it.