Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Zrezal on Sat 03/12/2022 21:11:18

Title: Limit on the number of characters in label or text box
Post by: Zrezal on Sat 03/12/2022 21:11:18
I'm a little confused about the limit on the number of characters that can be put in a label or text box. I believe the limit was removed, however, it still gives me an error if it exceeds 500 characters.
Will this restriction be removed soon? It is important for my game, where I need to put long text strings.
Title: Re: Limit on the number of characters in label or text box
Post by: Crimson Wizard on Sat 03/12/2022 21:42:47
Please tell which version of AGS are you using, and what error message do you get? Also, do you get error in the editor or when running the game?

If this is a error you're getting when compiling the script, that's likely a limitation of compiler, and may be avoided by splitting the text into 2 or more parts, and appending them together using String.Append or String.Format.
EDIT: Ah, it looks like this limit was also removed in 3.6.0 already. But it may still exist in previous versions.
Title: Re: Limit on the number of characters in label or text box
Post by: Zrezal on Sun 04/12/2022 10:15:49
I am using version 3.5.1 and I get the error when compiling.
The error message is this: Failed to save room room1.crm; details below
room1.asc(11): Line too long (max line length = 500)
Title: Re: Limit on the number of characters in label or text box
Post by: Zrezal on Sun 04/12/2022 10:22:06
Quote from: Crimson Wizard on Sat 03/12/2022 21:42:47Please tell which version of AGS are you using, and what error message do you get? Also, do you get error in the editor or when running the game?

If this is a error you're getting when compiling the script, that's likely a limitation of compiler, and may be avoided by splitting the text into 2 or more parts, and appending them together using String.Append or String.Format.
EDIT: Ah, it looks like this limit was also removed in 3.6.0 already. But it may still exist in previous versions.
It is now fixed, I downloaded version 3.6 and it works perfectly.
Title: Re: Limit on the number of characters in label or text box
Post by: Crimson Wizard on Sun 04/12/2022 12:19:20
Quote from: Zrezal on Sun 04/12/2022 10:22:06It is now fixed, I downloaded version 3.6 and it works perfectly.

You did not have to, and 3.6.0 is not fully complete and may have new bugs which are still not fixed.

Like I mentioned, the solution in 3.5.1 is to split the text into several lines. It's done like this:
Code (ags) Select
String s = String.Format("%s%s%s%s",
 "first part of the long string",
 "second part of the long string",
 "third part of the long string",
 "fourth part of the long string");

Or this:
Code (ags) Select
String s = "first part of the long string";
s = s.Append("second part of the long string");
// and so on