diff --git a/README.md b/README.md index 7d21f0e..841fb10 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ Note that the spawn generation is performed in the background on a timer, allowi * `rspawn.spawn_anywhere` - whether to spawn anywhere in the world at sea level * default `true` * if `false`, will randomize around the static spawn point +* `rspawn.cooldown_time` - how many seconds between two uses of `/newspawn`, per player * `rspawn.levvy_name` - name of the block to use as levvy charge on the player issuing an invitation, default `default:cobble` * `rspawn.levvy_qtty` - number of blocks to levvy from the player who issued the invitation, default `10` * `rspawn.kick_on_fail` - whether to kick the player if a randomized spawn cannot be set, default `false` @@ -77,6 +78,25 @@ Resolutions in order of best to worst: * Stop minetest, delete the `force_loaded.txt` file, and start it again * (bad - some things in the mods using the forceload mechanism may break) +## Singple Player Mode + +This mod is mainly intended for use on servers with multiple players. + +It is also suitable for single player sessions too - if you want a new location to start a creative build, but don't want to go through creating another, separate world for it, just grab yourself a new spawnpoint! + +You may want to tune the mod to suit your computer's capabilities ; to this end, the following may be helpful: + +* Add `rspawn` to your world + * Go to the *Advanced Settings* area of Minetest, look for `mods > rspawn` + * Change the frequency of pregeneration as required + * Good CPUs, enough RAM and SSD hard drives might get away with a frequency of 20sec (!) + * If you find your game immediately lagging due to excessive map generation, switch the frequency to say 120 + * Change the Cooldown time - default is `300` seconds (5 minutes) between uses of `/newspawn` + * Optionally, change the maximum pregen to the desired number of spawnpoints to pregenerate and hold +* Start the game session; Wait around 1 minute or so as the initial spawn point gets generated and is assigned to you +* Jump around! (with `/newspawn`) + * Until you exhaust your pregens :-P + ## License (C) 2017 Tai "DuCake" Kedzierski diff --git a/settingtypes.txt b/settingtypes.txt new file mode 100644 index 0000000..a04d5a5 --- /dev/null +++ b/settingtypes.txt @@ -0,0 +1,10 @@ +rspawn.debug (Debug mode) bool false +rspawn.spawn_anywhere (Spawn anywhere) bool true +rspawn.kick_on_fail (Kick on fail) bool false +rspawn.max_pregen (Maximum blocks to pregenerate) string 10 +rspawn.search_radius (Search radius) string 32 +rspawn.gen_frequency (Spawnpoint generation frequency [seconds]) 60 +rspawn.spawn_block (Node to place under new spawn point) string +rspawn.levvy_name (Levvy itemstring) string "default:cobble" +rspawn.levvy_qtty (Levvy quantity) string 10 +rspawn.cooldown_time (Cooldown between /newspawn uses) string 300 diff --git a/src/commands.lua b/src/commands.lua index 2a22cb7..7bb568e 100644 --- a/src/commands.lua +++ b/src/commands.lua @@ -1,5 +1,6 @@ local stepcount = 0 local newspawn_cooldown = {} +local cooldown_time = tonumber(minetest.settings:get("rspawn.cooldown_time")) or 300 -- Command privileges @@ -51,7 +52,7 @@ local function request_new_spawn(username, targetname) if not newspawn_cooldown[timername] then rspawn:renew_player_spawn(targetname) - newspawn_cooldown[timername] = 300 + newspawn_cooldown[timername] = cooldown_time else minetest.chat_send_player(username, tostring(math.ceil(newspawn_cooldown[timername])).."sec until you can randomize a new spawn for "..targetname) end @@ -87,6 +88,7 @@ minetest.register_chatcommand("spawn", { elseif args[1] == "original" then set_original_spawn(name) + return elseif args[1] == "invite" then if #args == 2 then