How do I update parts of an array (with nested loops)?

Get help using Construct 2

Post » Sun May 11, 2014 7:48 pm

I have an 2-dim array, where i want to remember my level setup based on tiles. After i´ve generated a room, i want to set it´s number into my memory (the array) for every tile it occupies. I´ve tried a nested loop, write the number in to the affected x,y coordinates and try to read it again to log it into a textbox.

but the textbox is filled with zero´s although the Room.Nr is 1. I´ve also tried a fixed value, but still zeros. Here is my "algorithm":

https://www.dropbox.com/s/parsfwjf0rjakdb/update-array-with-nested-loop.PNG

Any idea, why it is not working? The iteration seems correct (tested by another logging of loopindex x;y)
B
5
S
1
Posts: 4
Reputation: 288

Post » Mon May 12, 2014 4:49 pm

Doh! I´ve set the Depth of the Array to 0. After reading (again!) the manual more carefully, i´ve recognized, that this will result into an invalid array (in DEbug view you can even see the total amount of Elements = 0).

While i solved this issue, it should be avoidable by construct itself (usability !!!).

Jakob
B
5
S
1
Posts: 4
Reputation: 288


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 40 guests