Page 2 of 2

Re: Need help at updating saved simstatus

Posted: Tue Jul 14, 2020 11:38 pm
by RX-310
One other thing occurred to me: Are you using multiple databases?
No, just one. Can you please explain how this ExpandSimStatusForConversation() method works?

Re: Need help at updating saved simstatus

Posted: Wed Jul 15, 2020 8:29 am
by Tony Li
At runtime, SimStatus is stored in Lua tables. So you might have a table in Lua code such as:

Code: Select all

Conversation[42].Dialogue = { {1,{SimStatus="WasDisplayed"}}, {2,{SimStatus="WasDisplayed"}}, {4,{SimStatus="Untouched}}}, etc.
To keep saved games smaller, the PersistentDataManager stored a compressed representation such as:

Code: Select all

Conversation[42].SimX={1:d, 2:d, 4:u}
When restoring a saved game, PersistentDataManager expands this out to the full Lua tables.

If you define the scripting define symbol SAFE_SIMSTATUS, it will log the process of handling SimStatus saving. It will also run the extra InitializeNewSimStatus method, which is does an extra check to make sure all SimStatus values are present, at the cost of a longer restore time of course.