Page 2 of 2

Re: Best way to swap portrait sprites?

Posted: Sun Aug 22, 2021 11:49 am
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.

Re: Best way to swap portrait sprites?

Posted: Sun Aug 22, 2021 2:02 pm
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..."))]

Re: Best way to swap portrait sprites?

Posted: Fri Sep 03, 2021 7:23 pm
by mac
Got it Tony, thank you :)

Re: Best way to swap portrait sprites?

Posted: Fri Sep 03, 2021 9:03 pm
by Tony Li
Glad to help!