[Solved] Save game blowing up with my custom dungeon

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
MrChoke
Posts: 324
Joined: Sat Oct 25, 2014 7:20 pm

Re: [Solved] Save game blowing up with my custom dungeon

Post by MrChoke »

minmay wrote:
MrChoke wrote:The stack trace gives nothing on the source of the bad variable. The message itself always talks about "cannot concatenate ID... etc", never giving the ID of the variable giving problems. You get nothing to help you find the source. I don't even think it says the word "serialized". So basically Minmay, I don't know what you are talking about when you say it tells you anything.
Really? All I ever saw was:
"cannot serialize variable of type X"
"cannot serialize table with metatable"
"cannot serialize function with upvalues"
etc..

Can you give me an example of a case where it gives "cannot concatenate..."?
Wow, yeah we are getting different errors. Well I just exported my dungeon right now and it puked on the save issue. I guess I have more annoying work again to fix it. I always get this error:

Code: Select all

=== Software Failure ===

[string "Script.lua"]:0: attempt to concatenate field 'id' (a nil value)
stack traceback:
	[string "Script.lua"]: in function 'saveValue'
	[string "Script.lua"]: in function 'saveValue'
	[string "Script.lua"]: in function 'saveState'
	[string "GameObject.lua"]: in function 'saveState'
	[string "Map.lua"]: in function 'saveState'
	[string "GameMode.lua"]: in function 'saveGame'
	[string "SaveGameMenu.lua"]: in function 'update'
	[string "GameMode.lua"]: in function 'update'
	[string "Grimrock.lua"]: in function 'display'
	[string "Grimrock.lua"]: in main chunk
User avatar
Sutekh
Posts: 129
Joined: Sun Nov 25, 2012 9:58 am
Location: UK

Re: [Solved] Save game blowing up with my custom dungeon

Post by Sutekh »

I decided to export and save my own dungeon to see if it had any problems, and ended up with the same error message as MrChoke.
While it could be something completely different, I managed to track my error down to my script for adding starting items - it was to do with trying to add a torch and compass.
I tried to fix the problem by changing a few things, but got other issues that I wasn't happy with when I did. In the end, I just simply removed that part of the script entirely and updated it in my post: viewtopic.php?f=22&t=8342

Thorham has also come up with a much better script anyway: viewtopic.php?f=22&t=8958

So anyone using my old script will need to change it to avoid getting the same error.
Sorry about that, and I hope it helps you find your problem, MrChoke.
Post Reply