Quick question about punctuation when using print message function.

So I can't remember the answer to this from years ago, but when you use print the message function by which I mean
msg (" ")
how do you use quotes for character dialogue in the message? Because you have to encapsulate the entire message in quotation marks, to begin with, and if you enter them in the message in code like this
msg (" Ann looked at her friend and asked, "How do you do that?"")
Quest is confused by the second pair of quotation marks.
Second question: how do you make a new line in text from the print message function? ALso, is it possible to code an indentation?

You need to add another character to mark the double quotes as part of the string you want to print instead of the end of the string. This character is , so your code should look like this:

msg ("Ann looked at her friend and asked, \"How do you do that?\"")

Ann looked at her friend and asked, "How do you do that?"

As the text is basically parsed as HTML code, you can use HTML markers for stuff like that.

msg ("Message<br/>with<br/>linebreaks")


Edit: Forgot about the last one, but the same applies here, it just needs the combination of both using html code and escape sequencing double quotes:

msg ("<p style=\"margin-left: 40px\">This text is indented.</p>")

Thanks Gemini! It's good to be reminded about the slashes. I tend to use ' for my quotes because I keep forgetting those slashes.

There's also some libraries that someone called "8ne" or "EightOne" made in the libraries and code samples forum. https://textadventures.co.uk/forum/samples

One of them creates something in the editor for you to be able to choose "pring message in paragraphs" and type your message up more like you might in a word processor. Another is "Print message plus" which allows you to do the regular message, but choose things like bold, underline, italic for the whole message and/or center, left, right justified.

8ne - Message Plus 1.0 - Output Text with style elements 1 May 3, 2020 6:53 PM
8ne - New name: ScriptGames becomes EightOne (8ne)! 1 May 3, 2020 9:34 AM
8ne - OutputTextPar 1.0 - Output text in paragraphs 0 May 3, 2020 9:30 AM
8ne - ObjectExt 1.3 - Alias extensions for open, switch and in container 0 May 3, 2020 9:28 AM
8ne - UseAllround 2.6 - Use the 'use' verb global for opening/closing, switching and put on 0 May 3, 2020 9:25 AM
8ne - StyleSheet 2.4 - Extract and set modified CSS code from the game interface 0 May 3, 2020 9:24 AM
8ne - SetObjectCase 1.5 - Script add-on with which it is possible to set common object attributes more effectively 0 May 3, 2020 9:21 AM
8ne - RunObjectCase 1.0 - Executes the script or displays the text from the respective object case 0 May 3, 2020 9:20 AM
8ne - RunCommand 1.2 - Executes commands as in the command prompt

Yes, Thank you, GeminiNeule. I appreciate the help.

Log in to post a reply.