How do I fill a column of an array with data from a json?

0 favourites
  • 5 posts
From the Asset Store
An educational game for Fill in the Blanks. An easy to use template for developers to build larger games
  • I want the array data at this key

    To be inserted into an array as a new column

    The dimensions are already set correctly

    It adds a new column but all values are set to just 0

    Is the problem that this expression for getting an array is wrong?

    JSON_Dialogue.Get("scene."&Scene_ID&".dialogues."&Dlg_ID&".createWorldActor")

    I tried setting a Test_Text with this expression and it just wrote a 0.

  • Or

  • Tank you so much! It worked flawlessly. And thanks for giving multiple options as well, I went for 2.

    One question. Why is the "int" required? Are array keys not integers by default?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sorry it's actually not working. This method always overwrite the first column. I've tried everything I can think of but it just wont accept anything.

    The first solution that seemed obvious to me was to just set the array Y size to +1 first and then just add it to the newly created y row of the array.

    I've tried pushing in the new Y column as well, but that doesn't work either. I'm confused by how complicated manipulating arrays is.

    All I wanna do is:

    1. add new y row

    2. set x values at new y row to the array that is written in the json.

    Why is this so complicated to do?

    Maybe I'm trying to hammer a nail with a screwdriver here. Should I be using using dictionary or something else?

  • Nvm. I got it to work.

    Pushing did work but you need to push front, not back. I though pushing back was pushing to a higher value in the array. But counting backwards does go towards 0 so i guess it makes sense. My god, arrays are so unintuitive to me.

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