Array won't index Y axis through functions

Get help using Construct 2

Post » Thu Nov 28, 2013 1:50 am

Hey all,

I am having a headache with setting the Z axis in an array. The issue seems to be that it won't use a function parameter for a Y index, even though it works fine for X axis.

Anyway if you just look at the capx you should see what I mean. Run in debug mode and watch the array contents.

You will see that when trying to reference the Y axis through the parameter it does nothing, but change it to a 1, which is what it should be in the other case, and it works. I have been scratching my head on this for hours and just can't figure it out!

It's only a very small a straight forward capx, so if you could take the time to put some eyes on it I'd be grateful. It's part of a much, much bigger system and this is the one piece that won't work. I hope I've just been staring at it too long and it's something obvious to a fresh face.
B
28
S
8
G
5
Posts: 429
Reputation: 7,007

Post » Thu Nov 28, 2013 2:20 am

You are trying to index with testArray("X","Y","Z"). You can't index with strings, you need integers.
ImageImageImage
B
71
S
21
G
229
Posts: 3,686
Reputation: 128,336

Post » Thu Nov 28, 2013 2:56 am

@blackhornet thanks, but I'm not trying to index with strings, I'm trying to index with the index of the string.

This example pads out the X axis with more letters. As you can see, using that exact method it still chooses the correct position on the X axis. Now, try again but changing the index of Y to testArray.index(f.param(2)) - exactly as it is for X axis - and it no longer works.

If I'm just not getting it, could you please show me an example? I have gone over it again after your comment and still I can't see the problem.

EDIT: Oops, just read the manual more clearly. Index only works for X axis. Feeling silly! Sorry.Tobye2013-11-28 03:02:00
B
28
S
8
G
5
Posts: 429
Reputation: 7,007

Post » Thu Nov 28, 2013 3:10 am

That's just what I was about to report.
ImageImageImage
B
71
S
21
G
229
Posts: 3,686
Reputation: 128,336


Return to How do I....?

Who is online

Users browsing this forum: blue visionary and 24 guests