File mods/spawn_usher/spawnusher.lua
Functions
spawnusher.activate (random_placement_radius, required_bubble_size, retry_time) | Activates the spawn usher system. |
spawnusher.is_air_bubble (start_pos) | Tests if the given position is an air bubble big enough. |
spawnusher.move_later (player, current_pos) | Schedules the player to be moved later. |
spawnusher.move_player (player) | Moves the player to a safe location. |
spawnusher.move_players () | Move all players that could not be placed so far. |
spawnusher.move_random (player) | Moves the player randomly on the x and z plane. |
spawnusher.on_spawn_player (player) | Callback for if a player spawns. |
Functions
- spawnusher.activate (random_placement_radius, required_bubble_size, retry_time)
-
Activates the spawn usher system.
Parameters
- random_placement_radius: Optional. The player will be respawned in the given radius around the spawn point.
- required_bubble_size: Optional. The size/height of the bubble of air that is required for the player to spawn. Defaults to 2.
- retry_time: Optional. This is the time that passes between tries to place to the player.
- spawnusher.is_air_bubble (start_pos)
-
Tests if the given position is an air bubble big enough.
Parameters
- start_pos: The position at which to check.
Return value:
true if at the given position is an air bubble big enough. - spawnusher.move_later (player, current_pos)
-
Schedules the player to be moved later. Also moves the player to the given position.
Parameters
- player: The player object.
- current_pos: The current position to which the player will be moved.
- spawnusher.move_player (player)
-
Moves the player to a safe location.
Parameters
- player: The player object.
- spawnusher.move_players ()
- Move all players that could not be placed so far.
- spawnusher.move_random (player)
-
Moves the player randomly on the x and z plane.
Parameters
- player: The Player object to move.
- spawnusher.on_spawn_player (player)
-
Callback for if a player spawns.
Parameters
- player: The Player that spawned.
Return value:
true, to disable default placement.