The character [ is normally used to indicate a line break in strings, e.g. "Here comes [ a line break".
But how do I mask the character so it is displayed in dialogs/messages?
\[ doesn't work, nor does \\[ or /[
Edit:
AGS v2.7 Beta 11:
Quote* Added \[ to Display/Say/etc, to enable you to display the [ character rather than it doing a line break.
I don't have an answer, but a related question:
How do I display " in a string?
Display("These are called \"quotemarks\" ");
Check this page (http://americangirlscouts.org/agswiki/index.php/Category:Tidbits_and_Snippets) for more.
Thanks... I must have glanced over the "tidbits & snippets" thread about six times by now, but somehow this bit of info never stuck...
QuoteThe character [ is normally used to indicate a line break in strings, e.g. "Here comes [ a line break".
But how do I mask the character so it is displayed in dialogs/messages?
I remember it was a problem for me too when I try to create my own font which actually used that character. I had to replace it with another one. I'm not sure if it's at all possible to display it somehow. I wish AGS broke a line with '\n' :P
How about Display("Here comes %s a line break", "[");
Does that work? (too lazy to try it, sorry!)
Nope. The result looks something like
------------------
Here comes
a line break
------------------
Hmm, good question. I'm not actually sure that it's possible; and it's not a trivial matter to add some sort of \[ support, because it's the engine's interpretation of the character, not the script compiler, that has the problem.
I suppose adding a special sequence like %[ could represent the real thing, but that seems to be getting rather messy. Hmm.
Sorry to bring this up again, but would it be possible to reserve some obscure extended character instead? Since it won't have to be displayed anyway, there should be no problems with SCI fonts.
Just a thought.
Well, I don't want to change the character from [ at this stage, but adding some sort of escape sequence to print a real [ is a possibility.
I suppose %[ would probably do the trick, unless there are any objections?
The default message for clicking on that question mark icon had a message with a break in it which used [[. That has worked for me, but maybe it doesn't in the new version.
Quote from: Pumaman on Thu 06/01/2005 20:18:00
Well, I don't want to change the character from [ at this stage, but adding some sort of escape sequence to print a real [ is a possibility.
I suppose %[ would probably do the trick, unless there are any objections?
Why not /[ ? Like /"
I believe that would be a better idea. If anybody ever wanted to end a line with a forward-slash, they could simply use "/ [" with the space in between.
Quote from: Pod on Fri 07/01/2005 13:17:50
Quote from: Pumaman on Thu 06/01/2005 20:18:00
Well, I don't want to change the character from [ at this stage, but adding some sort of escape sequence to print a real [ is a possibility.
I suppose %[ would probably do the trick, unless there are any objections?
Why not /[ ? Like /"
If you're going to use a slash for an escape character, please use a backslash, like perl, csh, tcl, lisp, regexps, C, etc.
Alternatively, use one of the obscure characters such as ~ and edit the font to change its appearance to a [
Ok, I'll add \[ to the next beta.