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
38
S
15
G
6
Posts: 238
Reputation: 7,780

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
126
S
29
G
72
Posts: 5,029
Reputation: 51,368

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
38
S
15
G
6
Posts: 238
Reputation: 7,780

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
38
S
15
G
6
Posts: 238
Reputation: 7,780

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
262
S
93
G
55
Posts: 7,150
Reputation: 67,069

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
62
S
22
G
14
Posts: 1,481
Reputation: 16,405

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
262
S
93
G
55
Posts: 7,150
Reputation: 67,069

Post » Thu Jan 05, 2012 6:25 pm

Thanks!
B
38
S
15
G
6
Posts: 238
Reputation: 7,780


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 2 guests