Best way to swap portrait sprites?

Announcements, support questions, and discussion for the Dialogue System.
mac
Posts: 81
Joined: Sat Aug 22, 2020 7:54 pm

Re: Best way to swap portrait sprites?

Post by mac »

I see, thank you Tony!
Another small question, how can I use the RPGMaker pause with the lua RandomElement? Thats what I'm doing

Code: Select all

[lua(RandomElement("Sure, why not.|I think I could spare a few minutes...\.If it helps, ask away..."))]
And the " \. " breaks the script:
Dialogue System: Lua code 'return RandomElement("I think I could spare a few minutes...\.If it helps, ask away...|I think I could spare a few minutes...\.If it helps, ask away...")' threw exception 'Code has syntax errors:
Line 1, Col 61 '\': Failed to parse '\"' of StringLiteral.
User avatar
Tony Li
Posts: 21986
Joined: Thu Jul 18, 2013 1:27 pm

Re: Best way to swap portrait sprites?

Post by Tony Li »

Hi,

Inside strings, use two backslashes: \\.

Example:

Code: Select all

[lua(RandomElement("Sure, why not.|I think I could spare a few minutes...\\.If it helps, ask away..."))]
mac
Posts: 81
Joined: Sat Aug 22, 2020 7:54 pm

Re: Best way to swap portrait sprites?

Post by mac »

Got it Tony, thank you :)
User avatar
Tony Li
Posts: 21986
Joined: Thu Jul 18, 2013 1:27 pm

Re: Best way to swap portrait sprites?

Post by Tony Li »

Glad to help!
Post Reply