Guide/Tome - Add Wind Turbine Help

~ Also fix minor wind turbine bugs and limit to 100 epu's max of power gen
~ Also add Info for simple machines and clean up icons
This commit is contained in:
Sirrobzeroone 2021-07-02 13:56:57 +10:00
parent 9ccb2becb8
commit 209b8a7596
5 changed files with 77 additions and 14 deletions

View File

@ -4,7 +4,7 @@ A new *powerful* modpack for [Minetest](http://minetest.net) 5.0.0+!
**I do not recommend using this modpack with technic, as this modpack aims to become an all new technology mod. However, compatibility might be added at a later date.** **I do not recommend using this modpack with technic, as this modpack aims to become an all new technology mod. However, compatibility might be added at a later date.**
**Depends on [fluid_lib](https://gitlab.icynet.eu/evert/fluid_lib)!** **Depends on [fluid_lib](https://github.com/sirrobzeroone/fluid_lib)!**
## Features ## Features

View File

@ -13,13 +13,19 @@ local function get_formspec_default(power, state)
end end
-- Primitive wind checking function -- Primitive wind checking function
elepm.wind_height_constant = 10 elepm.wind_height_constant = 20
function elepm.wind_check(pos) function elepm.wind_check(pos)
if pos.y < elepm.wind_height_constant then if pos.y < 10 then
return 0 return 0
end end
return math.floor(pos.y / elepm.wind_height_constant) local power = math.ceil(pos.y / elepm.wind_height_constant)
if math.floor(pos.y / elepm.wind_height_constant) > 25 then
power = 25
end
return power
end end
-- A generator that creates power using altitude -- A generator that creates power using altitude
@ -40,6 +46,7 @@ function ele.register_wind_generator(nodename, nodedef)
tube = false, tube = false,
paramtype2 = 0, paramtype2 = 0,
on_timer = function (pos, elapsed) on_timer = function (pos, elapsed)
local refresh = false local refresh = false
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
@ -72,6 +79,7 @@ function ele.register_wind_generator(nodename, nodedef)
end end
wind = elepm.wind_check(pos) * multiplier wind = elepm.wind_check(pos) * multiplier
if wind == 0 then if wind == 0 then
status = "No wind" status = "No wind"
break break
@ -105,6 +113,7 @@ function ele.register_wind_generator(nodename, nodedef)
local storage = ele.helpers.get_node_property(meta, pos, "storage") local storage = ele.helpers.get_node_property(meta, pos, "storage")
meta:set_string("formspec", get_formspec({capacity = capacity, storage = storage, usage = 0}, 0)) meta:set_string("formspec", get_formspec({capacity = capacity, storage = storage, usage = 0}, 0))
minetest.get_node_timer(pos):start(1)
end end
} }
@ -139,12 +148,11 @@ minetest.register_craftitem("elepower_machines:wind_turbine_blades", {
if minetest.get_item_group(node.name, "wind_generator") == 0 then if minetest.get_item_group(node.name, "wind_generator") == 0 then
return itemstack return itemstack
end end
local place_at = vector.add(pos, {x = 0, y = 0, z = -1}) local place_at = vector.add(pos, {x = 0, y = 0, z = -1})
local e = minetest.add_entity(place_at, "elepower_machines:wind_turbine_blades") local e = minetest.add_entity(place_at, "elepower_machines:wind_turbine_blades")
local ent = e:get_luaentity() local ent = e:get_luaentity()
ent.controller = pos ent.controller = pos
itemstack:take_item(1) itemstack:take_item(1)
return itemstack return itemstack
end end
@ -161,7 +169,6 @@ minetest.register_entity("elepower_machines:wind_turbine_blades", {
visual_size = {x = 10, y = 10}, visual_size = {x = 10, y = 10},
}, },
timer = 0, timer = 0,
controller = {x = 0, y = 0, z = 0},
wind = false, wind = false,
on_step = function (self, dt) on_step = function (self, dt)
@ -172,17 +179,27 @@ minetest.register_entity("elepower_machines:wind_turbine_blades", {
-- Wind check timer -- Wind check timer
self.timer = self.timer + 1 self.timer = self.timer + 1
if self.timer < 100 then if self.timer < 100 then
return self return self
end end
self.timer = 0 self.timer = 0
local meta = minetest.get_meta(self.controller) --controller pos always +1 z (note this can be made more robust)
if meta and meta:get_int("wind") > 0 then local controller = vector.add(self.object:get_pos(), {x = 0, y = 0, z = 1})
local c_meta = minetest.get_meta(controller)
-- check controller timer (already using onstep here so saves an extra one)
if not minetest.get_node_timer(controller):is_started() then
minetest.get_node_timer(controller):start(1)
end
if c_meta and c_meta:get_int("wind") > 0 then
self.wind = true self.wind = true
else else
self.wind = false self.wind = false
end end
end, end,
on_punch = function (self, puncher, time_from_last_punch, tool_capabilities, dir) on_punch = function (self, puncher, time_from_last_punch, tool_capabilities, dir)
local itm = ItemStack("elepower_machines:wind_turbine_blades") local itm = ItemStack("elepower_machines:wind_turbine_blades")

View File

@ -71,6 +71,13 @@ eletome.ai.powercells.over = "Powercells will charge from the network when po
-- info for (Simple/Single node) Machine page -- info for (Simple/Single node) Machine page
eletome.ai.machine = {} eletome.ai.machine = {}
eletome.ai.machine.over = "These are the simpliest machines in elepower consisting of single node "..
"that performs a single/simple function.\n"..
"The machines can often interface with other machines using fluid ducts to "..
"help automate the inputs/outputs of certain machines. Where a machine "..
"maybe more complex a small 'I' will be present on the large image, indicating "..
"there is a subpage with additional information for that machine. for example "..
"the Automatic Planter at the bottom of the opposite page."
-- info for Fluid Pump page -- info for Fluid Pump page
eletome.ai.fluid_pump = {} eletome.ai.fluid_pump = {}
@ -149,9 +156,14 @@ eletome.ai.transporter.over = "Once setup the Teleporter allows for instanaeo
eletome.ai.wind_turbine = {} eletome.ai.wind_turbine = {}
eletome.ai.wind_turbine.sort_by = "no_sort" eletome.ai.wind_turbine.sort_by = "no_sort"
eletome.ai.wind_turbine.part = {"elepower_machines:wind_turbine", eletome.ai.wind_turbine.part = {"elepower_machines:wind_turbine",
"elepower_machines:wind_turbine_blade" "elepower_machines:wind_turbine_blade",
"elepower_machines:wind_turbine_blades"
} }
eletome.ai.wind_turbine.over = "" eletome.ai.wind_turbine.over = "The wind turbine produces power from the wind. The minimum height a wind turbine will produce "..
"power is at y 10. The wind turbine will produce a small amount of power without blades, "..
"however with blades the wind turbine will produce 4x as much power.\n"..
"The higher the wind turbine is placed the more power it will produce to a maximum output of 100 EpUs."
eletome.ai.wind_turbine.img = "elepower_tome_complex_wind_turbine.png"
-- info for Fission page -- info for Fission page
eletome.ai.fission_reactor = {} eletome.ai.fission_reactor = {}
@ -632,7 +644,8 @@ eletome.ai.nodes["elepower_machines:alloy_furnace"] = {lb_top_img = "defaul
lb_btm_tt = " used per second", lb_btm_tt = " used per second",
} }
eletome.ai.nodes["elepower_machines:electrolyzer"] = {how_use_1 = "The Electrolyzer is used to create gases out of certain fluids. The electrolyzer can accept three ".. eletome.ai.nodes["elepower_machines:electrolyzer"] = {lb_top_img = "elepower_gui_icon_fluid_electrolyzer_in.png", lb_top_tt = "Fluids",
how_use_1 = "The Electrolyzer is used to create gases out of certain fluids. The electrolyzer can accept three "..
"fluids/liquids, although not at the same time - water, heavy water and biomass. The electrolyzer will ".. "fluids/liquids, although not at the same time - water, heavy water and biomass. The electrolyzer will "..
"at the cost of 128 EpUs a second break each down into different gases, see table below\n ", "at the cost of 128 EpUs a second break each down into different gases, see table below\n ",
how_use_2 = "To extract gas from the electrolyzer you will need a fluid pump, bucketeer and an empty gas canister. ".. how_use_2 = "To extract gas from the electrolyzer you will need a fluid pump, bucketeer and an empty gas canister. "..
@ -641,6 +654,9 @@ eletome.ai.nodes["elepower_machines:electrolyzer"] = {how_use_1 = "The Elec
hu_img_1 = "elepower_tome_electrolyzer_outputs.png", hu_img_1 = "elepower_tome_electrolyzer_outputs.png",
hu_img_2 = "elepower_tome_electrolyzer_assemble.png" hu_img_2 = "elepower_tome_electrolyzer_assemble.png"
} }
eletome.ai.nodes["elepower_farming:harvester"] = {lb_top_img = "farming_wheat.png",lb_top_tt = "Crops\n or\nTrees"}
eletome.ai.nodes["elepower_farming:planter"] = {lb_top_img = "farming_wheat_seed.png", eletome.ai.nodes["elepower_farming:planter"] = {lb_top_img = "farming_wheat_seed.png",
lb_top_tt = "Seeds or Seedlings", lb_top_tt = "Seeds or Seedlings",
@ -656,6 +672,36 @@ eletome.ai.nodes["elepower_farming:planter"] = {lb_top_img = "farming_wheat
hu_img_2 = "elepower_tome_complex_auto_planter_2.png" hu_img_2 = "elepower_tome_complex_auto_planter_2.png"
} }
eletome.ai.nodes["elepower_machines:canning_machine"] = {lb_top_img = "elepower_tome_icon_canning.png",lb_top_tt = "Canning"}
eletome.ai.nodes["elepower_machines:compressor"] = {lb_top_img = "elepower_tome_icon_compressing.png",lb_top_tt = "Compressing"}
eletome.ai.nodes["elepower_machines:evaporator"] = {lb_top_img = "elepower_gui_icon_fluid_water.png",lb_top_tt = "Fluids"}
eletome.ai.nodes["elepower_machines:lava_cooler"] = {lb_top_img = "elepower_gui_icon_fluid_water_lava.png",lb_top_tt = "Water\n and\nLava"}
eletome.ai.nodes["elepower_machines:furnace"] = {lb_top_img = "elepower_tome_icon_cooking.png",lb_top_tt = "Cooking"}
eletome.ai.nodes["elepower_machines:pcb_plant"] = {lb_top_img = "elepower_pcb.png",lb_top_tt = "Creates PCB's"}
eletome.ai.nodes["elepower_machines:pulverizer"] = {lb_top_img = "elepower_tome_icon_grinding.png",lb_top_tt = "Grinding"}
eletome.ai.nodes["elepower_machines:sawmill"] = {lb_top_img = "elepower_sawmill.png",lb_top_tt = "Sawing"}
eletome.ai.nodes["elepower_machines:solderer"] = {lb_top_img = "elepower_upgrade_efficiency_2.png",lb_top_tt = " Creates\n Machine Upgrades"}
eletome.ai.nodes["elepower_farming:tree_processor"] = {lb_top_img = "elepower_gui_icon_fluid_water.png",lb_top_tt = "Processes\n Tree Sap"}
-- Wind Turbine
eletome.ai.nodes["elepower_machines:wind_turbine"] = {lb_top_img = "elepower_tome_wind.png",
lb_top_tt = "Wind",
lb_btm_img = "100",
lb_btm_tt = " Epu Max\n Potential\n Production"}
eletome.ai.nodes["elepower_machines:wind_turbine_blade"] = {lb_top_img = "", lb_top_tt = "", lb_btm_img = "", lb_btm_tt =""}
eletome.ai.nodes["elepower_machines:wind_turbine_blades"] = {lb_top_img = "", lb_top_tt = "", lb_btm_img = "", lb_btm_tt =""}
-- Fluid Pump Page -- Fluid Pump Page
eletome.ai.nodes["elepower_machines:pump"] = {lb_top_img = "elepower_gui_icon_fluid_electrolyzer_in.png", lb_top_tt = "Fluid"} eletome.ai.nodes["elepower_machines:pump"] = {lb_top_img = "elepower_gui_icon_fluid_electrolyzer_in.png", lb_top_tt = "Fluid"}
eletome.ai.nodes["fluid_transfer:fluid_transfer_pump"] = {lb_top_img = "elepower_gui_icon_fluid_electrolyzer_in.png", lb_top_tt = "Fluid"} eletome.ai.nodes["fluid_transfer:fluid_transfer_pump"] = {lb_top_img = "elepower_gui_icon_fluid_electrolyzer_in.png", lb_top_tt = "Fluid"}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB