Page 2 of 2

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

Posted: Fri Oct 25, 2024 1:59 am
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.

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

Posted: Fri Oct 25, 2024 7:03 am
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;