This file is fairly incomplete. Help is welcome.
The tier is a string, currently "LV"
, "MV"
and "HV"
are supported.
The network is the cable with the connected machine nodes. Currently the
switching station handles the network activity.
technic.EU_string(num)
EU
unittechnic.pretty_num(num)
num
to a human-readable string with SI prefixestechnic.swap_node(pos, nodename)
mintest.swap_node
but it only changes the nodename.minetest.get_node
before swapping to ensure the new nodenametechnic.get_or_load_node(pos)
nil
.technic.set_RE_wear(itemstack, item_load, max_charge)
wear_represents
field in the item's nodedef is"technic_RE_charge"
, this function does nothing.technic.refill_RE_charge(itemstack)
technic.power_tools[itemstack:get_name()]
is nil
(or false
), thistechnic.is_tier_cable(nodename, tier)
nodename
is the cable of the tier tier
.technic.get_cable_tier(nodename)
nodename
or nil
.technic.trace_node_ray(pos, dir, range)
pos
.technic.trace_node_ray_fat(pos, dir, range)
technic.trace_node_ray
but includes extra positions near the ray.technic.config:get(name)
technic.tube_inject_item(pos, start_pos, velocity, item)
pipeworks.tube_inject_item
technic.register_power_tool(itemname, max_charge)
technic.power_tools[itemname] = max_charge
itemname
chargeable.technic.register_machine(tier, nodename, machine_type)
technic.machines[tier][nodename] = machine_type
Machine types
technic.register_tier(tier)
technic.machines[tier] = {}
tiers
technic.register_solar_array(data)
technic.can_insert_unique_stack(pos, node, stack, direction)
technic.insert_object_unique_stack(pos, node, stack, direction)
can_insert
and insert_object
to avoidtechnic_<ltier> = 1
ltier is a tier in small letters; this group makestechnic_machine = 1
Currently used forconnect_sides
In addition to the default use (see lua_api.txt), this tells where the
machine can be connected.
#
#technic_run(pos, node)
There are currently following types:
* technic.receiver = "RE"
e.g. grinder
* technic.producer = "PR"
e.g. solar panel
* technic.producer_receiver = "PR_RE"
supply converter
* technic.battery = "BA"
e.g. LV batbox
The switching station is the center of all power distribution on an electric
network.
The station collects power from sources (PR), distributes it to sinks (RE),
and uses the excess/shortfall to charge and discharge batteries (BA).
For now, all supply and demand values are expressed in kW.
It works like this:
All PR,BA,RE nodes are indexed and tagged with the switching station.
The tagging is a workaround to allow more stations to be built without allowing
a cheat with duplicating power.
All the RE nodes are queried for their current EU demand. Those which are off
would require no or a small standby EU demand, while those which are on would
require more.
If the total demand is less than the available power they are all updated with
the demand number.
If any surplus exists from the PR nodes the batteries will be charged evenly
with this.
If the total demand requires draw on the batteries they will be discharged
evenly.
If the total demand is more than the available power all RE nodes will be shut
down. We have a brown-out situation.
Hence for now all the power distribution logic resides in this single node.
Nodes connected to the network will have one or more of these parameters as meta
data:
* <LV|MV|HV>_EU_supply
: Exists for PR and BA node types.
This is the EU value supplied by the node. Output
* <LV|MV|HV>_EU_demand
: Exists for RE and BA node types.
This is the EU value the node requires to run. Output
* <LV|MV|HV>_EU_input
: Exists for RE and BA node types.
This is the actual EU value the network can give the node. Input
The reason the LV|MV|HV type is prepended to meta data is because some machine
could require several supplies to work.
This way the supplies are separated per network.