Skip to content

API Configuring

Marcel1853 edited this page Oct 9, 2026 · 1 revision

🇩🇪 Deutsche Version · ⬅ For mod authors

Configuring

Stations

Function Effect
configure_station(unit, changes) apply settings, e.g. { mode = "station", provide = true, request = false, request_priority = 5 }. Only known keys with a matching type. mode: "station", "depot", "fuel", "cleanup", "storage". Nested tables are merged one level deep, e.g. { cleanup = { offer = "first" } } keeps the goods list. Cleanup offer: false, "reserve", "normal", "first".
set_request(unit, slot, signal, count) set a request slot, e.g. set_request(unit, 1, { type = "item", name = "iron-plate" }, 400); signal = nil clears the slot.
copy_settings(from_unit, to_unit) copy all settings, like shift-click (including the add-on role and data of add-ons)
set_station_role(unit, key) put a station on an add-on's role – see Add-ons: roles and data

Storage example:

remote.call("utl", "configure_station", unit, { mode = "storage", storage = {
  limits = { { signal = { type = "item", name = "iron-plate" }, min = 1000, max = 4000 } },
  accept_leftover = true } })

Network combinator

Function Effect
configure_readout(unit, changes) configure a network combinator, e.g. { network = "Iron", mode = "shortage", star = true }. mode: "stock", "storage", "shortage", "trains".

Networks, teams, map

Function Effect
link_networks(surface_index, center, partner, force?) link two networks to a star; limit as in the game from research. Returns true or the reason as text.
unlink_networks(surface_index, a, b, force?) remove a link
set_team_config(force_name, key, value) set a team value: load_timeout, unload_timeout (seconds), timeout_mode ("and"/"or"); nil = map value. Team values only count when there are teams.
set_map_config(setting, value) set a map value as in the UTL Manager, e.g. set_map_config("utl-load-timeout", 10) or set_map_config("utl-debug-log", true); nil = back to the mod settings value. Checks type and limits, returns true or false.
set_elevator_network(force_name, network, on) set the switch "deliver via the space elevator" for a network (only with Space Exploration)

Deliveries

Function Effect
cancel_delivery(id) cancel a delivery; the train carries on with its own schedule (cleanup/refuelling, otherwise depot). Returns true if it existed.

Starting and extending deliveries: see Add-ons: trips.

Blueprints

Function Effect
tag_blueprint(blueprint, mapping, surface) write UTL settings into a blueprint made by script (mapping from create_blueprint)
local mapping = stack.create_blueprint({ surface = surface, force = force, area = area })
remote.call("utl", "tag_blueprint", stack, mapping, surface)

Blueprints a player makes in the game get the settings by themselves.

Clone this wiki locally