WTF! I'm just trying a simple array!

Discussion and feedback on Construct 2

Post » Wed Sep 17, 2014 3:46 am

Is it just me? Pictures are with a thousand words. I can't figure out why i am not get 5 columns by 7 rows for a total of 35 gems. The debugger is showing 36 (correct original off screen) and its rendering 34,

Have I been staring at it to long or what?
gemgrid_2.jpg


Here the debuuger shot, does not make sense.
gemgrid_1.jpg


An notice that 1 Gem is missing from column 5
gemgrid_3.jpg




Extra eyes and any help resolving this would be much appreciated.
You do not have the required permissions to view the files attached to this post.
[b]Andrew Donelson[b]
Nlaak Studios, LLC
https://www.nlaak.com/
[email protected]
B
15
S
3
Posts: 66
Reputation: 1,136

Post » Wed Sep 17, 2014 4:18 am

a) you haven't set your array dimensions; the default is 10x1x1, which is what the debugger is showing. b) you are creating a 'gem' at the same time you are referencing it's own width. Try using a fixed width, so you will get an even grid.
ImageImageImage
B
71
S
22
G
240
Posts: 3,734
Reputation: 133,994

Post » Wed Sep 17, 2014 8:55 am

what blackhornet said. I do this often. Very irritating that I have to manually set the dimensions either via properties or via eventsheet.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718

Post » Wed Sep 17, 2014 9:03 am

Yep, this caught me out the first time. You have set your array dimensions first as they don't auto expand.
ImageImageImageImageImage
B
19
S
5
G
1
Posts: 614
Reputation: 2,542

Post » Wed Sep 17, 2014 9:03 am

I don't understand how it can be irritating having to set the array dimensions. Do you expect it to know what dimensions you want by magic ;/
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
86
Posts: 5,415
Reputation: 59,516

Post » Wed Sep 17, 2014 9:32 am

zenox98 wrote:I don't understand how it can be irritating having to set the array dimensions. Do you expect it to know what dimensions you want by magic ;/

Lol, I develop my array as I go, and forget to increase it's dimensions, and can't access new data.
I load it via json, and forgot to update the dimensions to reflect new changes - my array is always a work in progress, adding more and more width/height/depth etc... so my changes don't reflect because I failed to update the dimensions. This is what irritates me, "the oversight on my part", wish I could just magically have the numbers appear - lol

Insurance companies know they can beat my current insurance company, they will even give me a detailed comparision, for free so why can an array not know its own dimensions - :lol: (yip just got called again... Argh!)
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718

Post » Wed Sep 17, 2014 10:05 am

@zenox98 it doesn't have to be by magic since it can be derived from when you set the values in the array. However, it doesn't bother me other than it not throwing an error when you're setting a value out of bounds.
ImageImageImageImageImage
B
19
S
5
G
1
Posts: 614
Reputation: 2,542

Post » Wed Sep 17, 2014 11:13 am

Often you can use Push/Pop and/or Set Size to manipulate the size of the array. I'm using Push Back in an app I'm currently developing to dynamically increase the size of an array.
Last edited by codah on Wed Sep 17, 2014 9:23 pm, edited 1 time in total.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Wed Sep 17, 2014 2:14 pm

Thank you all. No its not irritating...I was just starting to get lazy with C2 doing everything for me. I feel like such an idiot! I just thought C2 would read my mind and know the dimensions LOL.
[b]Andrew Donelson[b]
Nlaak Studios, LLC
https://www.nlaak.com/
[email protected]
B
15
S
3
Posts: 66
Reputation: 1,136


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 6 guests