Quotes in text

Started by warren, April 02, 2015, 08:59:38 PM

Previous topic - Next topic

warren

How do you get double quotes into strings in CRPL?

knucracker

You can't....
Consider using a single quote instead for any messages you want to show.

warren


Grayzzur

Never say "never."


"""" 1 1 Substring ->QUOTE

<-QUOTE "Hello World" <-QUOTE Concat Concat SetPopupText

TRUE SetPopupTextAlwaysVisible


I'm not sure what causes it, but there appears to be a bug where as long as a string contains ONLY double quotes, and ONLY and even number of them, they get through. Use Substring to chop it down to one, and sprinkle liberally.

I can't recommend actually using it though, as future patches to the game could "fix" the bug, and then your maps might break.
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker

warren

Holy **** that is cool.

planetfall

Alternatively you could give the script an input variable and type in a double-quote in the editor. Though that may get tedious if it's on several cores.
Pretty sure I'm supposed to be banned, someone might want to get on that.

Quote from: GoodMorning on December 01, 2016, 05:58:30 PM"Build a ladder to the moon" is simple as a sentence, but actually doing it is not.

knucracker

Quote from: Grayzzur on April 02, 2015, 10:37:54 PM
Never say "never."


"""" 1 1 Substring ->QUOTE

<-QUOTE "Hello World" <-QUOTE Concat Concat SetPopupText

TRUE SetPopupTextAlwaysVisible


I'm not sure what causes it, but there appears to be a bug where as long as a string contains ONLY double quotes, and ONLY and even number of them, they get through. Use Substring to chop it down to one, and sprinkle liberally.

I can't recommend actually using it though, as future patches to the game could "fix" the bug, and then your maps might break.

Ha... that is interesting,  I'd have thought that might be an empty string but thinking about how it gets parsed... yeah I guess so :)
"""" forms a single token.  I got lucky because the parser looks to see if the token starts with a quote.  If so, it looks at the end to make sure it ends with a quote.  Then it takes what is in the middle as a string.  I've not looked but there might be another check in the parser to look for an even number of quotes in a token as well.

The editor trick sounds interesting too.

This all goes to show that I'm officially not the best player, or even the best scripter :)  (I usually lose that first title on the first day of Alpha testing)


Grayzzur

Quote from: virgilw on April 03, 2015, 09:51:34 AM
This all goes to show that I'm officially not the best player, or even the best scripter :)  (I usually lose that first title on the first day of Alpha testing)
Without you there'd be no competition at all, and for that we thank you!
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker

Telanir

I thought that was pretty neat, I made a little comment on the Wiki here for this in case anyone else wonders. :)
Want to make genius CRPL? The new top map? You can start here!

Find out more about Creeper World 3 on the wiki!

CW3, The Sleeper Menace!

Own an iOS device? Check out my game Blobivers