Page 1 of 1

saving data into "storage" is not working for me (solved)

Posted: Tue Dec 17, 2024 4:46 pm
by CyberWizard2261
Can someone help me find what's wrong with my code? it looks like I can't save complex objects in the storage variable

Code: Select all

function tesseract_game:save()
	if self.tesseracts ~= nil then
		storage.tesseracts = self.tesseracts
	end
	if self.pointers ~= nil then
		storage.pointers = self.pointers
	end
end
I use this save method every time I modify the data but it looks like storage is only saving tesseracts and pointers with empty tables

Re: saving data into "storage" is not working for me

Posted: Wed Dec 18, 2024 9:07 am
by Natha
https://lua-api.factorio.com/latest/aux ... orage.html
There you find information which objects can be saved

Re: saving data into "storage" is not working for me (solved)

Posted: Thu Dec 19, 2024 10:17 am
by CyberWizard2261
found the problem: I forgot to use script.register_metatable after setting the meta-table