How should I go about using the Save System for Visual Novel Values?

Announcements, support questions, and discussion for the Dialogue System.
2linescrossed
Posts: 47
Joined: Tue May 16, 2023 10:37 pm

Re: How should I go about using the Save System for Visual Novel Values?

Post by 2linescrossed »

Figured out what I was doing wrong again - I had used the wrong ToString method in the saver itself, which I fixed by changing the toStrings to

Code: Select all

data.playerName = FormattedText.ParseCode("[var=PCName]");
        data.tokens = FormattedText.ParseCode("[var=PlayerTokens]");
The issue was that I was saving the original Summary file's data as ToStrings, which don't work with the Lua system. So I had thought I was doing something wrong in the summary retriever, when in actuality, I had simply been getting the ToString outputs - the 'Lua GetResult' stuff that was incorrect.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: How should I go about using the Save System for Visual Novel Values?

Post by Tony Li »

That works! You could also use this, which is slightly more efficient -- not that it matters in this case.

Code: Select all

data.playerName = DialogueLua.GetVariable("PCName").asString;
data.tokens = DialogueLua.GetVariable("PlayerTokens").asString;
Post Reply