Jump to content

Recommended Posts

So I'm working on a mod that has pets, but I'm having trouble with saving. I have the following code for saving my character:

local function OnSave(inst, data)
	data.pets = {}
	for k,v in ipairs(inst.pets) do
		data.pets[k] = v:GetSaveRecord()
	end
end

But this code gives me the following error:

[string "scripts/dumper.lua"]:112: Cannot dump userdata (DynamicShadow (1DBC1E48) - unknown)
LUA ERROR stack traceback:
=[C]:-1 in (global) error (C) <-1--1>
scripts/dumper.lua:112 in () ? (Lua) <98-113>
   value = DynamicShadow (1DBC1E48)
   var = nil
   i = 8
=(tail call):-1 in ()  (tail) <-1--1>
scripts/dumper.lua:151 in () ? (Lua) <141-159>
   value = 106687 - satori (valid:true)
   numidx = 1
   key = DynamicShadow
   val = DynamicShadow (1DBC1E48)
...

For some reason, I only have this problem when I'm saving pets from the character. I've made components before that could save and load them just fine before. But the moment I put the same code into my character, I get this error. I've looked up this problem, and saw this post from a year ago, but a solution was never given. I'm at complete loss at what to do here, and I'd really prefer to not make a component.

 

Link to comment
https://forums.kleientertainment.com/forums/topic/64879-cannot-dump-userdata/
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...