Get a value from an array

This forum is currently in read-only mode.
From the Asset Store
Supports 1D, 2D, 3D arrays. Import and export arrays in JSON format
  • I've noticed that there's no way of getting a certain value in an array. There are expressions like CurrentX, but there doesn't seem to be a way to set which X to read from. Unless I use a "For each element" CurrentX always stays at 1. There are also the (x), (y) and (z) expressions, but it tells me I can't use them. So what are they for? So, is there a way to read from a certain element in the array without having to use a loop?

    ------------------------------------

    Also, on an off-topic note: It seems to me that the Construct Classic section has pretty much died out. I don't get it. Classic still has appeal, being Open-Source and still being able to do a lot more than one might think. Also, I don't want to move over to Construct, because 100 events are not enough for a full-fledged game and I can't afford the unlimited Paid version. :/

  • Also, on an off-topic note: It seems to me that the Construct Classic section has pretty much died out. I don't get it. Classic still has appeal, being Open-Source and still being able to do a lot more than one might think. Also, I don't want to move over to Construct, because 100 events are not enough for a full-fledged game and I can't afford the unlimited Paid version. :/

    I agree that CC is still quite useful, but as many of the long term users found out, the bugs can be a killer.

    As active development stopped a long time ago, and new development is reliant upon a propriety piece of software (for the editor not the runtime), it is a shame, but understandable, that it is slowly but surely wandering off in to the sunset.

    The following post from R0J0hound summarises the development requirements brilliantly:

    https://www.scirra.com/forum/more-freaking-span-class-posthilit-runtime-span-errors_p1021037?#p1021037

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I haven't encountered any bugs yet, aside from the program crashing, when I was installing new software, but I understand if they turn people off. I do wonder, though, how did people, who can't afford Construct 2 moved from this to the limited trial version? Or have they stopped using Construct entirely?

    Also, any solutions to the array issue???

  • BioMechanical

    The three ways to access values values are the following. Also they are the same expressions given when you select them from the expression list.

    Array(x)

    Array(x,y)

    Array(x,y,z)

    To use them replace x,y and z with a value. Also keep in mind the indexes start at 1 not 0.

    So to get the first value of an array you'd use:

    Array(1)

    For the second:

    Array(2)

    and so on...

  • Ah, thank you!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)