How to use quotations marks for speaking in an expression?

zephtest
20 Mar 2022, 12:31

This has probably been asked already, but I must be searching wrong, because I can't find the answer.

So when you print an expression, you use quotation marks to indicate the text. But what if you want quotation marks within the text? How do I do that? For example, what I have right now is:

"Thanks, " + player.alias + ". That was really helpful."

But (assuming the player alias is set to Bob), that outputs as:

Thanks, Bob. That was really helpful.

How do I make it so it outputs as a quote? As in:

"Thanks, Bob. That was really helpful."

Thanks in advance.


ShadowsEdge19
20 Mar 2022, 17:00

Use an escape character \

msg("There is a man in front of you, \"Hello there!\" he says.")

mrangel
20 Mar 2022, 17:56

An alternative is to use quote characters other than the standard ASCII quote. For example, the fancier 'left quote' and 'right quote' characters don't have any special meaning.
So you can do:

msg ("Bob said “Hi”.")

(I made a big example so it's easier to see the difference)