| | |
| | | -- They can however also be used separately but with reduced efficiency due to the missing transformer. |
| | | -- Individual panels are less efficient than when the panels are combined into full arrays. |
| | | |
| | | local S = technic.getter |
| | | |
| | | minetest.register_node("technic:solar_panel", { |
| | | tiles = {"technic_solar_panel_top.png", "technic_solar_panel_bottom.png", "technic_solar_panel_side.png", |
| | | "technic_solar_panel_side.png", "technic_solar_panel_side.png", "technic_solar_panel_side.png"}, |
| | | groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, |
| | | sounds = default.node_sound_wood_defaults(), |
| | | description="Solar Panel", |
| | | description = S("Small Solar %s Generator"):format("LV"), |
| | | active = false, |
| | | drawtype = "nodebox", |
| | | paramtype = "light", |
| | |
| | | on_construct = function(pos) |
| | | local meta = minetest.get_meta(pos) |
| | | meta:set_int("LV_EU_supply", 0) |
| | | meta:set_string("infotext", "LV Solar Panel") |
| | | meta:set_string("infotext", S("Small Solar %s Generator"):format("LV")) |
| | | end, |
| | | }) |
| | | |
| | |
| | | output = 'technic:solar_panel', |
| | | recipe = { |
| | | {'technic:doped_silicon_wafer', 'technic:doped_silicon_wafer', 'technic:doped_silicon_wafer'}, |
| | | {'default:steel_ingot', 'technic:lv_cable0', 'default:steel_ingot'}, |
| | | {'technic:fine_silver_wire', 'technic:lv_cable0', 'mesecons_materials:glue'}, |
| | | |
| | | } |
| | | }) |
| | |
| | | -- To take care of some of it solar panels do not work outside daylight hours or if |
| | | -- built below -10m |
| | | local pos1 = {x=pos.x, y=pos.y+1, z=pos.z} |
| | | local machine_name = S("Small Solar %s Generator"):format("LV") |
| | | |
| | | local light = minetest.get_node_light(pos1, nil) |
| | | local time_of_day = minetest.get_timeofday() |
| | |
| | | local charge_to_give = math.floor((light + pos1.y) * 3) |
| | | charge_to_give = math.max(charge_to_give, 0) |
| | | charge_to_give = math.min(charge_to_give, 200) |
| | | meta:set_string("infotext", "Solar Panel is active ("..charge_to_give.."EU)") |
| | | meta:set_string("infotext", S("%s Active"):format(machine_name).." ("..charge_to_give.."EU)") |
| | | meta:set_int("LV_EU_supply", charge_to_give) |
| | | else |
| | | meta:set_string("infotext", "Solar Panel is inactive"); |
| | | meta:set_string("infotext", S("%s Idle"):format(machine_name)) |
| | | meta:set_int("LV_EU_supply", 0) |
| | | end |
| | | end, |