![]() |
gs2 line breaks?
How do you do line breaks in gs2? Is it still #b? I'd doubt it.
|
\n
|
Short and simple... ^_^ ( Napo got it )
|
Well it depends.
You can do say2("Hello!\nThis is the next line."); or you can do say2("Hello! This is the next line."); The second way is easier readable if you have long text I guess. |
RC always escapes \n for me when it is used in a script. Hitting end it will be converted from \n to \\n
|
Quote:
|
Quote:
say2("Hello!\n" + "This is the next line."); ?? |
Quote:
1) Stefan made GS1 and GS2, I'd assume he knows exactly what he's talking about regarding GraalScript, and I'd be supprised if someone corrected him on something completely wrong. 2) The character you want to use is '@', not '+'. The addition character treats both the strings as numbers and then tries to add them. I'm believing since both the strings are not NULL, you'll get a message saying '2'. 3) Scripted line breaks are string line breaks, but the only exception is that the line break is contained within the string. (Someone correct me on this, mmkay?) I'd say use Stefan's idea for big, long messages, and use the "string\nstring" idea for shorter messages. The NPCServer's sendpm on a player's login uses Stefan's idea, typically, although I think I've seen it done the other way. I don't remember. Anyway, use whichever way you please: either contain a line-break within the quotes, or contain a \n within the quotes. Up to you. |
Quote:
\n is an escaped character which is eventually replaced by a line break. Thus, using \n is unnecessary for many new lines, since HTML Code:
say2("HELLO\n" @HTML Code:
say2("HELLOHTML Code:
say2("HELLO |
Probably old RC?
|
Quote:
Still I'd prefer temp.message = "blah\n" -indentation- @ "blah" say2(temp.message); just so I could line up the bottom string with the top string. I think that's a lot better readability, so you can see how all of the text lines up. Maybe even temp.message = "blah" @ "\n" -indentation- @ "blah" say2(temp.message); |
| All times are GMT +2. The time now is 08:38 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.