Filling a 1D Array With an Incremented Variable

Just started using Construct 2? Post your questions here

Post » Fri Aug 05, 2016 1:31 am

Hi, all.

I read what I could find on arrays on the official Construct 2 threads and I still can't figure out why my capx doesn't work. The array doesn't even show in the debugger.

The simpler ones do, when filled manually with lists.

I'm trying to fill a 1D array with this list of 96 values:

20 40 60 80 100 120 140 160 180 200 220 240 260 280 300 320 340 360 380 400 420 440 460 480 500 520 540 560 580 600 620 640 660 680 700 720 740 760 780 800 820 840 860 880 900 920 940 960 980 1000 1020 1040 1060 1080 1100 1120 1140 1160 1180 1200 1220 1240 1260 1280 1300 1320 1340 1360 1380 1400 1420 1440 1460 1480 1500 1520 1540 1560 1580 1600 1620 1640 1660 1680 1700 1720 1740 1760 1780 1800 1820 1840 1860 1880 1900 1920

Is current supposed to be in there somewhere?

This is my first attempt to use an array.

http://www.darksunpictures.com/public/array.capx
Last edited by AmpedRobot on Fri Aug 05, 2016 7:23 am, edited 1 time in total.
B
39
S
20
G
18
Posts: 265
Reputation: 12,983

Post » Fri Aug 05, 2016 1:57 am

Your code is working. The debugger shows the array with 96 values, as in your list.
ImageImageImage
B
71
S
22
G
248
Posts: 3,761
Reputation: 138,073

Post » Fri Aug 05, 2016 7:12 am

Really? Maybe I'm doing something wrong. Why the heck would I not see it in the debugger? Screenshot maybe?

Thank you for replying btw.

On an unrelated note, how would I pick 4 random non-repeated values out of that list? (NVM, just figured this out! )
Last edited by AmpedRobot on Fri Aug 05, 2016 8:44 am, edited 4 times in total.
B
39
S
20
G
18
Posts: 265
Reputation: 12,983

Post » Fri Aug 05, 2016 7:21 am

Nvm, now it shows up in debugger, maybe it was some crazy run time error.

Err, now that I think about it, maybe I didn't know I was supposed to click on the array name on the left and maybe I just didn't notice it.

First time using the debugger too (and everything else showed on the main screen which is I think where I was looking for it).

Thanks very much for checking!
B
39
S
20
G
18
Posts: 265
Reputation: 12,983


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests