Added setting for if the player should face a random direction.
parent
092a268363
commit
817dee24c8
12
README
12
README
|
@ -28,16 +28,20 @@ The system can be configured by adding settings to the `minetest.conf`:
|
||||||
# If the system should be activated, defaults to true.
|
# If the system should be activated, defaults to true.
|
||||||
spawnusher_activate = true
|
spawnusher_activate = true
|
||||||
|
|
||||||
# The radius around the spawnpoint in which the players will be randomly
|
|
||||||
# placed, defaults to 40.
|
|
||||||
spawnusher_placement_radius = 40.
|
|
||||||
|
|
||||||
# The size of the air bubble that is required for the player to be placed.
|
# The size of the air bubble that is required for the player to be placed.
|
||||||
# Note that this is only the vertical size, defaults to 2.
|
# Note that this is only the vertical size, defaults to 2.
|
||||||
# If you want to avoid spawns in caves, this value needs to be increased
|
# If you want to avoid spawns in caves, this value needs to be increased
|
||||||
# to a sensible value.
|
# to a sensible value.
|
||||||
spawnusher_bubble_size = 2
|
spawnusher_bubble_size = 2
|
||||||
|
|
||||||
|
# The radius around the spawnpoint in which the players will be randomly
|
||||||
|
# placed, defaults to 40.
|
||||||
|
spawnusher_placement_radius = 40.
|
||||||
|
|
||||||
|
# If the player should be rotatet so that they face a random direction
|
||||||
|
# after spawning, defaults to true.
|
||||||
|
spawnusher_random_direction = true
|
||||||
|
|
||||||
# If the player can not be placed because the block is currently not loaded,
|
# If the player can not be placed because the block is currently not loaded,
|
||||||
# this amount of time will be waited before it is retried to place
|
# this amount of time will be waited before it is retried to place
|
||||||
# place the player, defaults to 0.5.
|
# place the player, defaults to 0.5.
|
||||||
|
|
|
@ -54,6 +54,9 @@ spawnusher = {
|
||||||
--- The list of players that need to be placed.
|
--- The list of players that need to be placed.
|
||||||
players = List:new(),
|
players = List:new(),
|
||||||
|
|
||||||
|
--- If the player should be facing a random direction after spawning.
|
||||||
|
random_direction = settings.get_bool("spawnusher_random_direction", true),
|
||||||
|
|
||||||
--- The placement radius around the spawn.
|
--- The placement radius around the spawn.
|
||||||
random_placement_radius = settings.get_number("spawnusher_placement_radius", 40),
|
random_placement_radius = settings.get_number("spawnusher_placement_radius", 40),
|
||||||
|
|
||||||
|
@ -180,8 +183,10 @@ function spawnusher.move_player(player)
|
||||||
-- Awesome! Place the user here.
|
-- Awesome! Place the user here.
|
||||||
player:setpos(pos)
|
player:setpos(pos)
|
||||||
|
|
||||||
-- Randomize the direction in which the player looks.
|
if spawnusher.random_direction then
|
||||||
player:set_look_yaw(math.rad(random.next_int(0, 360)))
|
-- Randomize the direction in which the player looks.
|
||||||
|
player:set_look_yaw(math.rad(random.next_int(0, 360)))
|
||||||
|
end
|
||||||
|
|
||||||
-- Reset the physics override.
|
-- Reset the physics override.
|
||||||
player:set_physics_override(spawnusher.player_physics[player:get_player_name()])
|
player:set_physics_override(spawnusher.player_physics[player:get_player_name()])
|
||||||
|
|
Loading…
Reference in New Issue