Arrays cannot be assigned values

For questions about using Classic.

Post » Sat Aug 06, 2011 4:07 pm

Hey guys

I have a bit of a problem with this cap:

http://dl.dropbox.com/u/1378330/002.cap

Basically, event 43. When the mouse is clicked, the values should be assigned to the array. However, they aren't, and I cannot figure out why.

Knowing me its something ridiculously simple. But if someone else can see where I've gone wrong, I'd really appreciate it. Thanks!
B
55
S
12
G
8
Posts: 339
Reputation: 9,314

Post » Sat Aug 06, 2011 8:16 pm

Could you post a cap without "external" plugs like magicam?

Without being able to look at your cap, here's a thought or two. Most of the times when values seem to be missing in the array, one tried to store them at indices that doesn't exist (e.g Array(-1), or, if the size of the array is 10, any index above 10)
You don't get any error message then, it is just silently ignored.

Such wrong indices might be due to twisted numbers, calling x with y or the like.

Make sure, the size of the array is big enough, you don't call any index below 1 and that there are no twisted numbers.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Sun Aug 07, 2011 3:26 am

Hey Tulamide. Replaced the .cap with on without MagiCam.

The coordinates, and the global variable to be assigned to those coordinates, all check out in debug mode.

Woah, woah, woah....

Let me just check here.

Are arrays in CC 1-based? Have I been using C2 too much?

EDIT: Got it working! Had to change it all to a 1-based system and it worked fine.cow_trix2011-08-07 03:59:08
B
55
S
12
G
8
Posts: 339
Reputation: 9,314


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests