Array bug

Discussion and feedback on Construct 2

Post » Thu Jan 05, 2012 5:48 pm

2 identical projects here
First from Construct 2, second from Construct classic

This is an example of saving and loading data from an array but in project from Construct 2 there is a problem with array.

System must create blocks on it's coordinates from array and it's works fine except first of them. It is created by the coordinates 0,0

.caps
B
39
S
16
G
6
Posts: 238
Reputation: 7,885

Post » Thu Jan 05, 2012 5:49 pm

Did you remember that in C2 arrays are zero based?
If your vision so exceeds your ability, then look to something closer.
Moderator
B
129
S
29
G
77
Posts: 5,194
Reputation: 54,293

Post » Thu Jan 05, 2012 5:52 pm

[QUOTE=zenox98] Did you remember that in C2 arrays are zero based?[/QUOTE]

Damn you, exactly.

B
39
S
16
G
6
Posts: 238
Reputation: 7,885

Post » Thu Jan 05, 2012 6:00 pm

[QUOTE=zenox98] Did you remember that in C2 arrays are zero based?[/QUOTE]

Okay, i changed it. But it still creates one more block

.capxVladoss2012-01-05 18:01:18
B
39
S
16
G
6
Posts: 238
Reputation: 7,885

Post » Thu Jan 05, 2012 6:17 pm

Event 8
For "load" is 0 to array.width -1

Make it array.width - 1 since the array is 0 based, but the width is 1 based. (you count from 1 to the max number of cells)
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
276
S
103
G
84
Posts: 7,289
Reputation: 83,098

Post » Thu Jan 05, 2012 6:19 pm

Not a bug, you just missed something
ArraySaveLoadSystem.capx

@Kyatric ninja /o/
Last edited by Yann on Sun Sep 14, 2014 10:19 pm, edited 1 time in total.
B
64
S
22
G
14
Posts: 1,482
Reputation: 16,457

Post » Thu Jan 05, 2012 6:20 pm

@Yann: Nice solution
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
276
S
103
G
84
Posts: 7,289
Reputation: 83,098

Post » Thu Jan 05, 2012 6:25 pm

Thanks!
B
39
S
16
G
6
Posts: 238
Reputation: 7,885


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 6 guests