Inserters modding

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Apr 15, 2019 11:14 am

Inserters modding

Post by SixV »

Hello there,

There is several things that seems unanswered on the wiki and Lua API documentation about inserters.
  • What are the units for energy_per_movement and energy_per_rotation ?
  • What does energy_per_movement and energy_per_rotation means ?
  • What are the units for extension_speed and rotation_speed ?
  • What does extension_speed and rotation_speed means ?
  • Is it possible to control the inserter movement from Lua or is a full re-implementation the only way ?
From what I could gather on the forum, energy_per_movement and energy_per_rotation may be expressed in Joules[1] while extension_speed and rotation_speed may be expressed in "tiles per tick"[2] and "full rotation per tick"[2] respectively.
I couldn't find any explaination on how these are used, though. Nor any official statement saying the units are what I could read on the forum (Except for the Joule, maybe ? But it was written back in 2014). After reading several forum posts from modders, I can only guess energy_per_movement really means "energy consumed per tiles extentions" and energy_per_rotation "energy consumed per full rotation", thus, assuming energy_source.drain is a passive energy consumption:

Code: Select all

movement_consumption_per_tick = energy_source.drain + extension_speed * energy_per_movement
rotation_consumption_per_tick = energy_source.drain + rotation_speed * energy_per_rotation
Is it right ?

About controlling the inserter movement, I couldn't find anything. I guess it's handled game-engine-side. The only way I can think of is replacing the inserters prototypes entirely with a type that the game-engine doesn't interpret as an internal inserter implementation, at the cost of preventing other mods from tinkering with the fresh inserter implementation when they're using type filtering to get entities...


Post Reply

Return to “Modding discussion”

Who is online

Users browsing this forum: Bing [Bot]