Module space_spawn
Functions for getting and spawning space spawns.
Global functions
SpaceSpawn.getFromName (name) | finds a space spawn by name |
Class SpaceSpawn
spacespawn:disable () | disables a space spawn |
spacespawn:enable () | enables a space spawn |
spacespawn:isEnabled () | checks if a spawn is enabled or disabled |
spacespawn:spawn (sysX, sysY) | spawns a new instance of this space spawn. |
Global functions
- SpaceSpawn.getFromName (name)
-
finds a space spawn by name
Parameters:
- name string the space spawn name
Returns:
-
SpaceSpawn
the space spawn, or nil if not found
Class SpaceSpawn
Functions on space spawn variables
- spacespawn:disable ()
-
disables a space spawn
Returns:
-
SpaceSpawn
the space spawn, for call chaining
- spacespawn:enable ()
-
enables a space spawn
Returns:
-
SpaceSpawn
the space spawn, for call chaining
- spacespawn:isEnabled ()
-
checks if a spawn is enabled or disabled
Returns:
-
boolean
true if the spawn is enabled, false if not
- spacespawn:spawn (sysX, sysY)
-
spawns a new instance of this space spawn.
Optional arguments allow you to specify any arbitrary system, even ones populated by planets.
If coordinates are not specified, a random location will be picked inside the range allowed by
the space spawn settings.
Parameters:
- sysX integer The system X coordinate (optional)
- sysY integer The system Y coordinate (optional)
Returns:
-
Starsystem
the system where the spawn was placed, or nil if it could not be placed.