Warptorio 3 (No Space Age)


Port of Warptorio2 2.0.0 + Planetorio 0.2.0, as one mod. Space Age must be disabled.

Content
7 days ago
2.0
671

b [Bug] Warp pipe directions reset to default on mod configuration change

8 days ago

Warp pipes around teleporter elevators lose their rotation every time a mod change triggers on_configuration_changed. They revert to the default direction as if freshly placed.

Root cause: Loader directions are persisted in self.dir[i][id] (stored in storage), but pipe directions are not. MakePointPipes at control_class_teleporter.lua:477 reads direction from the live entity before destroying it — but on config change the entity is already gone, so it falls back to the hardcoded default (vexdir == 1 and 6 or 12).

Suggested fix: Add a self.pipedir = { {}, {} } field (analogous to self.dir for loaders), save v.direction into it on rotation/rebuild, and read from it when the entity no longer exists:

lua

local pipedir = self.pipedir[i][id] or (vexdir == 1 and 6 or 12)
if (isvalid(v) and ...) then
pipedir = v.direction
self.pipedir[i][id] = pipedir
entity.destroy(v)
end
No migration needed — missing self.pipedir entries would just fall through to the current default.

8 days ago

Same pattern applies to chest inventory bar (slot limit) on elevator chests.

DestroyPointLogistics at control_class_teleporter.lua:362 saves get_contents() into self.chestcontents, but does not save get_bar(). When MakePointLoader rebuilds the chest (line 439-443), it restores the items but the bar resets to full size.

Also affects entity.copy.chest in lib_control.lua:132 (used by RemakeChestPair during logistics tier upgrades) — copies items and wires, but not the bar.

Suggested fix:

lua

-- DestroyPointLogistics: save bar alongside contents
self.chestcontents[o][k] = v.get_inventory(defines.inventory.chest).get_contents()
self.chestbar[o][k] = v.get_inventory(defines.inventory.chest).get_bar()
-- MakePointLoader: restore bar after inserting items
local bar = self.chestbar[i][id]
if (bar) then cv.set_bar(bar) end
-- entity.copy.chest: copy bar during tier swaps
local abar = a.get_inventory(defines.inventory.chest).get_bar()
b.get_inventory(defines.inventory.chest).set_bar(abar)
self.chestbar would need self.chestbar = self.chestbar or { {}, {} } in TELL.__init, same as chestcontents.

7 days ago

Should be fixed, Try it out!

7 days ago
(updated 7 days ago)

Tried it out! Unfortunately it crashes on startup before I even get to the main menu 😄

Error while running setup for entity prototype "warptorio-beacon-1" (beacon):
Module inventory size is > 0 (or module slots count is affected by quality)

but no effects are allowed. This makes no sense.
Quick question - did you actually launch Factorio with this version before pushing it? 😉

The issue is in data_warptorio.lua around line 1299:
t.allowed_effects = nil
t.allowed_module_categories = nil
Setting allowed_effects = nil on a beacon with module_slots > 0 is not allowed by the engine. It interprets nil as "no effects permitted", which contradicts having module slots at all.

Fix: replace nil with a full effect list:

t.allowed_effects = {"consumption", "speed", "productivity", "pollution", "quality"}
t.allowed_module_categories = nil -- this one is fine, nil = no category restrictions
This way the beacon accepts all module types (which was your intent) without the engine complaining.

7 days ago

Caught me there... 😄
Thank you for the provided list. Shjould be fixed, atleast i do not get any errors. Also found another bug with the pipe fix.

This thread has been locked.