Rename australia mod to outback

master
vlapsley 2017-10-11 16:49:25 +11:00
parent 7480337e7b
commit 7e361bc527
9 changed files with 123 additions and 143 deletions

View File

@ -1 +0,0 @@
A biomes/flora mod based on the continent, Australia, for Minetest 0.4.14 and valleys mapgen.

View File

@ -1,114 +0,0 @@
-- mods/australia_modpack/australia/init.lua
--[[
MOD: Australia
See README.md for licensing and other information.
Designed for Minetest 0.4.14.
--]]
-- Check for necessary mod functions and abort if they aren't available.
if not minetest.get_biome_id then
minetest.log()
minetest.log("* Not loading MOD: Australia *")
minetest.log("MOD: Australia requires mod functions which are")
minetest.log("not exposed by your Minetest build.")
minetest.log()
return
end
-- Definitions made by this mod that other mods can use too.
aus = {}
aus.path = minetest.get_modpath("australia")
--[[
Mapgen noise parameters
If you change a value here also check and, if necessary,
change the corresponding value in voxel.lua
--]]
-- Noise parameters for biome API temperature, humidity and biome blend.
aus.mg_biome_np_heat = {offset = 50, scale = 50, seed = 5349,
spread = {x = 1024, y = 1024, z = 1024}, octaves = 3, persist = 0.5, lacunarity = 2,}
aus.mg_biome_np_heat_blend = {offset = 0, scale = 1.5, seed = 13,
spread = {x = 8, y = 8, z = 8}, octaves = 2, persist = 1, lacunarity = 2,}
aus.mg_biome_np_humidity = {offset = 50, scale = 50, seed = 842,
spread = {x = 1024, y = 1024, z = 1024}, octaves = 3, persist = 0.5, lacunarity = 2,}
aus.mg_biome_np_humidity_blend = {offset = 0, scale = 1.5, seed = 90003,
spread = {x = 8, y = 8, z = 8}, octaves = 2, persist = 1, lacunarity = 2,}
-- Caves and tunnels form at the intersection of the two noises
aus.mgvalleys_np_cave1 = {offset = 0, scale = 12, seed = 52534,
spread = {x = 61, y = 61, z = 61}, octaves = 3, persist = 0.5, lacunarity = 2,}
-- Caves and tunnels form at the intersection of the two noises
aus.mgvalleys_np_cave2 = {offset = 0, scale = 12, seed = 10325,
spread = {x = 67, y = 67, z = 67}, octaves = 3, persist = 0.5, lacunarity = 2,}
-- The depth of dirt or other filler
aus.mgvalleys_np_filler_depth = {offset = 0, scale = 1.2, seed = 1605,
spread = {x = 256, y = 256, z = 256}, octaves = 3, persist = 0.5, lacunarity = 2,}
-- Massive caves form here.
aus.mgvalleys_np_massive_caves = {offset = 0, scale = 1, seed = 59033,
spread = {x = 768, y = 256, z = 768}, octaves = 6, persist = 0.63, lacunarity = 2,}
-- River noise -- rivers occur close to zero
aus.mgvalleys_np_rivers = {offset = 0, scale = 1, seed = -6050,
spread = {x = 512, y = 512, z = 512}, octaves = 5, persist = 0.6, lacunarity = 2,}
-- Base terrain height
aus.mgvalleys_np_terrain_height = {offset = -10, scale = 100, seed = 5202,
spread = {x = 1024, y = 1024, z = 1024}, octaves = 3, persist = 0.7, lacunarity = 2,}
-- Raises terrain to make valleys around the rivers
aus.mgvalleys_np_valley_depth = {offset = 3, scale = 2, seed = -1914,
spread = {x = 512, y = 512, z = 512}, octaves = 1, persist = 1, lacunarity = 2,}
-- Slope and fill work together to modify the heights
aus.mgvalleys_np_inter_valley_fill = {offset = 0, scale = 1, seed = 1993,
spread = {x = 512, y = 256, z = 512}, octaves = 6, persist = 0.8, lacunarity = 2,}
-- Amplifies the valleys
aus.mgvalleys_np_valley_profile = {offset = 0.6, scale = 0.5, seed = 777,
spread = {x = 512, y = 512, z = 512}, octaves = 4, persist = 1, lacunarity = 2,}
-- Slope and fill work together to modify the heights
aus.mgvalleys_np_inter_valley_slope = {offset = 0, scale = 1, seed = 746,
spread = {x = 256, y = 256, z = 256}, octaves = 3, persist = 0.5, lacunarity = 2,}
minetest.set_noiseparams("mg_biome_np_heat", aus.mg_biome_np_heat)
minetest.set_noiseparams("mg_biome_np_heat_blend", aus.mg_biome_np_heat_blend)
minetest.set_noiseparams("mg_biome_np_humidity", aus.mg_biome_np_humidity)
minetest.set_noiseparams("mg_biome_np_humidity_blend", aus.mg_biome_np_humidity_blend)
minetest.set_noiseparams("mgvalleys_np_cave1", aus.mgvalleys_np_cave1)
minetest.set_noiseparams("mgvalleys_np_cave2", aus.mgvalleys_np_cave2)
minetest.set_noiseparams("mgvalleys_np_filler_depth", aus.mgvalleys_np_filler_depth)
minetest.set_noiseparams("mgvalleys_np_massive_caves", aus.mgvalleys_np_massive_caves)
minetest.set_noiseparams("mgvalleys_np_rivers", aus.mgvalleys_np_rivers)
minetest.set_noiseparams("mgvalleys_np_terrain_height", aus.mgvalleys_np_terrain_height)
minetest.set_noiseparams("mgvalleys_np_valley_depth", aus.mgvalleys_np_valley_depth)
minetest.set_noiseparams("mgvalleys_np_inter_valley_fill", aus.mgvalleys_np_inter_valley_fill)
minetest.set_noiseparams("mgvalleys_np_valley_profile", aus.mgvalleys_np_valley_profile)
minetest.set_noiseparams("mgvalleys_np_inter_valley_slope", aus.mgvalleys_np_inter_valley_slope)
--[[
Mapgen settings
--]]
-- How deep to make rivers
minetest.setting_set("mgvalleys_river_depth", 5)
-- How wide to make rivers
minetest.setting_set("mgvalleys_river_size", 4)
-- Load files
dofile(aus.path .. "/functions.lua")
dofile(aus.path .. "/voxel.lua")
minetest.log("MOD: Australia 0.8 [australia] loaded...")

View File

@ -1 +0,0 @@
name = australia

View File

@ -0,0 +1 @@
This is only used to handle cases the decoration manager can't, such as trees alongside rivers, rocky beaches and salt lakes.

View File

@ -1,10 +1,11 @@
-- mods/australia_modpack/australia/functions.lua
--[[
Functions
--]]
outback.registered_on_first_mapgen = {}
aus.registered_on_first_mapgen = {}
function aus.register_on_first_mapgen(func) -- Callback
table.insert(aus.registered_on_first_mapgen, func)
function outback.register_on_first_mapgen(func) -- Callback
table.insert(outback.registered_on_first_mapgen, func)
end
local function get_content_id(value) -- get content ID recursively from a table.
@ -21,7 +22,7 @@ local function get_content_id(value) -- get content ID recursively from a table.
return value
end
aus.register_on_first_mapgen(function()
outback.register_on_first_mapgen(function()
table.sort(plants_api.registered_plants,
function(a, b)
return a.priority > b.priority
@ -49,7 +50,3 @@ function table.contains(table, element)
return false
end
function displaytime(time)
return math.floor(time * 1000000 + 0.5) / 1000 .. " ms"
end

View File

@ -0,0 +1,97 @@
--[[
Outback
--]]
-- Definitions made by this mod that other mods can use too.
outback = {}
outback.path = minetest.get_modpath("outback")
--[[
Mapgen settings
If you change a value here also check and, if necessary,
change the corresponding value in voxel.lua
--]]
-- Noise parameters for biome API temperature, humidity and biome blend.
outback.mg_biome_np_heat = {offset = 50, scale = 50, seed = 5349,
spread = {x = 1024, y = 1024, z = 1024}, octaves = 3, persist = 0.5, lacunarity = 2,}
outback.mg_biome_np_heat_blend = {offset = 0, scale = 1.5, seed = 13,
spread = {x = 8, y = 8, z = 8}, octaves = 2, persist = 1, lacunarity = 2,}
outback.mg_biome_np_humidity = {offset = 50, scale = 50, seed = 842,
spread = {x = 1024, y = 1024, z = 1024}, octaves = 3, persist = 0.5, lacunarity = 2,}
outback.mg_biome_np_humidity_blend = {offset = 0, scale = 1.5, seed = 90003,
spread = {x = 8, y = 8, z = 8}, octaves = 2, persist = 1, lacunarity = 2,}
-- Caves and tunnels form at the intersection of the two noises
outback.mgvalleys_np_cave1 = {offset = 0, scale = 12, seed = 52534,
spread = {x = 61, y = 61, z = 61}, octaves = 3, persist = 0.5, lacunarity = 2,}
-- Caves and tunnels form at the intersection of the two noises
outback.mgvalleys_np_cave2 = {offset = 0, scale = 12, seed = 10325,
spread = {x = 67, y = 67, z = 67}, octaves = 3, persist = 0.5, lacunarity = 2,}
-- The depth of dirt or other filler
outback.mgvalleys_np_filler_depth = {offset = 0, scale = 1.2, seed = 1605,
spread = {x = 256, y = 256, z = 256}, octaves = 3, persist = 0.5, lacunarity = 2,}
-- Massive caves form here.
outback.mgvalleys_np_massive_caves = {offset = 0, scale = 1, seed = 59033,
spread = {x = 768, y = 256, z = 768}, octaves = 6, persist = 0.63, lacunarity = 2,}
-- River noise -- rivers occur close to zero
outback.mgvalleys_np_rivers = {offset = 0, scale = 1, seed = -6050,
spread = {x = 512, y = 512, z = 512}, octaves = 5, persist = 0.6, lacunarity = 2,}
-- Base terrain height
outback.mgvalleys_np_terrain_height = {offset = -10, scale = 100, seed = 5202,
spread = {x = 1024, y = 1024, z = 1024}, octaves = 3, persist = 0.7, lacunarity = 2,}
-- Raises terrain to make valleys around the rivers
outback.mgvalleys_np_valley_depth = {offset = 3, scale = 2, seed = -1914,
spread = {x = 512, y = 512, z = 512}, octaves = 1, persist = 1, lacunarity = 2,}
-- Slope and fill work together to modify the heights
outback.mgvalleys_np_inter_valley_fill = {offset = 0, scale = 1, seed = 1993,
spread = {x = 512, y = 256, z = 512}, octaves = 6, persist = 0.8, lacunarity = 2,}
-- Amplifies the valleys
outback.mgvalleys_np_valley_profile = {offset = 0.6, scale = 0.5, seed = 777,
spread = {x = 512, y = 512, z = 512}, octaves = 4, persist = 1, lacunarity = 2,}
-- Slope and fill work together to modify the heights
outback.mgvalleys_np_inter_valley_slope = {offset = 0, scale = 1, seed = 746,
spread = {x = 256, y = 256, z = 256}, octaves = 3, persist = 0.5, lacunarity = 2,}
minetest.set_noiseparams("mg_biome_np_heat", outback.mg_biome_np_heat)
minetest.set_noiseparams("mg_biome_np_heat_blend", outback.mg_biome_np_heat_blend)
minetest.set_noiseparams("mg_biome_np_humidity", outback.mg_biome_np_humidity)
minetest.set_noiseparams("mg_biome_np_humidity_blend", outback.mg_biome_np_humidity_blend)
minetest.set_noiseparams("mgvalleys_np_cave1", outback.mgvalleys_np_cave1)
minetest.set_noiseparams("mgvalleys_np_cave2", outback.mgvalleys_np_cave2)
minetest.set_noiseparams("mgvalleys_np_filler_depth", outback.mgvalleys_np_filler_depth)
minetest.set_noiseparams("mgvalleys_np_massive_caves", outback.mgvalleys_np_massive_caves)
minetest.set_noiseparams("mgvalleys_np_rivers", outback.mgvalleys_np_rivers)
minetest.set_noiseparams("mgvalleys_np_terrain_height", outback.mgvalleys_np_terrain_height)
minetest.set_noiseparams("mgvalleys_np_valley_depth", outback.mgvalleys_np_valley_depth)
minetest.set_noiseparams("mgvalleys_np_inter_valley_fill", outback.mgvalleys_np_inter_valley_fill)
minetest.set_noiseparams("mgvalleys_np_valley_profile", outback.mgvalleys_np_valley_profile)
minetest.set_noiseparams("mgvalleys_np_inter_valley_slope", outback.mgvalleys_np_inter_valley_slope)
-- How deep to make rivers
minetest.setting_set("mgvalleys_river_depth", 5)
-- How wide to make rivers
minetest.setting_set("mgvalleys_river_size", 4)
--[[
Load files
--]]
dofile(outback.path .. "/functions.lua")
dofile(outback.path .. "/voxel.lua")

View File

@ -0,0 +1 @@
name = outback

View File

@ -2,7 +2,7 @@
Voxel Manipulator
This is only used to handle cases the decoration manager can't, such as
trees alongside rivers, rocky beaches, etc.
trees alongside rivers, rocky beaches and salt lakes.
--]]
-- Read the noise parameters from the actual mapgen.
@ -123,17 +123,17 @@ local function noisemap(i, minp, chulens)
end
-- List of functions to run at the end of the mapgen procedure
aus.after_mapgen = {}
outback.after_mapgen = {}
function aus.register_after_mapgen(f, ...)
table.insert(aus.after_mapgen, {f = f, ...})
function outback.register_after_mapgen(f, ...)
table.insert(outback.after_mapgen, {f = f, ...})
end
function aus.execute_after_mapgen()
for i, params in ipairs(aus.after_mapgen) do
function outback.execute_after_mapgen()
for i, params in ipairs(outback.after_mapgen) do
params.f(unpack(params))
end
aus.after_mapgen = {}
outback.after_mapgen = {}
end
local function getCppSettingNumeric(name, default)
@ -177,12 +177,12 @@ local river_size = 4 / 100
local node = {}
-- Create a table of biome ids, so I can use the biomemap.
if not aus.biome_ids then
if not outback.biome_ids then
local i
aus.biome_ids = {}
outback.biome_ids = {}
for name, desc in pairs(minetest.registered_biomes) do
i = minetest.get_biome_id(desc.name)
aus.biome_ids[i] = desc.name
outback.biome_ids[i] = desc.name
end
end
@ -190,12 +190,12 @@ local data = {}
-- THE MAPGEN FUNCTION
minetest.register_on_generated(function(minp, maxp, seed)
if aus.registered_on_first_mapgen then -- Run callbacks
for _, f in ipairs(aus.registered_on_first_mapgen) do
if outback.registered_on_first_mapgen then -- Run callbacks
for _, f in ipairs(outback.registered_on_first_mapgen) do
f()
end
aus.registered_on_first_mapgen = nil
aus.register_on_first_mapgen = nil
outback.registered_on_first_mapgen = nil
outback.register_on_first_mapgen = nil
end
-- Define content IDs
@ -274,7 +274,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
n1[i2d], n2[i2d], n3[i2d], n4[i2d], n5[i2d], n20[i2d]
-- Check for a salt lakes and rocky beaches
biome = aus.biome_ids[biomemap[i2d]]
biome = outback.biome_ids[biomemap[i2d]]
local saltlake, rocky_beach = nil
if table.contains({"simpson_desert"}, biome) and v20 > 0.8 then
@ -358,7 +358,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
valleys = valleys,
mountain_ground = mountain_ground,
slopes = slopes,
biome = aus.biome_ids[biomemap[i2d]]
biome = outback.biome_ids[biomemap[i2d]]
}
plants_api.choose_generate_plant(conditions,
{x=x,y=y+1,z=z}, data, a, ivm + ystride)
@ -369,7 +369,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
end
i2d = i2d - i2d_decrX -- Decrement the Z line previously incremented and increment by one X (1)
end
aus.execute_after_mapgen() -- Needed for some tree roots
outback.execute_after_mapgen() -- Needed for some tree roots
-- Execute voxelmanip boring stuff to write to the map...
vm:set_data(data)