Deadlock989 / IndustrialRevolution

Industrial Revolution 3 is an overhaul mod for Factorio.
51 stars 0 forks source link

Blueprinting Transmats Crash #291

Closed darkbrothervs closed 1 year ago

darkbrothervs commented 1 year ago

Describe the issue Tried to create a blueprint that included a named transmat. Before naming didn't seem to have an issue? This is the only transmat I had on the map.

Error while running event IndustrialRevolution3::on_player_setup_blueprint (ID 70) Index out of bounds: 3 > 0. stack traceback: [C]: in function 'set_blueprint_entity_tag' IndustrialRevolution3/code/control/control-events.lua:592: in function <IndustrialRevolution3/code/control/control-events.lua:581>

Factorio version, IR version IR 3.1.5 Factorio 1.1.87

Other mods installed Lots of QoL but I don't think they're causing this.

Deadlock989 commented 1 year ago

I can't reproduce this from the info given - I can blueprint a named transmat without any issue.

Please give me more detailed reproduction steps - a blueprint export string would be especially useful.

Please do also list your QOL mods, it is very possible there is an issue with one of them, or some unforeseen interaction between mods.

darkbrothervs commented 1 year ago

Okay I was able to play with this more and think I can reproduce now. It's not the initial creation of a blueprint that causes an issue, it's altering an existing blueprint. Try these steps:

  1. Create a blueprint including a transmat.
  2. Put blueprint in blueprint library (didn't test putting in player inventory).
  3. Use blue + button to add new contents to the blueprint and reselect the transmat.
  4. Crash, error as listed above.

My save is 1 MB too big to attach -_- I don't know a good way to extract the mod list, so pics attached.

ApplicationFrameHost_Dcr8Cx8Jw0 factorio_lahTe5oZ2M factorio_UO307gc7TS factorio_v8x0xW1pC4 factorio_wYNsNmz5hU factorio_HKAYAm2Pme
Deadlock989 commented 1 year ago

Thanks, I can reproduce that without third party mods installed. It's not related to the blueprint library. I will investigate this but I'll need to get around to it. In the meantime you can work around it by only creating brand new blueprints for named transmats, i.e. avoid using the blue "Select new contents for the blueprint" button on them.

For future reference you can find a JSON format list of activate mods in a file called mod-list.json in your Factorio/mods folder.

darkbrothervs commented 1 year ago

It's no big worry, I was actually trying to blueprint the tiles under the transmat :).

Thank you for your work putting this mod together.

Deadlock989 commented 1 year ago

It seems this issue is caused by a long-standing bug in the main game which has been left unaddressed for 3 years:

https://forums.factorio.com/viewtopic.php?f=182&t=88100

I can stop the script error from happening, but it seems there is no way to set the entity tag in the blueprint when the "Select new contents" button is used, pending a fix for this long-standing issue in the main game. So transmat names will be lost when using that button, but that's better than an error.