Limit on the number of characters in label or text box

Started by Zrezal, Sat 03/12/2022 21:11:18

Previous topic - Next topic

Zrezal

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.

Crimson Wizard

#1
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.

Zrezal

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)

Zrezal

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.

Crimson Wizard

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
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
String s = "first part of the long string";
s = s.Append("second part of the long string");
// and so on

SMF spam blocked by CleanTalk