From c0851059a8d9eb2bfd62229d4fd03cfe095bbf06 Mon Sep 17 00:00:00 2001 From: paramat Date: Fri, 20 May 2016 03:32:12 +0100 Subject: [PATCH] Make PV a nodebox. Add air cylinder and use in crafting recipies. Simplify localisation of noise buffers. Tune noise parameters. Remove spawn egg --- README.txt | 136 ----------------------- crafting.lua | 83 ++++++-------- init.lua | 98 +++++----------- nodes.lua | 33 ++++-- textures/moonrealm_air_cylinder.png | Bin 0 -> 261 bytes textures/moonrealm_photovoltaic_side.png | Bin 203 -> 195 bytes textures/moonrealm_photovoltaic_top.png | Bin 145 -> 134 bytes textures/moonrealm_shell.png | Bin 136 -> 0 bytes 8 files changed, 86 insertions(+), 264 deletions(-) create mode 100644 textures/moonrealm_air_cylinder.png delete mode 100644 textures/moonrealm_shell.png diff --git a/README.txt b/README.txt index a861d49..3bb4e70 100644 --- a/README.txt +++ b/README.txt @@ -2,139 +2,3 @@ moonrealm 0.10.0 by paramat For Minetest 0.4.14 or later Depends default Licenses: Code LGPL 2.1. Media CC BY-SA 3.0 - - -Crafting --------- - -Spacesuit -To avoid asphyxiation in vacuum put a spacesuit in your inventory. - -Mesetinted helmet - --C- --G- --S- - -C = default mese crystal (mese tint) -G = default glass -S = default steel ingot - - -Lifesupport backpack - -SSS -S-S -SMS - -S = default steel ingot -M = default mese block (power source) - - -Spacesuit - -WHW --L- -W-W - -W = wool white (fabric) -H = moonrealm helmet -L = moonrealm lifesupport - - -Moon stone brick x 4 - -MM -MM - -M = moon stone - - -Moon stone stair x 4 - -M -MM - -M = moon stone - - -Moon stone slab x 4 - -MM - -M = moon stone - - -Default furnace -You can cook moon dust to moonrealm glass, use mese crystal as fuel. - -MMM -M-M -MMM - -M = moon stone - - -Airgen -Place in the centre of a sealed habitat. -Will only add air to a distance of 8 nodes, if the habitat interior exceeds this -volume vacuum will remain which will then gradually spread and replace the air. - -SIS -IMI -SIS - -S = default steel ingot -I = moonrealm waterice -M = default mese block (power source) - - -Airlock with light source -Walk through it, life support air cannot pass through. - -S-S -SMS -S-S - -S = default steel ingot -M = default mese block (power source) - - -Light x 8 - -GGG -GMG -GGG - -G = moonrealm glass -M = default mese block (power source) - - -Light x 1 - -G+C - -shapeless crafting -G = moonrealm glass -C = default mese crystal (power source) - - -Default water source -Ice spawns in dust at mid to low altitudes - -I - -I = moonrealm waterice - - -Hydroponic liquid source -Hydroponic liquid will saturate the 5x5 node area of dust around it, -changing it to moonrealm soil. For growth a moonrealm sapling requires -moonrealm soil and 5x5x5 nodes of moonrealm air around it. - -LLL -LIL -LLL - -L = moonrealm appleleaf -I = moonrealm waterice diff --git a/crafting.lua b/crafting.lua index c27fa71..e87360b 100644 --- a/crafting.lua +++ b/crafting.lua @@ -3,21 +3,27 @@ minetest.register_craft({ output = "moonrealm:airlock", recipe = { - {"default:steel_ingot", "", "default:steel_ingot"}, - {"default:steel_ingot", "default:mese", "default:steel_ingot"}, - {"default:steel_ingot", "", "default:steel_ingot"}, + {"default:steel_ingot", "default:mese_crystal", "default:steel_ingot"}, + {"default:steel_ingot", "moonrealm:glass", "default:steel_ingot"}, + {"default:steel_ingot", "moonrealm:air_cylinder", "default:steel_ingot"}, }, }) minetest.register_craft({ output = "moonrealm:airgen", recipe = { - {"default:steel_ingot", "moonrealm:waterice", "default:steel_ingot"}, - {"moonrealm:waterice", "default:mese", "moonrealm:waterice"}, - {"default:steel_ingot", "moonrealm:waterice", "default:steel_ingot"}, + {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}, + {"", "moonrealm:air_cylinder", ""}, + {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}, }, }) +minetest.register_craft({ + type = "shapeless", + output = "moonrealm:airgen", + recipe = {"moonrealm:airgen_empty", "moonrealm:air_cylinder"}, +}) + minetest.register_craft({ output = "default:water_source", recipe = { @@ -42,15 +48,6 @@ minetest.register_craft({ } }) -minetest.register_craft({ - output = "default:furnace", - recipe = { - {"moonrealm:stone", "moonrealm:stone", "moonrealm:stone"}, - {"moonrealm:stone", "", "moonrealm:stone"}, - {"moonrealm:stone", "moonrealm:stone", "moonrealm:stone"}, - }, -}) - minetest.register_craft({ output = "moonrealm:stoneslab 4", recipe = { @@ -66,33 +63,6 @@ minetest.register_craft({ } }) -minetest.register_craft({ - output = "moonrealm:helmet", - recipe = { - {"default:mese_crystal"}, - {"default:glass"}, - {"default:steel_ingot"}, - } -}) - -minetest.register_craft({ - output = "moonrealm:lifesupport", - recipe = { - {"default:steel_ingot","default:steel_ingot" , "default:steel_ingot"}, - {"default:steel_ingot", "", "default:steel_ingot"}, - {"default:steel_ingot", "default:mese", "default:steel_ingot"}, - } -}) - -minetest.register_craft({ - output = "moonrealm:spacesuit", - recipe = { - {"wool:white", "moonrealm:helmet", "wool:white"}, - {"", "moonrealm:lifesupport", ""}, - {"wool:white", "", "wool:white"}, - } -}) - minetest.register_craft({ output = "moonrealm:light 8", recipe = { @@ -109,16 +79,31 @@ minetest.register_craft({ }) --- Cooking +-- Spacesuit minetest.register_craft({ - type = "cooking", - output = "moonrealm:glass", - recipe = "moonrealm:dust", + output = "moonrealm:helmet", + recipe = { + {"default:mese_crystal"}, + {"default:glass"}, + {"default:steel_ingot"}, + } }) minetest.register_craft({ - type = "fuel", - recipe = "default:mese_crystal", - burntime = 50, + output = "moonrealm:lifesupport", + recipe = { + {"default:steel_ingot","default:steel_ingot" , "default:steel_ingot"}, + {"default:steel_ingot", "moonrealm:air_cylinder", "default:steel_ingot"}, + {"default:steel_ingot", "default:mese_crystal", "default:steel_ingot"}, + } +}) + +minetest.register_craft({ + output = "moonrealm:spacesuit", + recipe = { + {"wool:white", "moonrealm:helmet", "wool:white"}, + {"", "moonrealm:lifesupport", ""}, + {"wool:white", "", "wool:white"}, + } }) diff --git a/init.lua b/init.lua index b766e5e..f959af0 100644 --- a/init.lua +++ b/init.lua @@ -26,9 +26,9 @@ local FOOT = true -- Footprints in dust local np_terrain = { offset = 0, scale = 1, - spread = {x = 512, y = 512, z = 512}, + spread = {x = 384, y = 384, z = 384}, seed = 58588900033, - octaves = 6, + octaves = 5, persist = 0.67 } @@ -37,9 +37,9 @@ local np_terrain = { local np_terralt = { offset = 0, scale = 1, - spread = {x = 414, y = 414, z = 414}, + spread = {x = 311, y = 311, z = 311}, seed = 13331930910, - octaves = 6, + octaves = 5, persist = 0.67 } @@ -48,9 +48,9 @@ local np_terralt = { local np_smooth = { offset = 0, scale = 1, - spread = {x = 828, y = 828, z = 828}, + spread = {x = 512, y = 512, z = 512}, seed = 113, - octaves = 4, + octaves = 3, persist = 0.4 } @@ -59,9 +59,9 @@ local np_smooth = { local np_fissure = { offset = 0, scale = 1, - spread = {x = 256, y = 256, z = 256}, + spread = {x = 192, y = 192, z = 192}, seed = 8181112, - octaves = 5, + octaves = 4, persist = 0.5 } @@ -93,7 +93,7 @@ local np_gradcen = { local np_terblen = { offset = 0, scale = 1, - spread = {x = 2048, y = 2048, z = 2048}, + spread = {x = 1024, y = 1024, z = 1024}, seed = -13002, octaves = 3, persist = 0.4 @@ -109,7 +109,7 @@ dofile(minetest.get_modpath("moonrealm") .. "/functions.lua") -- Set mapgen parameters -minetest.set_mapgen_params({mgname = "singlenode", water_level = -32000}) +minetest.set_mapgen_params({mgname = "singlenode", water_level = -31000}) -- Player positions, spacesuit texture status @@ -240,16 +240,16 @@ local nobj_terblen = nil local nobj_gradcen = nil --- Create noise buffers +-- Localise noise buffers -local nbuf_terrain = {} -local nbuf_terralt = {} -local nbuf_fissure = {} -local nbuf_fault = {} +local nbuf_terrain +local nbuf_terralt +local nbuf_fissure +local nbuf_fault -local nbuf_smooth = {} -local nbuf_terblen = {} -local nbuf_gradcen = {} +local nbuf_smooth +local nbuf_terblen +local nbuf_gradcen -- On generated function @@ -412,19 +412,20 @@ minetest.register_on_generated(function(minp, maxp, seed) end vm:set_data(data) - vm:set_lighting({day=0, night=0}) -- not "nolight" because mapgen does not run in all chunks + --vm:set_lighting({day=0, night=0}) vm:calc_lighting() vm:write_to_map(data) local chugent = math.ceil((os.clock() - t1) * 1000) - print ("[moonrealm] " .. chugent .. " ms") + print ("[moonrealm] chunk generation " .. chugent .. " ms") end) --- Find spawn function, dependant on chunk size of 80 nodes (TODO allow any chunksize) +-- Find spawn function, dependant on chunk size of 80 nodes +-- TODO allow any chunksize, search using 2D noises first local function moonrealm_find_spawn() - local PSCA = 16 + local PSCA = 8 local nobj_terrain = nil local nobj_terralt = nil @@ -501,7 +502,7 @@ local function moonrealm_find_spawn() -- just above ground, smooth terrain, away from faults elseif stable[si] and density < 0 and terblen == 1 and math.abs(nvals_fault[ni3d]) > 0.25 then - return {x = x, y = y + 3, z = z} + return {x = x, y = y, z = z} end ni3d = ni3d + 1 @@ -521,10 +522,8 @@ end minetest.register_on_newplayer(function(player) local spawn_pos = moonrealm_find_spawn() - local xsp = spawn_pos.x - local ysp = spawn_pos.y - local zsp = spawn_pos.z - print ("[moonrealm] spawn player (" .. xsp .. " " .. ysp .. " " .. zsp .. ")") + print ("[moonrealm] spawn new player (" .. spawn_pos.x .. " " .. + spawn_pos.y .. " " .. spawn_pos.z .. ")") player:setpos(spawn_pos) local inv = player:get_inventory() @@ -532,53 +531,16 @@ minetest.register_on_newplayer(function(player) inv:add_item("main", "default:shovel_diamond 4") inv:add_item("main", "default:axe_diamond 4") inv:add_item("main", "default:apple 64") - inv:add_item("main", "moonrealm:photovoltaic 16") - inv:add_item("main", "moonrealm:light 4") - inv:add_item("main", "moonrealm:glass 4") + inv:add_item("main", "moonrealm:photovoltaic 256") + inv:add_item("main", "moonrealm:light 16") + inv:add_item("main", "moonrealm:glass 16") inv:add_item("main", "moonrealm:storage 4") inv:add_item("main", "moonrealm:airlock 4") inv:add_item("main", "moonrealm:airgen 4") + inv:add_item("main", "moonrealm:air_cylinder 4") inv:add_item("main", "moonrealm:hlsource 4") inv:add_item("main", "moonrealm:sapling 4") inv:add_item("main", "moonrealm:spacesuit 4") - - -- create spawn egg - local vm = minetest.get_voxel_manip() - local pos1 = {x = xsp - 3, y = ysp - 3, z = zsp - 3} - local pos2 = {x = xsp + 3, y = ysp + 6, z = zsp + 3} - local emin, emax = vm:read_from_map(pos1, pos2) - local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax}) - local data = vm:get_data() - local c_shell = minetest.get_content_id("moonrealm:shell") - local c_light = minetest.get_content_id("moonrealm:light") - local c_lsair = minetest.get_content_id("moonrealm:air") - - for i = -3, 3 do - for j = -3, 6 do - for k = -3, 3 do - local vi = area:index(xsp + i, ysp + j, zsp + k) - local rad - if j <= 0 then - rad = math.sqrt(i ^ 2 + j ^ 2 + k ^ 2) - else - rad = math.sqrt(i ^ 2 + j ^ 2 * 0.3 + k ^ 2) - end - if rad <= 3.5 then - if rad >= 2.5 then - data[vi] = c_shell - elseif rad >= 1.5 then - data[vi] = c_light - else - data[vi] = c_lsair - end - end - end - end - end - - vm:set_data(data) - vm:write_to_map() - vm:update_map() end) diff --git a/nodes.lua b/nodes.lua index 201ccc9..9e5b1da 100644 --- a/nodes.lua +++ b/nodes.lua @@ -231,7 +231,8 @@ minetest.register_node("moonrealm:hlflowing", { liquid_alternative_source = "moonrealm:hlsource", liquid_viscosity = 1, post_effect_color = {a = 224, r = 115, g = 55, b = 24}, - groups = {water = 3, liquid = 3, puts_out_fire = 1}, + groups = {water = 3, liquid = 3, puts_out_fire = 1, + not_in_creative_inventory = 1}, }) minetest.register_node("moonrealm:hlsource", { @@ -287,7 +288,6 @@ minetest.register_node("moonrealm:glass", { minetest.register_node("moonrealm:sapling", { description = "Sapling", drawtype = "plantlike", - visual_scale = 1.0, tiles = {"default_sapling.png"}, inventory_image = "default_sapling.png", wield_image = "default_sapling.png", @@ -384,25 +384,35 @@ minetest.register_node("moonrealm:stonestair", { sounds = default.node_sound_stone_defaults(), }) -minetest.register_node("moonrealm:shell", { - description = "Spawn Shell", - tiles = {"moonrealm_shell.png"}, - is_ground_content = false, - groups = {dig_immediate = 3}, - drop = "", - sounds = default.node_sound_stone_defaults(), -}) - minetest.register_node("moonrealm:photovoltaic", { description = "Photovoltaic Panel", tiles = {"moonrealm_photovoltaic_top.png", "moonrealm_photovoltaic_base.png", "moonrealm_photovoltaic_side.png"}, + paramtype = "light", is_ground_content = false, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.0, 0.5}, + }, + }, groups = {dig_immediate = 3}, sounds = default.node_sound_glass_defaults(), }) +minetest.register_node("moonrealm:air_cylinder", { + description = "Air Cylinder", + drawtype = "plantlike", + tiles = {"moonrealm_air_cylinder.png"}, + paramtype = "light", + is_ground_content = false, + groups = {dig_immediate = 3}, + sounds = default.node_sound_stone_defaults(), +}) + + -- Storage local chest_formspec = @@ -468,6 +478,7 @@ minetest.register_node("moonrealm:storage", { end, }) + -- Items minetest.register_craftitem("moonrealm:spacesuit", { diff --git a/textures/moonrealm_air_cylinder.png b/textures/moonrealm_air_cylinder.png new file mode 100644 index 0000000000000000000000000000000000000000..e2484ef26f7f3abad5f0197492bb590ec05abd8d GIT binary patch literal 261 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPNs|cek^Qtu~xq(8HJY5_^EKVoSF?!0)toPvU-(U93 z%*=SRzr+;hG0e zgXEDW-_MP=TX-!F9Qa$`^(@>?jEB={)_ggK4W_=5GbA)v7PIkiGe>mzR!Veo+-%UC w6)#!*ZH}6zzE7cHs>?|q1BVj|Gu(jAJTGftr==xh19TmOr>mdKI;Vst0N;dGWdHyG literal 0 HcmV?d00001 diff --git a/textures/moonrealm_photovoltaic_side.png b/textures/moonrealm_photovoltaic_side.png index 855d68d5acaed98938ff2cea1464b6644f7d2497..5e136477f70410ac8ecd046d14b93f70b897f53f 100644 GIT binary patch delta 138 zcmV;50CoS%0mA{1L4OngAUo-VGaLW_0Afi*K~yNuV_+Bsg8?w|$k&mkVe8hdBxzte zdh{sqs*fH$%6R|&{cG2*!TDI#SzBAf6|kVmrJ1oZFfjbrPnbP>Hk=JNk%55$MMG+8 s>VIr(WPqXp*(6+mW%lgZB!vfp69b8WWDTQ!81(}V001|S7qNhVxcdMA002ovPDHLkV1iY{9_j!9 diff --git a/textures/moonrealm_shell.png b/textures/moonrealm_shell.png deleted file mode 100644 index f7d6e64137ab310aa83690d28181b9dd78f666fa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 136 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sfJyw2kQKLy2UORw7Ql2i3AsXkC|NQ@N&#c+d+2~@hDlz2n cg^LUfp}EYm^Yug*0aY=0y85}Sb4q9e0Ang4YybcN