Array Problem

0 favourites
  • 1 posts
From the Asset Store
Supports 1D, 2D, 3D arrays. Import and export arrays in JSON format
  • I've been working on something for a while now and I'm just about done. I just have 1 more problem I can't seem to solve. When the player right clicks on an object, I am trying to make it change the value in an arrays element depending on the clicked objects instance variable.

    This is how I am thinking it should work:

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

    When the value is at 1, it's working perfectly fine. But if the value is over 1, it acts really weird. Sometimes it sets the x, y element to 0 and leaves the x element the same, sometimes it sets it to 1, 2, etc.

    Heres the event for setting the value:

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

    If anyone knows what is going on, help would be greatly appreciated.

    EDIT: I had a big blonde moment. Not sure what I did yet, but it works.

    EDIT EDIT: When changing the value, I put Arr_Inventory.At(Spr_Slot.slotNum - 1) - 1 instead of Arr_Inventory.At(Spr_Slot.slotNum - 1, 1) - 1 (forgot , 1 to get the second row instead of the top row.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)