From 046e7d5e8c20f5ab1dc17e963419ce112f76e01e Mon Sep 17 00:00:00 2001 From: AntumDeluge Date: Thu, 1 Jun 2017 11:58:41 -0700 Subject: [PATCH] Lower spawn rate & chance --- settingtypes.txt | 7 +++---- spawn.lua | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/settingtypes.txt b/settingtypes.txt index 9c0826a..3c7b520 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -5,11 +5,10 @@ sneeker.debug (Log debug output) bool false sneeker.spawn_cap (Maximum spawns) int 25 # Sets possibility for spawn. -sneeker.spawn_chance (Spawn chance) int 2 +sneeker.spawn_chance (Spawn chance) int 1000 -# Sets frequency of spawn chance. -# Default 120 is equivalent to 2 minutes (60 * 2). -sneeker.spawn_interval (Spawn interval) int 120 +# Sets frequency of spawn chance. Default 240 is equivalent to 4 minutes (60 * 4). +sneeker.spawn_interval (Spawn interval) int 240 # Sets the maximum light that a node can have for spawn to occur. sneeker.spawn_maxlight (Max light for spawn) int 5 diff --git a/spawn.lua b/spawn.lua index 197ac6d..89476b0 100644 --- a/spawn.lua +++ b/spawn.lua @@ -6,8 +6,8 @@ local time_hr = time_min * 60 local time_day = time_hr * 24 local spawn_cap = minetest.setting_get('sneeker.spawn_cap') or 25 -- Maximum number of spawns active at one time -local spawn_chance = minetest.setting_get('sneeker.spawn_chance') or 2 -- 50% chance of spawn -local spawn_interval = minetest.setting_get('sneeker.spawn_interval') or time_min * 2 -- Default interval is 2 minutes +local spawn_chance = minetest.setting_get('sneeker.spawn_chance') or 1000 -- 1/1000 chance of spawn +local spawn_interval = minetest.setting_get('sneeker.spawn_interval') or time_min * 4 -- Default interval is 4 minutes local spawn_maxlight = minetest.setting_get('sneeker.spawn_maxlight') or 5 -- Maximum light of node for spawn local spawn_chance_percent = tostring(math.floor(1 / spawn_chance * 100)) .. '%'