simpify ore_chance setting

This commit is contained in:
tenplus1 2023-10-22 07:42:16 +01:00
parent e301634441
commit 8519043614
4 changed files with 5 additions and 9 deletions

View File

@ -23,7 +23,7 @@ See the comments in this file for how to adjust:
2. Whether map-generation is currently active for individual layers.
3. Whether player gravity changes for each layer (off by default).
4. Whether crafting recipes are enabled.
5. Multiply ore chance within asteroids (default is 0.0), 0.5 doubles chance, 2 halves.
5. Set the chance of finding ores in asteroids (default is 27 [0 to 100]).
Note: It is advised to turn off map-generation after you have generated the required number of asteroids.

View File

@ -17,7 +17,7 @@ local ICET = 0.05 -- Comet ice threshold
local ATMOT = -0.2 -- Comet atmosphere threshold
local FISTS = 0.01 -- Fissure noise threshold at surface. Controls size of fissures and amount / size of fissure entrances
local FISEXP = 0.3 -- Fissure expansion rate under surface
local ORECHA = 3*3*3 -- Ore 1/x chance per stone node
local ORECHA = otherworlds.settings.ore_chance.value -- Ore 1/x chance per stone node
local CPCHU = 0 -- Maximum craters per chunk
local CRMIN = 5 -- Crater radius minimum, radius includes dust and obsidian layers
local CRRAN = 8 -- Crater radius range
@ -26,10 +26,6 @@ local random = math.random
local floor = math.floor
local abs = math.abs
-- check setting for anything other than 0 and amend if needed
if otherworlds.settings.ore_chance.value ~= 0 then
ORECHA = ORECHA * otherworlds.settings.ore_chance.value
end
-- Note: for fewer large objects: increase the 'spread' numbers in 'np_large' noise parameters. For fewer small objects do the same in 'np_small'. Then tune size with 'ASCOT'
@ -199,7 +195,7 @@ function otherworlds.asteroids.create_on_generated(ymin, ymax, content_ids)
if noise1dep >= STOT or noise4dep >= STOT then
-- stone/ores
if random(ORECHA) == 2 then
if random(ORECHA) == 1 then
if nvals5[ni] > 0.6 then
data[vi] = c_goldore

View File

@ -39,5 +39,5 @@ otherworlds.settings.gravity = {
-- increase or decrease change of ores appearing in asteroids
otherworlds.settings.ore_chance = {
-- default ore chance is multiplied by following value
value = tonumber(minetest.settings:get("otherworlds.ore_chance") or 0)
value = tonumber(minetest.settings:get("otherworlds.ore_chance") or 27)
}

View File

@ -10,4 +10,4 @@ otherworlds.redsky.ymax (Redsky asteroid max height) int 7000
otherworlds.gravity (Enable gravity) bool false
otherworlds.ore_chance (Multiply ore chance by) float 0
otherworlds.ore_chance (Chance of finding ores) int 27