Print expression

The Ogre is speaking. I want to print an expression. Does this look okay to you?

"The Ogre speaks "Goodbye"" + player.alias + "."

Is that giving you an error? I can't tell on this screen size if you're using regular quotes or smart quotes.

When the IASL interpreter sees a double quote ("), it treats everything up to the second quote as a string, and then looks for an operator (usually a +) to connect it to another string. If you're using regular quotes there, you would have the string "The Ogre speaks " after which Quest is expecting to see a + to tell it there's another string coming, or a ) to tell it this is the end of the line.

If you want to include quotation marks in a string, you can either use smart/curly quotes (which Quest ignores because they aren't "):

"The Ogre speaks “Goodbye”" + player.alias + "."

or include backslashes (which tell it to ignore the special meaning of the following character):

"The Ogre speaks \"Goodbye\"" + player.alias + "."

I tend to use "ASCII quotes" when they're part of the code, and smart quotes when they're intended to be seen by the player, which makes the output a little prettier as well as avoiding errors.


Thank you.

"The Ogre speaks \"Goodbye " + player.alias + "\" ."

Just Googled how to type smart quotes --

Turn on “Number Lock” on your keyboard, hold down the “alt” key, then type “0147” for left smart quotes and “0148” for right quotes (on Windows computers).

And that's one to grow on...

EDIT -
When you type the numbers, you have to type them from the number pad.


“I have to do it like this on Arch Linux.”

“I have to do it like this on Arch Linux.”


EDIT

And it only works in the preview.

image


EDIT 2

But I can copy them from the displayed preview area and copy them here.

“Check it out!”

Peek 2021-01-23 11-21


“I have to do it like this on Arch Linux.”

Most linux distros allow you to configure a 'compose key', usually somewhere in your keyboard settings. I used Caps Lock. You can type the compose key followed by a sequence of letters to type symbols.

Smart quotes are accessible using the sequences "< and "> (as well as '< and '>). Easier than the numbers you have to remember in windows.

Other common compose sequences include:

  • a" → ä (also combining many letters with `, ', ^, -, and ~ for various accents)
  • c, → ç
  • tm → ™
  • xx → ×
  • :- → ÷
  • ^2 → ² and _2 → ₂ (the same pattern works for all subscript and superscript numbers)
  • Y= → ¥
  • ae → æ
  • 0* → ° (note - 0* and *0 are both the degree sign; a lot of these sequences are the same swapped round. But not to be confused with ^0 = ⁰, superscript zero)
  • ss → ß
  • :) → ☺
  • p! → ¶ (useless trivia of the day: this typesetting symbol is called a pilcrow)
  • .^ → · (useful for emphasis)
  • --- and --. for — and – (dashes the same width as the letters 'm' and 'n' respectively)
  • >= → ≥
  • <- and -> → ← and →
  • #q, #e, #E, and #S → ♪♫♬(OK, [compose],[#],[q] appears to generate the wrong character; but copying and pasting it reveals that it's the font that seems to have that character mapped onto the wrong glyph)

(many of the same sequences are available on Hacker's Keyboard on android, where a long press on the circle key is Compose)


Most linux distros allow you to configure a 'compose key', usually somewhere in your keyboard settings. I used Caps Lock. You can type the compose key followed by a sequence of letters to type symbols.

Whoo-hoo! A fun side-mission!


Log in to post a reply.

Support

Forums