Need help at updating saved simstatus

Announcements, support questions, and discussion for the Dialogue System.
RX-310
Posts: 22
Joined: Tue Jan 21, 2020 7:50 pm

Re: Need help at updating saved simstatus

Post 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?
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: Need help at updating saved simstatus

Post 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.
Post Reply