Teleportation_Redux

by Silari

Mid and late-game techs for teleportation devices. Adds beacons which allow teleportation between them, and equipment that allows teleporting within vision range, including radars, using a remote. Both methods require power proportional to the distance traveled. Also includes optional telelogistics technology which transfers items from a Teleprovider chest to a selected Beacon (hit R on the chest to set it). Original by Apriori, updated to 0.17+ by Silari.

Content
9 days ago
0.17 - 2.0
11.0K
Transportation

b [DONE] Crash on Teleporter build

3 years ago
(updated 3 years ago)

I've headless Server running with other mods but running fine.
there are aleady 57 Teleporters on the map, but now that I've placed another the server crashed and I also cannot load that save in singleplayer anymore.
it gives me that error:

Error while running event Teleportation_Redux::on_player_joined_game (ID 44)
LuaEntity API call when LuaEntity was invalid.
stack traceback:
[C]: in function 'index'
__Teleportation_Redux
/control-teleportation.lua:114: in function 'Teleportation_CountBeacons'
Teleportation_Redux/control-teleportation.lua:634: in function 'Teleportation_UpdateGui'
Teleportation_Redux/control.lua:86: in function <Teleportation_Redux/control.lua:84>

What confuses me: it won't even let me load (on single player) an older save hours before I placed that teleporter anymore.

3 years ago
(updated 3 years ago)

What version of Teleportation Redux are you running? Stack trace in your error doesn't match latest version 1.1.4 - line 86 of control.lua is blank, and line 84 is just an end statement.

Try and update your mods, see if Teleportation Redux has an update available which might fix it. Updating the game, or updating/adding mods (any mod, not just this one) should also trigger a migration event when a save is loaded which rebuilds the beacon list, which might resolve it.

Otherwise, I need to look at the save - it looks like a stored beacon isn't valid anymore, which shouldn't happen. It's possible a mod has removed a beacon which is causing the issue.

3 years ago

I'm using the latest Version 1.1.4.
Factorio also isn't showing me any more recent version available.
Factorio itself is running on the latest experimental.
I have a few other mod updates available what I can try tomorrow, I let you know.

If it isn't fixed by that I send you a like for the save so you can have a look.

3 years ago
(updated 3 years ago)

Ok so with some testing, it seems almost certain that something deleted a beacon via script, likely hours ago which is why it also effects your old save, so when something happens that makes the mod recount the beacons (such as a player joining, or building a beacon - it doesn't happen opening the GUI or browsing the list or teleporting) it crashes because it tries to check the force of an invalid entity. I should have an update up tonight (within an hour) with 3 fixes for this:

1) Check a beacon is valid before accessing any attributes on it. MOST usages do this, but the CountBeacons function didn't, probably an oversight by the original author. This should let your save load properly regardless.
2) Add an event for script_raised_delete. It can't prevent every instance, since scripts can delete things without raising the event (though if you're deleting someone elses items, you darn well should), but assuming whatever is doing it is playing nice it would prevent the issue from happening again.
3) The migration function I mentioned has been fixed to a) actually run, and b) check for invalid beacons in the saved list and remove them while cleaning up any leftover bits from that beacon.

I'll need to write up a more complicated fix later that'll clear the saved beacon info AND clean up related settings AND remove any leftover buildings (there's a hidden accumulator built inside beacons, which is what stores the power that beacons use). The migration function should clean up any leftover bits and bobs now.

I still would like a copy of the broken save if it's not too large so I can use it to test the fixes on a known bad save.

TLDR; Version 1.1.5 should let you load your game and help prevent the error.

3 years ago

Wow thanks for that quick fix,
I maybe even know what caused that issue.

I'm using the mod "The Blueprint Designer Lab"
and I remember I've built a beacon there and removed it afterwards but there stayed an invisible object that I couldn't overbuild anymore.
(The Better Bots Mod has a similar Issue)

since I was busy designing a big blueprint I hadn't wiped the lab yet.

3 years ago

Yeah that would probably be it - invisible object is the accumulator that beacons use to store their energy, since you can't have an entity be an accumulator and a container (which beacons are for telelogistics to work).

With the update, if those mods are raising the script destroyed event everything should work fine. If they're not, the game won't crash and eventually the mod will clean up the remnants when it redoes the list. I might set a timer up so that things get cleaned periodically, or when it updates the GUI, depending on if there's performance issues.

New response