Internal String length max?

Discussion and feedback on Construct 2

Post » Sun Jun 24, 2012 6:31 pm

Ive been workin on a level editor the last few days and now that its finished enough to start testing in actual use Ive hit a pretty big snag and I cant tell exactly where its comin from.

Im hittin a limit on the length of a string at 2000 characters. I cant tell if thats the limit of the string inside c2 or the limit of the characters that can be put into the input box of the Dialog Box plugin.

Ive looked at the plugin code and cant see anywhere that looks like it would effect the that could it could be some general javascript limit as well.

Anyone have any input that might help?
B
13
S
5
G
2
Posts: 306
Reputation: 3,262

Post » Sun Jun 24, 2012 6:38 pm

There's always going to be a limit somewhere down the line. Especially since browsers do things differently.

I'd suggest splitting things up a bit. Put all your x's in one string, y's in another, etc.
It might also be practical to use whole numbers, without any decimals.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Sun Jun 24, 2012 6:51 pm

yeah Im splitin things up now workin on gettin it all sorted out. It seems the limit is the number the inputbox of the dialog box plugin can display. The len of the string returned fine over 2k but still only 2k in the input box.

Now I just need to figure out a better way to get the map save data from the app to the user and back again. The only way I know to do it is with the dialog box.

How else can I save and/or load text during runtime?
B
13
S
5
G
2
Posts: 306
Reputation: 3,262

Post » Sun Jun 24, 2012 7:14 pm

You might try a variable. Then concatenate the string when you reach a limit.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Sun Jun 24, 2012 7:40 pm

How about creating your own input dialog with a textbox? That's what I'm doing and I have strings nearly 4000 chars long.
B
54
S
28
G
18
Posts: 1,520
Reputation: 24,990

Post » Sun Jun 24, 2012 8:36 pm

I just decided to do it with php instead. Since its gonna be on my website anyway I figured might as well
B
13
S
5
G
2
Posts: 306
Reputation: 3,262

Post » Sun Jun 24, 2012 11:19 pm

I'm not aware of any text length limits in either Construct 2's runtime engine or browsers themselves. It's probably more convenient anyway to put it in a project file and AJAX request it anyway. (PHP is overkill for that if you only need a static file.) See Using project files.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Mon Jun 25, 2012 2:24 pm

its not static tho. Its saving/loading the created maps during runtime. Plus the game engine needs to be able to access em too not just the editor. So I went with php. Plus it adds the benefit that no one can read the map files and see everything they shouldnt
B
13
S
5
G
2
Posts: 306
Reputation: 3,262

Post » Tue Jun 26, 2012 9:03 am

I believe there is a limit to URI length, depending on browser and webserver. IE (8 and 9), for example, is limited to 2048 characters in the URL or some such. This affects POST and GET requests used by AJAX.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Tue Jun 26, 2012 7:51 pm

I ran into that problem with get and I switched to usin the ajaxpost plugin and it worked fine and has since

The plain and simple of this is: these just no GOOD way to do it. Period.
B
13
S
5
G
2
Posts: 306
Reputation: 3,262

Next

Return to Construct 2 General

Who is online

Users browsing this forum: blackant, newt and 2 guests