solar plant nodes added
@ -105,5 +105,11 @@ techage.Items = {
|
|||||||
ta4_turbine = "techage:ta4_turbine",
|
ta4_turbine = "techage:ta4_turbine",
|
||||||
ta4_generator = "techage:ta4_generator",
|
ta4_generator = "techage:ta4_generator",
|
||||||
ta4_heatexchanger = "techage:heatexchanger3",
|
ta4_heatexchanger = "techage:heatexchanger3",
|
||||||
|
ta4_powercable = "techage:ta4_power_cableS",
|
||||||
|
ta4_powerbox = "techage:ta4_power_box",
|
||||||
|
ta4_solarmodule = "techage:ta4_solar_module",
|
||||||
|
ta4_solarcarrier = "techage:ta4_solar_carrier",
|
||||||
|
ta4_solar_inverter = "techage:ta4_solar_inverter",
|
||||||
|
techage_ta4_solar = "techage_ta4_solar.png",
|
||||||
--ta4_ "",
|
--ta4_ "",
|
||||||
}
|
}
|
||||||
|
@ -99,6 +99,11 @@ techage.manual_DE.aTitel = {
|
|||||||
"3,TA4 Wind Turbine Signal Lamp",
|
"3,TA4 Wind Turbine Signal Lamp",
|
||||||
"3,TA4 Säule / Pillar",
|
"3,TA4 Säule / Pillar",
|
||||||
"2,Solaranlage",
|
"2,Solaranlage",
|
||||||
|
"3,TA4 Solarmodul / Solar Module",
|
||||||
|
"3,TA4 Solar Trägermodul / Carrier Module",
|
||||||
|
"3,TA4 Solar Wechselrichter / Solar Inverter",
|
||||||
|
"3,TA4 Niederspannungskabel / Low Power Cable",
|
||||||
|
"3,TA4 Niederspannungsverteilerbox / Low Power Box",
|
||||||
"3,TA4 Straßenlampen-Solarzelle / Streetlamp Solar Cell",
|
"3,TA4 Straßenlampen-Solarzelle / Streetlamp Solar Cell",
|
||||||
"2,Biogasanlage",
|
"2,Biogasanlage",
|
||||||
"2,Energiespeicher",
|
"2,Energiespeicher",
|
||||||
@ -783,11 +788,58 @@ techage.manual_DE.aText = {
|
|||||||
"\n"..
|
"\n"..
|
||||||
"\n"..
|
"\n"..
|
||||||
"\n",
|
"\n",
|
||||||
"Diese glänzt noch durch Abwesenheit.\n"..
|
"Die Solaranlage produziert nur Strom\\, wenn die Sonne scheint. Im Spiel ist das jeder Spieltag von morgens 6:00 bis abends 18:00.\n"..
|
||||||
"Aber es gibt schon die...\n"..
|
"In dieser Zeit steht immer die gleiche Leistung zur Verfügung. Nach 18:00 schalten die Solarmodule komplett ab.\n"..
|
||||||
|
"\n"..
|
||||||
|
"Für die Leistung der Solarmodule ist die Biome Temperatur entscheidend. Je heißer die Temperatur\\, um so höher der Ertrag.\n"..
|
||||||
|
"Die Biome Temperatur kann mit dem Techage Info Tool (Schraubenschlüssel) bestimmt werden. Sie schwankt typischerweise zwischen 0 und 100:\n"..
|
||||||
|
"\n"..
|
||||||
|
" - bei 100 steht die volle Leistung zur Verfügung\n"..
|
||||||
|
" - bei 50 steht die halbe Leistung zur Verfügung\n"..
|
||||||
|
" - bei 0 steht keine Leistung zur Verfügung\n"..
|
||||||
|
"\n"..
|
||||||
|
"Es empfiehlt sich daher\\, nach heißen Steppen und Wüsten für die Solaranlage Ausschau zu halten.\n"..
|
||||||
|
"Für den Stromtransport stehen die Überlandleitungen zur Verfügung.\n"..
|
||||||
|
"Es kann aber auch Wasserstoff produziert werden\\, welcher sich transportieren und am Ziel wieder zu Strom umwandeln lässt (geplant).\n"..
|
||||||
|
"\n"..
|
||||||
|
"Die kleinste Einheit bei einer Solaranlage sind zwei Solarmodule und ein Trägermodul. Das Trägermodul muss zuerst gesetzt werden\\, die zwei Solarmodule dann links und rechts daneben.\n"..
|
||||||
|
"\n"..
|
||||||
|
"Solarmodule liefern Gleichspannung\\, welcher nicht direkt in das Stromnetz eingespeist werden kann. Daher müssen zuerst die Solareinheiten über das rote Kabel mit dem Wechselrichter verbunden werden. Dieser hat zwei Anschlussseiten\\, eine für das rote Kabel zu den Solarmodulen und eine für das graue Stromkabel ins Stromnetz.\n"..
|
||||||
|
"\n"..
|
||||||
|
"Der Kartenbereich\\, wo die Solaranlage steht\\, muss komplett geladen sein. Es empfiehlt sich daher\\, zuerst einen Forceload Block zu setzen\\, und dann innerhalb dieses Bereiches die Module zu platzieren.\n"..
|
||||||
|
"\n"..
|
||||||
|
"\n"..
|
||||||
|
"\n",
|
||||||
|
"Das Solarmodul muss an das Trägermodul gesetzt werden. Es sind immer zwei Solarmodule notwendig.\n"..
|
||||||
|
"Im Paar leisten die Solarmodule bis 4 ku\\, je nach Temperatur.\n"..
|
||||||
|
"Bei den Solarmodul muss darauf geachtet werden\\, dass diese das volle Tageslicht haben und nicht durch Blöcke oder Bäume beschattet sind.\n"..
|
||||||
|
"\n"..
|
||||||
|
"\n"..
|
||||||
|
"\n",
|
||||||
|
"Das Trägermodul gibt es in zwei Bauhöhen (1m und 2m). Funktionell sind beide identisch.\n"..
|
||||||
|
"Die Trägermodule können direkt aneinander gesetzt und so zu einer Modulreihe verbunden werden. Die Verbindung zum Wechselrichter oder zu anderen Modulreihen muss mit den roten Niederspannungskabeln bzw. den Niederspannungsverteilerboxen hergestellt werden.\n"..
|
||||||
|
"\n"..
|
||||||
|
"\n"..
|
||||||
|
"\n",
|
||||||
|
"Der Wechselrichter wandelt den Solarstrom (DC) in Wechselstrom (AC) um\\, so dass dieser in das Stromnetz eingespeist werden kann.\n"..
|
||||||
|
"Ein Wechselrichter kann maximal 120 ku an Strom einspeisen\\, was 30 Solarmodulen oder auch mehr entspricht.\n"..
|
||||||
|
"\n"..
|
||||||
|
"\n"..
|
||||||
|
"\n",
|
||||||
|
"Das Niederspannungskabel dient zur Verbindung von Solar-Modulreihen mit dem Wechselrichter. Das Kabel darf nicht für andere Zwecke benutzt werden.\n"..
|
||||||
|
"\n"..
|
||||||
|
"Die maximale Leitungslänge beträgt 200 m.\n"..
|
||||||
|
"\n"..
|
||||||
|
"\n"..
|
||||||
|
"\n",
|
||||||
|
"Die Verteilerbox muss auf den Boden gesetzt werden. Sie besitzt nur 4 Anschlüsse (in die 4 Himmelsrichtungen).\n"..
|
||||||
|
"\n"..
|
||||||
|
"\n"..
|
||||||
"\n",
|
"\n",
|
||||||
"Die Straßenlampen-Solarzelle dient\\, wie der Name schon sagt\\, zur Stromversorgung einer Straßenlampe. Dabei kann eine Solarzelle zwei Lampen versorgen. Die Solarzelle speichert die Sonnenenergie tagsüber und gibt den Strom Nachts an die Lampe ab. Das bedeutet\\, die Lampe leuchtet nur im Dunkeln.\n"..
|
"Die Straßenlampen-Solarzelle dient\\, wie der Name schon sagt\\, zur Stromversorgung einer Straßenlampe. Dabei kann eine Solarzelle zwei Lampen versorgen. Die Solarzelle speichert die Sonnenenergie tagsüber und gibt den Strom Nachts an die Lampe ab. Das bedeutet\\, die Lampe leuchtet nur im Dunkeln.\n"..
|
||||||
"\n"..
|
"\n"..
|
||||||
|
"Diese Solarzelle kann nicht mit den anderen Solarmodulen kombiniert werden.\n"..
|
||||||
|
"\n"..
|
||||||
"\n"..
|
"\n"..
|
||||||
"\n",
|
"\n",
|
||||||
"noch nicht vorhanden...\n"..
|
"noch nicht vorhanden...\n"..
|
||||||
@ -928,7 +980,12 @@ techage.manual_DE.aItemName = {
|
|||||||
"ta4_nacelle",
|
"ta4_nacelle",
|
||||||
"ta4_blinklamp",
|
"ta4_blinklamp",
|
||||||
"ta4_pillar",
|
"ta4_pillar",
|
||||||
"",
|
"techage_ta4_solar",
|
||||||
|
"ta4_solarmodule",
|
||||||
|
"ta4_solarcarrier",
|
||||||
|
"ta4_solar_inverter",
|
||||||
|
"ta4_powercable",
|
||||||
|
"ta4_powerbox",
|
||||||
"ta4_minicell",
|
"ta4_minicell",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
@ -1039,6 +1096,11 @@ techage.manual_DE.aPlanTable = {
|
|||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
"ta4_storagesystem",
|
"ta4_storagesystem",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
|
1
i18n.py
@ -8,6 +8,7 @@
|
|||||||
#
|
#
|
||||||
# Copy the script into the mod root folder and adapt the last code lines to you needs.
|
# Copy the script into the mod root folder and adapt the last code lines to you needs.
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
import os, fnmatch, re, shutil
|
import os, fnmatch, re, shutil
|
||||||
|
|
||||||
pattern_lua = re.compile(r'[ \.=^\t]S\("(.+?)"\)', re.DOTALL)
|
pattern_lua = re.compile(r'[ \.=^\t]S\("(.+?)"\)', re.DOTALL)
|
||||||
|
BIN
images/solar_plant.png
Normal file
After Width: | Height: | Size: 452 KiB |
6
init.lua
@ -22,7 +22,7 @@ else
|
|||||||
-- Debugging via "techage.Debug.dbg(text)"
|
-- Debugging via "techage.Debug.dbg(text)"
|
||||||
techage.Debug = {
|
techage.Debug = {
|
||||||
dbg = function(text, ...)
|
dbg = function(text, ...)
|
||||||
local t = string.format("%.4f %4s: ", minetest.get_us_time() / 1000000.0, topic)
|
local t = string.format("%.4f: ", minetest.get_us_time() / 1000000.0)
|
||||||
if type(text) ~= "string" then
|
if type(text) ~= "string" then
|
||||||
text = dump(text)
|
text = dump(text)
|
||||||
end
|
end
|
||||||
@ -34,6 +34,7 @@ else
|
|||||||
--dbg2 = true,
|
--dbg2 = true,
|
||||||
--tst = true,
|
--tst = true,
|
||||||
--bot = true -- Signs Bot
|
--bot = true -- Signs Bot
|
||||||
|
--slr = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Basis features
|
-- Basis features
|
||||||
@ -71,6 +72,7 @@ else
|
|||||||
dofile(MP.."/power/protection.lua")
|
dofile(MP.."/power/protection.lua")
|
||||||
dofile(MP.."/power/ta4_pipe.lua")
|
dofile(MP.."/power/ta4_pipe.lua")
|
||||||
dofile(MP.."/power/ta4_junction.lua")
|
dofile(MP.."/power/ta4_junction.lua")
|
||||||
|
dofile(MP.."/power/ta4_cable.lua")
|
||||||
|
|
||||||
-- Iron Age
|
-- Iron Age
|
||||||
dofile(MP.."/iron_age/main.lua")
|
dofile(MP.."/iron_age/main.lua")
|
||||||
@ -183,6 +185,8 @@ else
|
|||||||
-- Solar
|
-- Solar
|
||||||
dofile(MP.."/nodes/silicon.lua")
|
dofile(MP.."/nodes/silicon.lua")
|
||||||
dofile(MP.."/solar/minicell.lua")
|
dofile(MP.."/solar/minicell.lua")
|
||||||
|
dofile(MP.."/solar/solarcell.lua")
|
||||||
|
dofile(MP.."/solar/inverter.lua")
|
||||||
|
|
||||||
-- Wind
|
-- Wind
|
||||||
dofile(MP.."/wind_turbine/rotor.lua")
|
dofile(MP.."/wind_turbine/rotor.lua")
|
||||||
|
@ -162,12 +162,19 @@ TA4 Heat Exchanger 1=TA4 Wärmetauscher 1
|
|||||||
TA4 Heat Exchanger 2=TA4 Wärmetauscher 2
|
TA4 Heat Exchanger 2=TA4 Wärmetauscher 2
|
||||||
TA4 Heat Exchanger 3=TA4 Wärmetauscher 3
|
TA4 Heat Exchanger 3=TA4 Wärmetauscher 3
|
||||||
TA4 Junction Pipe=TA4 Verbindungsrohr
|
TA4 Junction Pipe=TA4 Verbindungsrohr
|
||||||
|
TA4 Low Power Box==TA4 Niederspannungsverteilerbox
|
||||||
|
TA4 Low Power Cable=TA4 Niederspannungskabel
|
||||||
TA4 Pillar=TA4 Säule
|
TA4 Pillar=TA4 Säule
|
||||||
TA4 Pipe=TA4 Röhre
|
TA4 Pipe=TA4 Röhre
|
||||||
TA4 Pipe Inlet=TA4 Rohrzulauf
|
TA4 Pipe Inlet=TA4 Rohrzulauf
|
||||||
TA4 Protected Chest=TA4 Gesicherte Kiste
|
TA4 Protected Chest=TA4 Gesicherte Kiste
|
||||||
TA4 Rotor Blade=TA4 Rotorblatt
|
TA4 Rotor Blade=TA4 Rotorblatt
|
||||||
TA4 Silicon Wafer=TA4 Silizium-Wafer
|
TA4 Silicon Wafer=TA4 Silizium-Wafer
|
||||||
|
TA4 Solar Carrier Module=TA4 Solar Trägermodul
|
||||||
|
TA4 Solar Carrier Module B=TA4 Solar Trägermodul U
|
||||||
|
TA4 Solar Carrier Module T=TA4 Solar Trägermodul O
|
||||||
|
TA4 Solar Inverter=TA4 Solar Wechselrichter
|
||||||
|
TA4 Solar Module=TA4 Solarmodul
|
||||||
TA4 Streetlamp Solar Cell=TA4 Straßenlampen-Solarzelle
|
TA4 Streetlamp Solar Cell=TA4 Straßenlampen-Solarzelle
|
||||||
TA4 Turbine=TA4 Turbine
|
TA4 Turbine=TA4 Turbine
|
||||||
TA4 WLAN Chip=TA4 WLAN Chip
|
TA4 WLAN Chip=TA4 WLAN Chip
|
||||||
|
@ -160,12 +160,19 @@ TA4 Heat Exchanger 1=
|
|||||||
TA4 Heat Exchanger 2=
|
TA4 Heat Exchanger 2=
|
||||||
TA4 Heat Exchanger 3=
|
TA4 Heat Exchanger 3=
|
||||||
TA4 Junction Pipe=
|
TA4 Junction Pipe=
|
||||||
|
TA4 Low Power Box=
|
||||||
|
TA4 Low Power Cable=
|
||||||
TA4 Pillar=
|
TA4 Pillar=
|
||||||
TA4 Pipe=
|
TA4 Pipe=
|
||||||
TA4 Pipe Inlet=
|
TA4 Pipe Inlet=
|
||||||
TA4 Protected Chest=
|
TA4 Protected Chest=
|
||||||
TA4 Rotor Blade=
|
TA4 Rotor Blade=
|
||||||
TA4 Silicon Wafer=
|
TA4 Silicon Wafer=
|
||||||
|
TA4 Solar Carrier Module=
|
||||||
|
TA4 Solar Carrier Module B=
|
||||||
|
TA4 Solar Carrier Module T=
|
||||||
|
TA4 Solar Inverter=
|
||||||
|
TA4 Solar Module=
|
||||||
TA4 Streetlamp Solar Cell=
|
TA4 Streetlamp Solar Cell=
|
||||||
TA4 Turbine=
|
TA4 Turbine=
|
||||||
TA4 WLAN Chip=
|
TA4 WLAN Chip=
|
||||||
|
@ -50,13 +50,75 @@ Damit wird der Mast für die Windkraftanlage gebaut. Allerdings werden diese Bl
|
|||||||
|
|
||||||
## Solaranlage
|
## Solaranlage
|
||||||
|
|
||||||
Diese glänzt noch durch Abwesenheit.
|
Die Solaranlage produziert nur Strom, wenn die Sonne scheint. Im Spiel ist das jeder Spieltag von morgens 6:00 bis abends 18:00.
|
||||||
Aber es gibt schon die...
|
In dieser Zeit steht immer die gleiche Leistung zur Verfügung. Nach 18:00 schalten die Solarmodule komplett ab.
|
||||||
|
|
||||||
|
Für die Leistung der Solarmodule ist die Biome Temperatur entscheidend. Je heißer die Temperatur, um so höher der Ertrag.
|
||||||
|
Die Biome Temperatur kann mit dem Techage Info Tool (Schraubenschlüssel) bestimmt werden. Sie schwankt typischerweise zwischen 0 und 100:
|
||||||
|
- bei 100 steht die volle Leistung zur Verfügung
|
||||||
|
- bei 50 steht die halbe Leistung zur Verfügung
|
||||||
|
- bei 0 steht keine Leistung zur Verfügung
|
||||||
|
|
||||||
|
Es empfiehlt sich daher, nach heißen Steppen und Wüsten für die Solaranlage Ausschau zu halten.
|
||||||
|
Für den Stromtransport stehen die Überlandleitungen zur Verfügung.
|
||||||
|
Es kann aber auch Wasserstoff produziert werden, welcher sich transportieren und am Ziel wieder zu Strom umwandeln lässt (geplant).
|
||||||
|
|
||||||
|
Die kleinste Einheit bei einer Solaranlage sind zwei Solarmodule und ein Trägermodul. Das Trägermodul muss zuerst gesetzt werden, die zwei Solarmodule dann links und rechts daneben.
|
||||||
|
|
||||||
|
Solarmodule liefern Gleichspannung, welcher nicht direkt in das Stromnetz eingespeist werden kann. Daher müssen zuerst die Solareinheiten über das rote Kabel mit dem Wechselrichter verbunden werden. Dieser hat zwei Anschlussseiten, eine für das rote Kabel zu den Solarmodulen und eine für das graue Stromkabel ins Stromnetz.
|
||||||
|
|
||||||
|
Der Kartenbereich, wo die Solaranlage steht, muss komplett geladen sein. Es empfiehlt sich daher, zuerst einen Forceload Block zu setzen, und dann innerhalb dieses Bereiches die Module zu platzieren.
|
||||||
|
|
||||||
|
[techage_ta4_solar|image]
|
||||||
|
|
||||||
|
|
||||||
|
### TA4 Solarmodul / Solar Module
|
||||||
|
|
||||||
|
Das Solarmodul muss an das Trägermodul gesetzt werden. Es sind immer zwei Solarmodule notwendig.
|
||||||
|
Im Paar leisten die Solarmodule bis 4 ku, je nach Temperatur.
|
||||||
|
Bei den Solarmodul muss darauf geachtet werden, dass diese das volle Tageslicht haben und nicht durch Blöcke oder Bäume beschattet sind.
|
||||||
|
|
||||||
|
[ta4_solarmodule|image]
|
||||||
|
|
||||||
|
|
||||||
|
### TA4 Solar Trägermodul / Carrier Module
|
||||||
|
|
||||||
|
Das Trägermodul gibt es in zwei Bauhöhen (1m und 2m). Funktionell sind beide identisch.
|
||||||
|
Die Trägermodule können direkt aneinander gesetzt und so zu einer Modulreihe verbunden werden. Die Verbindung zum Wechselrichter oder zu anderen Modulreihen muss mit den roten Niederspannungskabeln bzw. den Niederspannungsverteilerboxen hergestellt werden.
|
||||||
|
|
||||||
|
[ta4_solarcarrier|image]
|
||||||
|
|
||||||
|
|
||||||
|
### TA4 Solar Wechselrichter / Solar Inverter
|
||||||
|
|
||||||
|
Der Wechselrichter wandelt den Solarstrom (DC) in Wechselstrom (AC) um, so dass dieser in das Stromnetz eingespeist werden kann.
|
||||||
|
Ein Wechselrichter kann maximal 120 ku an Strom einspeisen, was 30 Solarmodulen oder auch mehr entspricht.
|
||||||
|
|
||||||
|
[ta4_solar_inverter|image]
|
||||||
|
|
||||||
|
|
||||||
|
### TA4 Niederspannungskabel / Low Power Cable
|
||||||
|
|
||||||
|
Das Niederspannungskabel dient zur Verbindung von Solar-Modulreihen mit dem Wechselrichter. Das Kabel darf nicht für andere Zwecke benutzt werden.
|
||||||
|
|
||||||
|
Die maximale Leitungslänge beträgt 200 m.
|
||||||
|
|
||||||
|
[ta4_powercable|image]
|
||||||
|
|
||||||
|
|
||||||
|
### TA4 Niederspannungsverteilerbox / Low Power Box
|
||||||
|
|
||||||
|
Die Verteilerbox muss auf den Boden gesetzt werden. Sie besitzt nur 4 Anschlüsse (in die 4 Himmelsrichtungen).
|
||||||
|
|
||||||
|
[ta4_powerbox|image]
|
||||||
|
|
||||||
|
|
||||||
### TA4 Straßenlampen-Solarzelle / Streetlamp Solar Cell
|
### TA4 Straßenlampen-Solarzelle / Streetlamp Solar Cell
|
||||||
|
|
||||||
Die Straßenlampen-Solarzelle dient, wie der Name schon sagt, zur Stromversorgung einer Straßenlampe. Dabei kann eine Solarzelle zwei Lampen versorgen. Die Solarzelle speichert die Sonnenenergie tagsüber und gibt den Strom Nachts an die Lampe ab. Das bedeutet, die Lampe leuchtet nur im Dunkeln.
|
Die Straßenlampen-Solarzelle dient, wie der Name schon sagt, zur Stromversorgung einer Straßenlampe. Dabei kann eine Solarzelle zwei Lampen versorgen. Die Solarzelle speichert die Sonnenenergie tagsüber und gibt den Strom Nachts an die Lampe ab. Das bedeutet, die Lampe leuchtet nur im Dunkeln.
|
||||||
|
|
||||||
|
Diese Solarzelle kann nicht mit den anderen Solarmodulen kombiniert werden.
|
||||||
|
|
||||||
[ta4_minicell|image]
|
[ta4_minicell|image]
|
||||||
|
|
||||||
|
|
||||||
|
@ -98,6 +98,11 @@
|
|||||||
- [TA4 Wind Turbine Signal Lamp](./manual_ta4_DE.md#ta4-wind-turbine-signal-lamp)
|
- [TA4 Wind Turbine Signal Lamp](./manual_ta4_DE.md#ta4-wind-turbine-signal-lamp)
|
||||||
- [TA4 Säule / Pillar](./manual_ta4_DE.md#ta4-säule--pillar)
|
- [TA4 Säule / Pillar](./manual_ta4_DE.md#ta4-säule--pillar)
|
||||||
- [Solaranlage](./manual_ta4_DE.md#solaranlage)
|
- [Solaranlage](./manual_ta4_DE.md#solaranlage)
|
||||||
|
- [TA4 Solarmodul / Solar Module](./manual_ta4_DE.md#ta4-solarmodul--solar-module)
|
||||||
|
- [TA4 Solar Trägermodul / Carrier Module](./manual_ta4_DE.md#ta4-solar-trägermodul--carrier-module)
|
||||||
|
- [TA4 Solar Wechselrichter / Solar Inverter](./manual_ta4_DE.md#ta4-solar-wechselrichter--solar-inverter)
|
||||||
|
- [TA4 Niederspannungskabel / Low Power Cable](./manual_ta4_DE.md#ta4-niederspannungskabel--low-power-cable)
|
||||||
|
- [TA4 Niederspannungsverteilerbox / Low Power Box](./manual_ta4_DE.md#ta4-niederspannungsverteilerbox--low-power-box)
|
||||||
- [TA4 Straßenlampen-Solarzelle / Streetlamp Solar Cell](./manual_ta4_DE.md#ta4-straßenlampen-solarzelle--streetlamp-solar-cell)
|
- [TA4 Straßenlampen-Solarzelle / Streetlamp Solar Cell](./manual_ta4_DE.md#ta4-straßenlampen-solarzelle--streetlamp-solar-cell)
|
||||||
- [Biogasanlage](./manual_ta4_DE.md#biogasanlage)
|
- [Biogasanlage](./manual_ta4_DE.md#biogasanlage)
|
||||||
- [Energiespeicher](./manual_ta4_DE.md#energiespeicher)
|
- [Energiespeicher](./manual_ta4_DE.md#energiespeicher)
|
||||||
|
@ -565,4 +565,22 @@ function techage.power.secondary_alive(pos, mem, capa_curr, capa_max)
|
|||||||
power_distribution(pos, mem, 1)
|
power_distribution(pos, mem, 1)
|
||||||
end
|
end
|
||||||
return mem.pwr_provided or 0
|
return mem.pwr_provided or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Read the current power value from all connected devices (used for solar cells)
|
||||||
|
--
|
||||||
|
function techage.power.get_power(start_pos)
|
||||||
|
Route = {}
|
||||||
|
NumNodes = 0
|
||||||
|
pos_already_reached(start_pos)
|
||||||
|
local sum = 0
|
||||||
|
connection_walk(start_pos, function(pos, mem)
|
||||||
|
local pwr = PWR(pos)
|
||||||
|
if pwr and pwr.on_getpower then
|
||||||
|
sum = sum + pwr.on_getpower(pos, mem)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
return sum
|
||||||
|
end
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ local function set_conn_dirs(pos, sides)
|
|||||||
M(pos):set_string("power_dirs", minetest.serialize(tbl))
|
M(pos):set_string("power_dirs", minetest.serialize(tbl))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
techage.power.side_to_dir = side_to_dir
|
||||||
techage.power.set_conn_dirs = set_conn_dirs
|
techage.power.set_conn_dirs = set_conn_dirs
|
||||||
|
|
||||||
local function valid_indir(pos, in_dir)
|
local function valid_indir(pos, in_dir)
|
||||||
@ -100,6 +101,7 @@ function techage.power.register_node(names, pwr_def)
|
|||||||
conn_sides = pwr_def.conn_sides or {"L", "R", "U", "D", "F", "B"},
|
conn_sides = pwr_def.conn_sides or {"L", "R", "U", "D", "F", "B"},
|
||||||
on_power = pwr_def.on_power,
|
on_power = pwr_def.on_power,
|
||||||
on_nopower = pwr_def.on_nopower,
|
on_nopower = pwr_def.on_nopower,
|
||||||
|
on_getpower = pwr_def.on_getpower,
|
||||||
power_network = pwr_def.power_network,
|
power_network = pwr_def.power_network,
|
||||||
after_place_node = ndef.after_place_node,
|
after_place_node = ndef.after_place_node,
|
||||||
after_dig_node = ndef.after_dig_node,
|
after_dig_node = ndef.after_dig_node,
|
||||||
@ -187,6 +189,9 @@ function techage.power.formspec_load_bar(charging, max_val)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function techage.power.formspec_power_bar(max_power, current_power)
|
function techage.power.formspec_power_bar(max_power, current_power)
|
||||||
|
if (current_power or 0) == 0 then
|
||||||
|
return "techage_form_level_bg.png"
|
||||||
|
end
|
||||||
local percent = techage.power.percent(max_power, current_power)
|
local percent = techage.power.percent(max_power, current_power)
|
||||||
percent = (percent + 5) / 1.22 -- texture correction
|
percent = (percent + 5) / 1.22 -- texture correction
|
||||||
return "techage_form_level_bg.png^[lowpart:"..percent..":techage_form_level_fg.png"
|
return "techage_form_level_bg.png^[lowpart:"..percent..":techage_form_level_fg.png"
|
||||||
|
170
power/ta4_cable.lua
Normal file
@ -0,0 +1,170 @@
|
|||||||
|
--[[
|
||||||
|
|
||||||
|
TechAge
|
||||||
|
=======
|
||||||
|
|
||||||
|
Copyright (C) 2019 Joachim Stolberg
|
||||||
|
|
||||||
|
GPL v3
|
||||||
|
See LICENSE.txt for more information
|
||||||
|
|
||||||
|
TA4 Low Power Cable for solar plants
|
||||||
|
|
||||||
|
]]--
|
||||||
|
|
||||||
|
-- for lazy programmers
|
||||||
|
local S2P = minetest.string_to_pos
|
||||||
|
local P2S = minetest.pos_to_string
|
||||||
|
local M = minetest.get_meta
|
||||||
|
local S = techage.S
|
||||||
|
|
||||||
|
local Cable = tubelib2.Tube:new({
|
||||||
|
dirs_to_check = {1,2,3,4,5,6},
|
||||||
|
max_tube_length = 200,
|
||||||
|
show_infotext = false,
|
||||||
|
tube_type = "ta4_power_cable",
|
||||||
|
primary_node_names = {"techage:ta4_power_cableS", "techage:ta4_power_cableA"},
|
||||||
|
secondary_node_names = {},
|
||||||
|
after_place_tube = function(pos, param2, tube_type, num_tubes)
|
||||||
|
minetest.swap_node(pos, {name = "techage:ta4_power_cable"..tube_type, param2 = param2})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
Cable:register_on_tube_update(function(node, pos, out_dir, peer_pos, peer_in_dir)
|
||||||
|
local ndef = minetest.registered_nodes[node.name]
|
||||||
|
if ndef and ndef.after_tube_update then
|
||||||
|
minetest.registered_nodes[node.name].after_tube_update(node, pos, out_dir, peer_pos, peer_in_dir)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
techage.TA4_Cable = Cable
|
||||||
|
|
||||||
|
minetest.register_node("techage:ta4_power_cableS", {
|
||||||
|
description = S("TA4 Low Power Cable"),
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"techage_ta4_cable.png",
|
||||||
|
"techage_ta4_cable.png",
|
||||||
|
"techage_ta4_cable.png",
|
||||||
|
"techage_ta4_cable.png",
|
||||||
|
"techage_ta4_cable_end.png",
|
||||||
|
"techage_ta4_cable_end.png",
|
||||||
|
},
|
||||||
|
|
||||||
|
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||||
|
if not Cable:after_place_tube(pos, placer, pointed_thing) then
|
||||||
|
minetest.remove_node(pos)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end,
|
||||||
|
|
||||||
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||||
|
Cable:after_dig_tube(pos, oldnode)
|
||||||
|
end,
|
||||||
|
|
||||||
|
paramtype2 = "facedir", -- important!
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-1/16, -1/16, -4/8, 1/16, 1/16, 4/8},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
on_rotate = screwdriver.disallow, -- important!
|
||||||
|
paramtype = "light",
|
||||||
|
sunlight_propagates = true,
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3},
|
||||||
|
sounds = default.node_sound_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("techage:ta4_power_cableA", {
|
||||||
|
description = S("TA4 Low Power Cable"),
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"techage_ta4_cable.png",
|
||||||
|
"techage_ta4_cable_end.png",
|
||||||
|
"techage_ta4_cable.png",
|
||||||
|
"techage_ta4_cable.png",
|
||||||
|
"techage_ta4_cable.png",
|
||||||
|
"techage_ta4_cable_end.png",
|
||||||
|
},
|
||||||
|
|
||||||
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||||
|
Cable:after_dig_tube(pos, oldnode)
|
||||||
|
end,
|
||||||
|
|
||||||
|
paramtype2 = "facedir", -- important!
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-1/16, -4/8, -1/16, 1/16, 1/16, 1/16},
|
||||||
|
{-1/16, -1/16, -4/8, 1/16, 1/16, -1/16},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
on_rotate = screwdriver.disallow, -- important!
|
||||||
|
paramtype = "light",
|
||||||
|
sunlight_propagates = true,
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3, not_in_creative_inventory = 1},
|
||||||
|
sounds = default.node_sound_defaults(),
|
||||||
|
drop = "techage:ta4_power_cableS",
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("techage:ta4_power_box", {
|
||||||
|
description = S("TA4 Low Power Box"),
|
||||||
|
tiles = {
|
||||||
|
"techage_ta4_junctionbox_top.png",
|
||||||
|
"techage_ta4_junctionbox_top.png",
|
||||||
|
"techage_ta4_junctionbox_side.png^techage_appl_ta4_cable.png",
|
||||||
|
},
|
||||||
|
|
||||||
|
paramtype2 = "facedir", -- important!
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "connected",
|
||||||
|
fixed = {
|
||||||
|
{ -3/16, -3/16, -3/16, 3/16, 3/16, 3/16}, -- box
|
||||||
|
{ -1/16, -7/16, -1/16, 1/16, -4/16, 1/16}, -- post
|
||||||
|
{ -3/16, -8/16, -3/16, 3/16, -7/16, 3/16}, -- base
|
||||||
|
},
|
||||||
|
|
||||||
|
connect_left = {{ -1/2, -1/16, -1/16, 0, 1/16, 1/16}},
|
||||||
|
connect_right = {{ 0, -1/16, -1/16, 1/2, 1/16, 1/16}},
|
||||||
|
connect_back = {{-1/16, -1/16, 0, 1/16, 1/16, 1/2}},
|
||||||
|
connect_front = {{-1/16, -1/16, -1/2, 1/16, 1/16, 0}},
|
||||||
|
},
|
||||||
|
connects_to = {"techage:ta4_power_cableA", "techage:ta4_power_cableS"},
|
||||||
|
|
||||||
|
on_rotate = screwdriver.disallow, -- important!
|
||||||
|
paramtype = "light",
|
||||||
|
sunlight_propagates = true,
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {cracky=2, crumbly=2, choppy=2},
|
||||||
|
sounds = default.node_sound_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
techage.power.register_node({"techage:ta4_power_box"}, {
|
||||||
|
power_network = Cable,
|
||||||
|
conn_sides ={"L", "R", "F", "B"},
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "techage:ta4_power_cableS 8",
|
||||||
|
recipe = {
|
||||||
|
{"basic_materials:plastic_sheet", "dye:red", ""},
|
||||||
|
{"", "default:copper_ingot", ""},
|
||||||
|
{"", "dye:red", "basic_materials:plastic_sheet"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "techage:ta4_power_box 2",
|
||||||
|
recipe = {
|
||||||
|
{"techage:ta4_power_cableS", "basic_materials:plastic_sheet", "techage:ta4_power_cableS"},
|
||||||
|
{"basic_materials:plastic_sheet", "default:copper_ingot", "basic_materials:plastic_sheet"},
|
||||||
|
{"techage:ta4_power_cableS", "basic_materials:plastic_sheet", "techage:ta4_power_cableS"},
|
||||||
|
},})
|
183
solar/inverter.lua
Normal file
@ -0,0 +1,183 @@
|
|||||||
|
--[[
|
||||||
|
|
||||||
|
TechAge
|
||||||
|
=======
|
||||||
|
|
||||||
|
Copyright (C) 2019 Joachim Stolberg
|
||||||
|
|
||||||
|
GPL v3
|
||||||
|
See LICENSE.txt for more information
|
||||||
|
|
||||||
|
TA4 Solar Power DC/AC Inverter
|
||||||
|
|
||||||
|
]]--
|
||||||
|
|
||||||
|
-- for lazy programmers
|
||||||
|
local M = minetest.get_meta
|
||||||
|
local S = techage.S
|
||||||
|
local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||||
|
local S2P = minetest.string_to_pos
|
||||||
|
|
||||||
|
local Power = techage.ElectricCable
|
||||||
|
local Solar = techage.TA4_Cable
|
||||||
|
local power = techage.power
|
||||||
|
|
||||||
|
local CYCLE_TIME = 2
|
||||||
|
local PWR_PERF = 120
|
||||||
|
|
||||||
|
local function formspec(self, pos, mem)
|
||||||
|
local max_power = mem.max_power or 0
|
||||||
|
local delivered = mem.delivered or 0
|
||||||
|
local bar_in = techage.power.formspec_power_bar(max_power, max_power)
|
||||||
|
local bar_out = techage.power.formspec_power_bar(max_power, delivered)
|
||||||
|
return "size[5,3]"..
|
||||||
|
default.gui_bg..
|
||||||
|
default.gui_bg_img..
|
||||||
|
default.gui_slots..
|
||||||
|
"label[0.2,0;DC]"..
|
||||||
|
"image[0,0.5;1,2;"..bar_in.."]"..
|
||||||
|
"label[0,2.5;"..max_power.." ku]"..
|
||||||
|
"button[1.1,1;1.8,1;update;"..S("Update").."]"..
|
||||||
|
"image_button[3,1;1,1;".. self:get_state_button_image(mem) ..";state_button;]"..
|
||||||
|
"label[4.2,0;AC]"..
|
||||||
|
"image[4,0.5;1,2;"..bar_out.."]"..
|
||||||
|
"label[4,2.5;"..delivered.." ku]"
|
||||||
|
end
|
||||||
|
|
||||||
|
local function determine_power(pos, mem)
|
||||||
|
local time = minetest.get_timeofday() or 0
|
||||||
|
if time < 6.00/24.00 or time > 18.00/24.00 then
|
||||||
|
mem.ticks = 0
|
||||||
|
mem.max_power = 0
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if (mem.ticks % 20) == 0 then -- calculate max_power not to often
|
||||||
|
local dir = M(pos):get_int("left_dir")
|
||||||
|
-- We have to use get_connected_node_pos, because the inverter has already
|
||||||
|
-- a AC power connection. An additional DC power connection is not possibe,
|
||||||
|
-- so we have to start the connection_walk on the next node.
|
||||||
|
local pos1 = Solar:get_connected_node_pos(pos, dir)
|
||||||
|
mem.max_power = math.min(PWR_PERF, power.get_power(pos1))
|
||||||
|
else
|
||||||
|
mem.max_power = mem.max_power or 0
|
||||||
|
end
|
||||||
|
mem.ticks = mem.ticks + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
local function can_start(pos, mem, state)
|
||||||
|
determine_power(pos, mem)
|
||||||
|
return mem.max_power > 0
|
||||||
|
end
|
||||||
|
|
||||||
|
local function start_node(pos, mem, state)
|
||||||
|
mem.running = true
|
||||||
|
mem.delivered = 0
|
||||||
|
mem.ticks = 0
|
||||||
|
power.generator_start(pos, mem, mem.max_power)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function stop_node(pos, mem, state)
|
||||||
|
mem.running = false
|
||||||
|
mem.delivered = 0
|
||||||
|
power.generator_stop(pos, mem)
|
||||||
|
end
|
||||||
|
|
||||||
|
local State = techage.NodeStates:new({
|
||||||
|
node_name_passive = "techage:ta4_solar_inverter",
|
||||||
|
cycle_time = CYCLE_TIME,
|
||||||
|
standby_ticks = 0,
|
||||||
|
formspec_func = formspec,
|
||||||
|
infotext_name = S("TA4 Solar Inverter"),
|
||||||
|
can_start = can_start,
|
||||||
|
start_node = start_node,
|
||||||
|
stop_node = stop_node,
|
||||||
|
})
|
||||||
|
|
||||||
|
local function node_timer(pos, elapsed)
|
||||||
|
local mem = tubelib2.get_mem(pos)
|
||||||
|
if mem.running then
|
||||||
|
determine_power(pos, mem)
|
||||||
|
if mem.max_power > 0 then
|
||||||
|
mem.delivered = power.generator_alive(pos, mem)
|
||||||
|
else
|
||||||
|
mem.delivered = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return mem.running
|
||||||
|
end
|
||||||
|
|
||||||
|
local function on_receive_fields(pos, formname, fields, player)
|
||||||
|
if minetest.is_protected(pos, player:get_player_name()) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local mem = tubelib2.get_mem(pos)
|
||||||
|
State:state_button_event(pos, mem, fields)
|
||||||
|
|
||||||
|
if fields.update then
|
||||||
|
M(pos):set_string("formspec", formspec(State, pos, mem))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function on_rightclick(pos)
|
||||||
|
local mem = tubelib2.get_mem(pos)
|
||||||
|
M(pos):set_string("formspec", formspec(State, pos, mem))
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_node("techage:ta4_solar_inverter", {
|
||||||
|
description = S("TA4 Solar Inverter"),
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"techage_filling_ta4.png^techage_frame_ta4_top.png",
|
||||||
|
"techage_filling_ta4.png^techage_frame_ta4.png",
|
||||||
|
"techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_hole_electric.png",
|
||||||
|
"techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_ta4_cable.png",
|
||||||
|
"techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_inverter.png",
|
||||||
|
"techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_inverter.png",
|
||||||
|
},
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
groups = {cracky=2, crumbly=2, choppy=2},
|
||||||
|
on_rotate = screwdriver.disallow,
|
||||||
|
is_ground_content = false,
|
||||||
|
|
||||||
|
after_place_node = function(pos, placer)
|
||||||
|
local mem = tubelib2.init_mem(pos)
|
||||||
|
local number = techage.add_node(pos, "techage:ta4_solar_inverter")
|
||||||
|
mem.running = false
|
||||||
|
mem.delivered = 0
|
||||||
|
State:node_init(pos, mem, number)
|
||||||
|
local meta = M(pos)
|
||||||
|
-- Solar/low power cable direction
|
||||||
|
meta:set_int("left_dir", techage.power.side_to_outdir(pos, "L"))
|
||||||
|
meta:set_string("formspec", formspec(State, pos, mem))
|
||||||
|
end,
|
||||||
|
|
||||||
|
on_receive_fields = on_receive_fields,
|
||||||
|
on_rightclick = on_rightclick,
|
||||||
|
on_timer = node_timer,
|
||||||
|
})
|
||||||
|
|
||||||
|
techage.power.register_node({"techage:ta4_solar_inverter"}, {
|
||||||
|
conn_sides = {"R"},
|
||||||
|
power_network = Power,
|
||||||
|
})
|
||||||
|
|
||||||
|
Solar:add_secondary_node_names({"techage:ta4_solar_inverter"})
|
||||||
|
|
||||||
|
techage.register_node({"techage:ta4_solar_inverter"}, {
|
||||||
|
on_recv_message = function(pos, src, topic, payload)
|
||||||
|
return State:on_receive_message(pos, topic, payload)
|
||||||
|
end,
|
||||||
|
on_node_load = function(pos)
|
||||||
|
State:on_node_load(pos)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "techage:ta4_solar_inverter",
|
||||||
|
recipe = {
|
||||||
|
{'default:steel_ingot', 'dye:green', 'default:steel_ingot'},
|
||||||
|
{'techage:ta4_power_cableS', 'techage:ta4_wlanchip', 'techage:electric_cableS'},
|
||||||
|
{'default:steel_ingot', "techage:baborium_ingot", 'default:steel_ingot'},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
240
solar/solarcell.lua
Normal file
@ -0,0 +1,240 @@
|
|||||||
|
--[[
|
||||||
|
|
||||||
|
TechAge
|
||||||
|
=======
|
||||||
|
|
||||||
|
Copyright (C) 2019 Joachim Stolberg
|
||||||
|
|
||||||
|
GPL v3
|
||||||
|
See LICENSE.txt for more information
|
||||||
|
|
||||||
|
TA4 Solar Module and Carriers
|
||||||
|
|
||||||
|
]]--
|
||||||
|
|
||||||
|
-- for lazy programmers
|
||||||
|
local P = minetest.string_to_pos
|
||||||
|
local M = minetest.get_meta
|
||||||
|
local S = techage.S
|
||||||
|
|
||||||
|
local PWR_PERF = 4
|
||||||
|
|
||||||
|
local Cable = techage.TA4_Cable
|
||||||
|
local power = techage.power
|
||||||
|
|
||||||
|
local function temperature(pos)
|
||||||
|
local data = minetest.get_biome_data(pos)
|
||||||
|
if data then
|
||||||
|
return math.floor(data.heat) or 0
|
||||||
|
end
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
|
||||||
|
-- return the required param2 for solar modules
|
||||||
|
local function get_param2(pos, side)
|
||||||
|
local node = minetest.get_node(pos)
|
||||||
|
local dir = power.side_to_dir(node.param2, side)
|
||||||
|
return (dir + 1) % 4
|
||||||
|
end
|
||||||
|
|
||||||
|
-- do we have enough light?
|
||||||
|
local function light(pos)
|
||||||
|
pos.y = pos.y + 1
|
||||||
|
local light = minetest.get_node_light(pos) or 0
|
||||||
|
pos.y = pos.y - 1
|
||||||
|
return light >= (minetest.LIGHT_MAX - 1)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- check if solar module is available and has the correct orientation
|
||||||
|
local function is_solar_module(base_pos, pos, side)
|
||||||
|
local pos1 = techage.get_pos(pos, side)
|
||||||
|
if pos1 then
|
||||||
|
local node = minetest.get_node(pos1)
|
||||||
|
if node and node.name == "techage:ta4_solar_module" and light(pos1) then
|
||||||
|
if side == "L" and node.param2 == M(base_pos):get_int("left_param2") then
|
||||||
|
return true
|
||||||
|
elseif side == "R" and node.param2 == M(base_pos):get_int("right_param2") then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
-- provide the available power, which is temperature dependent
|
||||||
|
local function on_getpower1(pos, mem)
|
||||||
|
local pos1 = {x = pos.x, y = pos.y, z = pos.z}
|
||||||
|
if is_solar_module(pos, pos1, "L") and is_solar_module(pos, pos1, "R") then
|
||||||
|
return PWR_PERF * M(pos):get_int("temperature") / 100.0
|
||||||
|
end
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
|
||||||
|
local function on_getpower2(pos, mem)
|
||||||
|
local pos1 = {x = pos.x, y = pos.y+1, z = pos.z}
|
||||||
|
if is_solar_module(pos, pos1, "L") and is_solar_module(pos, pos1, "R") then
|
||||||
|
return PWR_PERF * M(pos):get_int("temperature") / 100.0
|
||||||
|
end
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_node("techage:ta4_solar_module", {
|
||||||
|
description = S("TA4 Solar Module"),
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"techage_solar_module_top.png",
|
||||||
|
"techage_solar_module_bottom.png",
|
||||||
|
},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-1/2, 7/16, -1/2, 1/2, 8/16, 16/16},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
groups = {cracky=2, crumbly=2, choppy=2},
|
||||||
|
is_ground_content = false,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("techage:ta4_solar_carrier", {
|
||||||
|
description = S("TA4 Solar Carrier Module"),
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"techage_concrete.png^[brighten",
|
||||||
|
"techage_concrete.png^[brighten",
|
||||||
|
"techage_concrete.png^[brighten",
|
||||||
|
"techage_concrete.png^[brighten",
|
||||||
|
"techage_concrete.png^[brighten^techage_appl_ta4_cable.png",
|
||||||
|
"techage_concrete.png^[brighten^techage_appl_ta4_cable.png",
|
||||||
|
},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-3/8, -8/16, -1/2, 3/8, -6/16, 1/2},
|
||||||
|
{-1/8, -6/16, -1/2, 1/8, 6/16, 1/2},
|
||||||
|
{-3/8, 5/16, -1/2, 3/8, 7/16, 1/2},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
after_place_node = function(pos)
|
||||||
|
M(pos):set_int("temperature", temperature(pos))
|
||||||
|
M(pos):set_int("left_param2", get_param2(pos, "L"))
|
||||||
|
M(pos):set_int("right_param2", get_param2(pos, "R"))
|
||||||
|
end,
|
||||||
|
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
groups = {cracky=2, crumbly=2, choppy=2},
|
||||||
|
is_ground_content = false,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("techage:ta4_solar_carrierB", {
|
||||||
|
description = S("TA4 Solar Carrier Module B"),
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"techage_concrete.png^[brighten^techage_appl_ta4_cable.png",
|
||||||
|
"techage_concrete.png^[brighten",
|
||||||
|
"techage_concrete.png^[brighten",
|
||||||
|
"techage_concrete.png^[brighten",
|
||||||
|
"techage_concrete.png^[brighten^techage_appl_ta4_cable.png",
|
||||||
|
"techage_concrete.png^[brighten^techage_appl_ta4_cable.png",
|
||||||
|
},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-3/8, -8/16, -1/2, 3/8, -6/16, 1/2},
|
||||||
|
{-1/8, -6/16, -1/2, 1/8, 8/16, 1/2},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
after_place_node = function(pos)
|
||||||
|
M(pos):set_int("temperature", temperature(pos))
|
||||||
|
M(pos):set_int("left_param2", get_param2(pos, "L"))
|
||||||
|
M(pos):set_int("right_param2", get_param2(pos, "R"))
|
||||||
|
end,
|
||||||
|
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
groups = {cracky=2, crumbly=2, choppy=2},
|
||||||
|
is_ground_content = false,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("techage:ta4_solar_carrierT", {
|
||||||
|
description = S("TA4 Solar Carrier Module T"),
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"techage_concrete.png^[brighten",
|
||||||
|
"techage_concrete.png^[brighten",
|
||||||
|
"techage_concrete.png^[brighten",
|
||||||
|
"techage_concrete.png^[brighten",
|
||||||
|
"techage_concrete.png^[brighten",
|
||||||
|
"techage_concrete.png^[brighten",
|
||||||
|
},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-1/8, -8/16, -1/2, 1/8, 6/16, 1/2},
|
||||||
|
{-3/8, 5/16, -1/2, 3/8, 7/16, 1/2},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
groups = {cracky=2, crumbly=2, choppy=2},
|
||||||
|
is_ground_content = false,
|
||||||
|
})
|
||||||
|
|
||||||
|
techage.power.register_node({"techage:ta4_solar_carrier"}, {
|
||||||
|
power_network = Cable,
|
||||||
|
on_getpower = on_getpower1,
|
||||||
|
conn_sides ={"F", "B"},
|
||||||
|
})
|
||||||
|
|
||||||
|
techage.power.register_node({"techage:ta4_solar_carrierB"}, {
|
||||||
|
power_network = Cable,
|
||||||
|
on_getpower = on_getpower2,
|
||||||
|
conn_sides ={"F", "B"},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "techage:ta4_solar_module",
|
||||||
|
recipe = {
|
||||||
|
{"techage:ta4_silicon_wafer", "techage:ta4_silicon_wafer", "techage:ta4_silicon_wafer"},
|
||||||
|
{"default:tin_ingot", "default:copper_ingot", "default:tin_ingot"},
|
||||||
|
{"", "", ""},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "techage:ta4_solar_carrierB 2",
|
||||||
|
recipe = {
|
||||||
|
{"", "default:steel_ingot", ""},
|
||||||
|
{"", "techage:ta4_power_cableS", ""},
|
||||||
|
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "techage:ta4_solar_carrierT 2",
|
||||||
|
recipe = {
|
||||||
|
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
|
||||||
|
{"", "default:steel_ingot", ""},
|
||||||
|
{"", "techage:ta4_power_cableS", ""},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "techage:ta4_solar_carrier",
|
||||||
|
recipe = {
|
||||||
|
{"", "techage:ta4_solar_carrierT", ""},
|
||||||
|
{"", "techage:ta4_solar_carrierB", ""},
|
||||||
|
{"", "", ""},
|
||||||
|
},
|
||||||
|
})
|
BIN
textures/techage_appl_inverter.png
Normal file
After Width: | Height: | Size: 318 B |
BIN
textures/techage_appl_ta4_cable.png
Normal file
After Width: | Height: | Size: 184 B |
BIN
textures/techage_solar_module_bottom.png
Normal file
After Width: | Height: | Size: 186 B |
BIN
textures/techage_solar_module_top.png
Normal file
After Width: | Height: | Size: 238 B |
BIN
textures/techage_ta4_cable.png
Normal file
After Width: | Height: | Size: 211 B |
BIN
textures/techage_ta4_cable_end.png
Normal file
After Width: | Height: | Size: 221 B |
BIN
textures/techage_ta4_junctionbox_side.png
Normal file
After Width: | Height: | Size: 204 B |
BIN
textures/techage_ta4_junctionbox_top.png
Normal file
After Width: | Height: | Size: 221 B |
BIN
textures/techage_ta4_solar.png
Normal file
After Width: | Height: | Size: 7.1 KiB |