Cunning fox Posted January 19, 2018 Share Posted January 19, 2018 (edited) Hi everyone. I'm trying to make my own component so I'll be able to save prefab in some player. I used "LoadPostPass" for this function BellOwner:LoadPostPass(newents, savedata) print("BellOwner:LoadPostPass") if savedata ~= nil and savedata.bells_guids ~= nil then for k,v in pairs(savedata.bells_guids) do local BellEnt = newents[savedata.bells_guids[v]] print(tostring("BellEnt = "..BellEnt.entity)) if BellEnt then table.insert(self.all_bells, BellEnt.entity) end end if savedata.main_bell then local MainBell = newents[savedata.main_bell] print("MainBell = ".. tostring(MainBell.entity)) if MainBell then self.main_bell = MainBell.entity end end end end It saves, and when the world is reloaded, self.all_bells and self.main_bell are nil. I've added thi component using this AddPlayerPostInit(function(inst) inst:AddComponent("bell_owner") end) Any ideas how to fix this? Edited January 19, 2018 by Cunning fox 1 Link to comment Share on other sites More sharing options...
zombieJ Posted February 19, 2018 Share Posted February 19, 2018 I meet the same problem and search the related topic. It seems LoadPostPass not work since 2014. I guess it should find another way to do workaround. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now