Cliffford W. Posted February 13, 2024 Share Posted February 13, 2024 For some unknown reason the code i used doesnt even work at all local function RollSave(inst) local data = { livesleft = inst.numDeaths } return next(data) ~= nil and data or nil end local function RollLoad(inst, data) print("LOADING FOR REROLL") if data.livesleft ~= nil then inst.numDeaths = data.livesleft end end --this is put in master_postinit of a character prefab inst.SaveForReroll = RollSave inst.LoadForReroll = RollLoad Link to comment https://forums.kleientertainment.com/forums/topic/154283-saveforreroll-and-loadforreroll/ Share on other sites More sharing options...
_zwb Posted February 13, 2024 Share Posted February 13, 2024 You should use inst.Save and inst.Load, unless you called inst.SaveForReroll somewhere else? Link to comment https://forums.kleientertainment.com/forums/topic/154283-saveforreroll-and-loadforreroll/#findComment-1698544 Share on other sites More sharing options...
Cliffford W. Posted February 13, 2024 Author Share Posted February 13, 2024 (edited) inst.SaveForReroll is used for when you switch characters or when seamlessplayerswapper takes place (Wonkey) Edited February 13, 2024 by Cliffford W. Link to comment https://forums.kleientertainment.com/forums/topic/154283-saveforreroll-and-loadforreroll/#findComment-1698547 Share on other sites More sharing options...
The Starver Posted February 13, 2024 Share Posted February 13, 2024 31 minutes ago, Cliffford W. said: when seamlessplayerswapper takes place (Wonkey) Wait, does this mean I could theoretically implement a mod where every 10 days your character changes randomly? Link to comment https://forums.kleientertainment.com/forums/topic/154283-saveforreroll-and-loadforreroll/#findComment-1698552 Share on other sites More sharing options...
Cliffford W. Posted February 13, 2024 Author Share Posted February 13, 2024 5 minutes ago, The Starver said: Wait, does this mean I could theoretically implement a mod where every 10 days your character changes randomly? Basically yea 1 Link to comment https://forums.kleientertainment.com/forums/topic/154283-saveforreroll-and-loadforreroll/#findComment-1698553 Share on other sites More sharing options...
Rickzzs Posted February 13, 2024 Share Posted February 13, 2024 I think it works. I do it by wrapping inst.xxx after spawning in prefabpostinit, it works for reroll. Link to comment https://forums.kleientertainment.com/forums/topic/154283-saveforreroll-and-loadforreroll/#findComment-1698606 Share on other sites More sharing options...
Cliffford W. Posted February 16, 2024 Author Share Posted February 16, 2024 Figured it out with help of DiogoW Link to comment https://forums.kleientertainment.com/forums/topic/154283-saveforreroll-and-loadforreroll/#findComment-1698971 Share on other sites More sharing options...
yanecc Posted September 3, 2024 Share Posted September 3, 2024 So, what's the problem with the code above? Could you please provide some details about the right one? Link to comment https://forums.kleientertainment.com/forums/topic/154283-saveforreroll-and-loadforreroll/#findComment-1745617 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