Spawning now
This call makes a spawner spawn once, right away.
Spawners spawn once, now
TriggerNow(id) asks a spawner to spawn once, right away. It returns true when the game says it spawned.
public static class Spawners
{
public static bool TriggerNow(string id);
}
| Method | Returns | What it does |
|---|---|---|
TriggerNow(id) | bool | Asks the spawner to spawn once. true when the game says it spawned. |
Things to know
TriggerNow(id)asks the spawner to spawn once and gives you the game’s answer. (it callsSpawner.TrySpawn()once and returns its result.)- The chance still applies. If the spawner’s chance is below 1, a miss returns
false. To be sure it spawns, set the chance to 1 first.
Limits
TriggerNowreturnsfalsefor an unknown id, or while a save is loading or being written.- A spawner with set locations does not spawn while the player is close to them. If the player is inside the spawner’s distance, the spawn is skipped and
TriggerNowreturnsfalse. The spawner then waits, and spawns on the next map change. A spawner with no locations does not do this check. (the check isplayerDistance. The spawner setsreadyToSpawn. ATriggerNowon a spawner withlocationswhile the player is near also re-subscribes its respawn timer, in addition to a scene reload.) TriggerNowcan returntrueeven though nothing new appeared. A spawner can say it spawned when an object already sits at that spot. A character spawner can also skip the spawn after the chance roll, when a character with that name is already in the scene or all its characters have been used. (the object case is a non-removing spawner, which returnstrueand spawns nothing when an object already sits at the location.TrySpawnreturnstrueafter the chance roll.CharacterSpawner’s authored character and spawn-point arrays are private, so they are not listed.)