Inconsistent Array behaviour?

Get help using Construct 2

Post » Mon May 07, 2012 1:58 am

Click image to test :


EDIT - [Oops Linked the game not the editor!]


For some reason , even though an identical loop is used to create the main layout ( Press space to fill with red blocks, backspace to clear) , when it does the same for the thumbnail image, if fails to draw the last line.

I'm doing nothing different in the smaller loop, other than changing the positional offset/scale on the output, the reading via two loops is still the same.

You can see in the example image I've drawn a green border on the perimeter which is written to the array, however it fails when output again to the thumbnail size ( as you can see the bottom green line is misisng)

Download the CAPX

The capx uses Mipey's Sprite Font plugin - which I'd recommend everyone has. :)JohnnySix2012-05-09 05:10:04
Image
B
27
S
9
G
5
Posts: 487
Reputation: 11,939

Post » Mon May 07, 2012 2:36 am

Set the Array size to (Cols+1, Rows+1, 1)
Otherwise the biggest column and row will be Cols-1 and Rows-1.
The array's bottom row was lost since Array.At(x,Rows) was outside the array and wasn't saved.
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Mon May 07, 2012 10:30 pm

Thanks so much! Simple things eh!?

I got a fully functioning save/load function. :)

Image
B
27
S
9
G
5
Posts: 487
Reputation: 11,939

Post » Tue May 08, 2012 1:31 am

So I've got a problem loading the array from the json string - for one you can't paste the json string into an instance variable slow as it contains double quotes.

If anyone's interested in taking a look, I can PM the code.

Copying the JSON from a text box works in the editor, but for some reason, with identical code, will not load within the game. :P
Image
B
27
S
9
G
5
Posts: 487
Reputation: 11,939

Post » Tue May 08, 2012 8:42 pm

To store a JSON string as a variable just replace the " with "".
B
54
S
28
G
18
Posts: 1,520
Reputation: 24,990

Post » Wed May 09, 2012 1:51 am

Music = What. The. Heck.
heh heh :D
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400


Return to How do I....?

Who is online

Users browsing this forum: Maced0, Magistross and 2 guests