the1killer / sm_overview

Overview map generator for Scrap Mechanic
30 stars 7 forks source link

No .json file :( #17

Open Maks1725 opened 1 year ago

Maks1725 commented 1 year ago

I think it stopped working after update 0.6.6, in the changelog it says: Blocked sm.json.save from saving to invalid locations

And my game log files have these lines: 21:54:44 (415317/768) [Lua] UpgradeCellData - version: 2 21:54:44 (415317/768) [Lua] - No upgrade needed 21:54:44 (415317/768) [Lua] ERROR: ..._DATA/Scripts/terrain/terrain_overworld.lua:154: '$SURVIVAL_DATA/cells.json' is not located in the same content id as the caller 21:54:44 (415317/768) [Lua] ----- Lua Error Traceback ----- [C]: in function 'save' ..._DATA/Scripts/terrain/terrain_overworld.lua:154: in function 'Load' (Lua entered on line number: 112)

Here is my full log: game-20231109-215434.log

I'm too dumb to try fix the problem myself, can somebody help me?

mp0011 commented 11 months ago

Same here. Any fix or workaround...?

Also, it takes AGES to load game each time, as map is generated every time I load the save. Since the map itself (the tiles) do not changes, it's pointless.

Can You add a check, so map generates only if there is no output file, and skip otherwise? If I want new file generated, I could just then rename or delete old one...

the1killer commented 11 months ago

I will try and take a look this week or next but no guarantees, just reading the error message im guessing the output path for the file needs to change. Could try changing that to $SURVIVAL_DATA/Scripts/terrain/cells.json but thats just a wild guess.

the1killer commented 11 months ago

I managed to come up with a workaround, i did not write up the instructions yet so left it in a bugfix branch. Get the new terrain_overworld.lua file and use lines 132-160. It will output the json in the game's log, already minified, copy the text between the start/end lines

--- START COPYING
...
--- STOP COPYING

NOTICE!!!!

Make sure to leave off the logging prefix e.x. 16:19:17 (168914/331079) [Lua]

KEWINUR commented 10 months ago

Hi! I just changed this in my lua, but i don't find any log or json file. Where, or what should i look for?

I managed to come up with a workaround, i did not write up the instructions yet so left it in a bugfix branch. Get the new terrain_overworld.lua file and use lines 132-160. It will output the json in the game's log, already minified, copy the text between the start/end lines

--- START COPYING
...
--- STOP COPYING

Make sure to leave off the logging prefix e.x. 16:19:17 (168914/331079) [Lua]

KEWINUR commented 10 months ago

I found it, but the json text isn't working for me. The first part of it is working, but the other parts isn't, here is my json file. https://mega.nz/file/uyR1EbhT#u1qBcywSoN3UGOCDa4csbi981teQRacHEYTP9VQpDwQ

the1killer commented 10 months ago

I found it, but the json text isn't working for me. The first part of it is working, but the other parts isn't, here is my json file. https://mega.nz/file/uyR1EbhT#u1qBcywSoN3UGOCDa4csbi981teQRacHEYTP9VQpDwQ

It wont make a cells.json anymore it will be in steamapps/common/Scrap Mechanic/Logs/game-YYYYMMDD-HHMMSS.log so goto the logs dir and sort by date modified and should be in the most recent log after loading your save. Then look for the --- START COPYING

Aronardo commented 9 months ago

There's something wrong with my log. All text for JSON in one line. The site https://codebeautify.org/jsonminifier does not accept this text: "JSON data is not valid". Could you take a look and tell me what to do about this? JSON wrong.zip

the1killer commented 9 months ago

There's something wrong with my log. All text for JSON in one line. The site https://codebeautify.org/jsonminifier does not accept this text: "JSON data is not valid". Could you take a look and tell me what to do about this? JSON wrong.zip

You just need to remove this text at the begining, and its already minified so you can paste it directly into the html file: [[{12:56:20 (2821186/1081) [Lua]

MasterGleus commented 7 months ago

All this dosen't work for me. I Found this in my LogFile ;

... 11:50:54 (3211207/2212) [Default] Initializing world 1 11:50:54 (3211207/2212) [Lua] UpgradeCellData - version: 2 11:50:54 (3211207/2212) [Lua] - No upgrade needed 11:50:54 (3211207/2212) [Lua] ERROR: ..._DATA/Scripts/terrain/terrain_overworld.lua:137: attempt to call global 'GetLegacyID' (a nil value) 11:50:54 (3211207/2212) [Lua] ----- Lua Error Traceback ----- ..._DATA/Scripts/terrain/terrain_overworld.lua:137: in function 'doThis' ...DATA/Scripts/terrain/overworld/celldata.lua:299: in function 'forEveryCell' ..._DATA/Scripts/terrain/terrain_overworld.lua:133: in function 'Load' (Lua entered on line number: 112) 11:50:55 (3211207/2212) [Lua] UpgradeCellData - version: 2 11:50:55 (3211207/2212) [Lua] - No upgrade needed 11:50:55 (3211207/2212) [Lua] ERROR: ..._DATA/Scripts/terrain/terrain_overworld.lua:137: attempt to call global 'GetLegacyID' (a nil value) 11:50:55 (3211207/2212) [Lua] ----- Lua Error Traceback ----- ..._DATA/Scripts/terrain/terrain_overworld.lua:137: in function 'doThis' ...DATA/Scripts/terrain/overworld/celldata.lua:299: in function 'forEveryCell' ..._DATA/Scripts/terrain/terrain_overworld.lua:133: in function 'Load' (Lua entered on line number: 112) ...

GoldSwordKiller commented 4 months ago

This isn't working for me. Found this in logs referencing the lines that were added:

16:46:38 (3806774/1610) [Lua] UpgradeCellData - version: 2 16:46:38 (3806774/1610) [Lua] - No upgrade needed 16:46:38 (3806774/1610) [Lua] ERROR: ..._DATA/Scripts/terrain/terrain_overworld.lua:138: attempt to call global 'GetLegacyID' (a nil value) 16:46:38 (3806774/1610) [Lua] ----- Lua Error Traceback ----- ..._DATA/Scripts/terrain/terrain_overworld.lua:138: in function 'doThis' ...DATA/Scripts/terrain/overworld/celldata.lua:299: in function 'forEveryCell' ..._DATA/Scripts/terrain/terrain_overworld.lua:134: in function 'Load' (Lua entered on line number: 112)

the1killer commented 4 months ago

This isn't working for me. Found this in logs referencing the lines that were added:

16:46:38 (3806774/1610) [Lua] ERROR: ..._DATA/Scripts/terrain/terrain_overworld.lua:138: attempt to call global 'GetLegacyID' (a nil value)

You missed step 7 in the instructions, have to copy the tile_database.lua

GoldSwordKiller commented 4 months ago

You missed step 7 in the instructions, have to copy the tile_database.lua

That is embarrassing. Thanks for the reply ;-;