Array help.

0 favourites
  • 10 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Let's say I have an array called "NewArray".

    If I want to step through it one step each time the player presses Z. How would I go about doing this?

    Just tried:

    On X Pressed

    Object - Pick instance with UID NewArray.Back

    -Pop back on X axis

    No success. I've been trying to do this a couple of ways. Right now I'm thinking I would have to do it like this:

    On X Pressed

    Object - Pick instance with UID NewArray.Back(-GlobalAxisVariable)

    -Pop back on X axis

    -Add 1 to GlobalAxisVariable

  • n X Pressed

    Object - Pick instance with UID NewArray.Back

    -Pop back on X axis

    This should work, are you setting up the array with object UIDs?

  • My current scripting for setting up new objects into the array.

    <img src="" border="0" />

  • In the array properties is the size 0x1x1. By default the size is 10x1x1.

  • Ohhh!!!

    I should be looking in the Y axis then?

    How can I arrange this in the X axis instead?

    What I want to do is to insert each object in the X axia and step through it that way. Seems much more lika the way I would do it in LUA (I wish Construct had LUA support like MMF2).

  • Just set the width property of the array to 0 and it should work.

    If the width is 10, as it is by default, you will have to press X 11 times before you pick any object you added by pressing Z.

  • Right. Got it working after reading up a bit on the array section.

    Now I have a different problem I for the life of me can't figure out.

    I'd like to have an arrow above the oldest stone object. Once you destroy the oldest one I want it to move to next.

    At first I thought it would be easy.

    I ended up with something like this:

    <img src="" border="0" />

    Not working at all. I can see the object I want to position not moving.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Try and add a "pick all PlayerStone" to the middle of your second event.

  • That sort of worked. Problem is that the arrow is "lagging" behind. It seems to always be one action behind.

    Let's say I have no stones out. I place one stone. Nothing happens. I place another stone, the arrow moves to the first stone.

  • Well... I got it working.

    For some reason changing the On Created event to an every Tick event seemed to work.

    Would have preferred to keep it as On Created, just for the sake of me not wanting to have stuff I don't need refreshed on every tick to actually get refreshed all the time.

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