i am suggesting the following api-improvements/api-changes regarding transport lines and belts:
a)
read access to belt speed.
i moved this one to its own request thread: viewtopic.php?f=28&t=23187
b)
Code: Select all
LuaTransportLine.get_content_entities :: dictionary float → LuaItemStack
c)
Code: Select all
LuaTransportLine.extract_content(LuaItemStack)
d)
Code: Select all
LuaTransportLine.insert_content_at_position(LuaItemStack, float)
and
LuaTransportLine.insert_content_at_back(LuaItemStack)
e)
Code: Select all
LuaTransportLine.halt_at_position(float or nil)
AND one of the events
script.on_transport_line_halting_position_set(LuaTransportLine, float or nil) (implemented as globally visible event)
or
LuaTransportLine.on_halting_position_set(float or nil) (implemented as event attached to a specific transport line entity)
motivation:
opening up access to the entities on a belt, extraction and insertion, would allow a lot of new things to be done in mods. Items shuffled around on belts, between belts, from belts to other modded entities and back to belts. item flow halted when conditions are met or not. with the speed setting readable, the modded entities can adapt to the belts connected to them. (they easily could be modded belt entities with non-stock belt speeds. what to do then, if the speed is unknown?) and - imo very important - the mods can set its calculations to be performed only every n-th tick (depending on the speed of the belt) to keep strain on the game engine as low as possible.
What do you think?