Array.At(1) only returns first character

Just started using Construct 2? Post your questions here

Post » Wed Sep 17, 2014 6:21 pm

Hi all,

I've worked with multidimensional arrays that seem to work. But now I have this problem:
- I have a one dimensional array that is loaded from JSON. In the debugger I can see that this is filled correctly.
- when I create a text-object and set text to Array.At(1), then only the first character is loaded in the text-object (also seen in debugger).

I already checked that the text-object is big enough to display the text.

Please help!

Mark
You do not have the required permissions to view the files attached to this post.
B
6
S
2
Posts: 7
Reputation: 466

Post » Sun Sep 21, 2014 11:42 am

i couldn't open your project file the zip file is damaged or somthing.
first the array index starts from 0 not 1 saw you are loading from 1. you might be loading the wrong position.
i don't know maybe you stored it in 1st pos . so i don't know what data you stored in the array i couldn't answer you properly.
B
12
S
6
Posts: 118
Reputation: 1,466

Post » Sun Sep 21, 2014 12:32 pm

Sorry your file is not opening it says damaged
B
256
S
39
G
15
Posts: 1,983
Reputation: 41,036

Post » Sun Sep 21, 2014 1:01 pm

It's a JSON file you need to rename it.

@markvk it looks like a 2d array not 1d. Anyway it still seems to work ok (that is I do not get just the first character). However you should index a 2d array with x,y values.
You do not have the required permissions to view the files attached to this post.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests