Transportorio

by Zomiib

Transport resources and trade your way up! start with just a bit of coal and work your way up to rockets.

Overhaul
2 years ago
1.1
1.23K

b trades_menu bug

2 years ago

Ever since 0.6, toggling the trade panel results in an error on single player, but not on multiplayer. In a map started in v0.5. no other mods.
I don't know enough lua to figure out how to test in the game, but did that version change trades_menu from a boolean to a struct? if so, the onPlayerConnect function reinitializes it correctly for multiplayer, but that never happens in single player. the fact that I can save the multiplayer game and still get the error in single player makes me think I've got the wrong explanation though.

Error while running event Transportorio::on_lua_shortcut (ID 36)
Transportorio/control.lua:1044: attempt to call method 'toggle' (a nil value)
stack traceback:
Transportorio/control.lua:1044: in function
<Transportorio/control.lua:1041>

I like the concept of this mod, but it's a lot more work than I thought it would be. Still going to slug it out and try to finish. would be great if it worked with LTN, but I need the practice of vanilla trains too.

2 years ago

if I start searching for something in the trades list, click it to filter, then hit space, it also triggers an error. that one for sure could just be caught and show no search results. I discovered that while trying to search for 2 items to find a specific recipe which would be a handy feature to implement some time.

2 years ago

Hey thanks for the detailed response and your idea of whats going wrong. So like you said i did update the GUI to a struct. You are probably correct that it is using the old trade menu with the code for the new one. I do have it regenerate a new UI everytime the "player joins event" goes off. I did not know that is multiplayer only though which is probably why its crashing on singleplayer but not multiplayer. As for fixing it, revert back to 0.5 for now if you can and ill try to push out an update soon that fixes the issue.

2 years ago

Should be fixed in version 0.0.9

New response