L0laapk3 / FactorioMaps

L0laapk3's FactorioMaps mod
https://mods.factorio.com/mod/L0laapk3_FactorioMaps
Other
121 stars 22 forks source link

Map label generation crash #32

Closed speedfreak01 closed 5 years ago

speedfreak01 commented 5 years ago

Hi,

Recently tried to use this code to generate a map for a seablocks game i've been playing. Managed to get the map gen to work, however the code is dying when trying to generate labels

generating mapInfo.json
updating labels
disabling FactorioMaps mod
cleaning up
Traceback (most recent call last):
  File "auto.py", line 626, in <module>
    auto(*sys.argv[1:])
  File "auto.py", line 545, in auto
    mod = next(mod for mod in modVersions if mod[0] == m.group(1).lower())
StopIteration

For now I've removed the code in auto.py that handles the tag / label gen, and re-ran the gen with --dry to produce the mapinfo.js and other files required to view the map.

If i re-run the script with --dry without removing the label gen stuff i get the following

$ python auto.py --factorio=/e/factorio_maps_gen/bin/x64/factorio.exe --verbosegame --dayonly --dry
No save name passed. Using most recent save: SeaBlocks0.16.5
factorio path: e:\factorio_maps_gen\bin\x64\factorio.exe
output folder: script-output\FactorioMaps\SeaBlocks0.16.5
checking for updates
enabling FactorioMaps mod
updating labels
Traceback (most recent call last):
  File "auto.py", line 529, in auto
    rawPath = rawTags[tag["iconType"] + tag["iconName"][0].upper() + tag["iconName"][1:]]
  File "<string>", line 2, in __getitem__
  File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\multiprocessing\managers.py", line 811, in _callmethod
    raise convert_to_error(kind, result)
KeyError: 'fluidLiquid-molten-nickel'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "auto.py", line 619, in <module>
    auto(*sys.argv[1:])
  File "auto.py", line 594, in auto
    kill(pid)

Happy to upload a copy of the map and mods if you need that for testing. I do use a fair few mods which might be the cause of this!

L0laapk3 commented 5 years ago

Can you please upload a zip of all the mods you used, and the log files found in %TMPDIR%, then sort by most recently created and open the newest FactorioMaps-xxxxxxxx folder, in there you should find a log file.

speedfreak01 commented 5 years ago

Hey, sorry for the delayed reply. I re-ran the script again today, looks like the folder in the %TMPDIR% is deleted after the script fails to complete.

I have attached a copy of the console output in case that helps, along with a copy of the mods dir, and savefile.

Mods: https://drive.google.com/open?id=1CU71VlO-OGTl6bGbdkVZsV2jA2YJJY0a Save: https://drive.google.com/open?id=1ylCTBuahuzSzF9M5RAG4EYj_7UmFRgSZ Console Log: https://drive.google.com/open?id=12JD_dch8m-dgkm93G97iUS09b2UQ0aYP

If there is anything else in that tmpdir that is needed, i can run the script again and try make a backup of files before they get deleted.

L0laapk3 commented 5 years ago

This may or may not be fixed in v3.3.0, I can generate the map just fine but that could be because I updated the mods. Closing for now.