Construct 3 dictionary/array editor help

0 favourites
From the Asset Store
Casino? money? who knows? but the target is the same!
  • Hi,

    I can't seem to find how to open the new dictionary/array editor?

    It's listed in the Construct 3 online help manual, but it doesn't specifically say how to open it for editing.

    Can someone help?

    Many thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • See "Opening the file editors" in this manual entry.

  • People still seem to keep running in to this so I added a section on opening the editors to each editor's individual manual entry as well.

  • Thanks so much, I really appreciate this.

    Next question - sorry if it's a bit dumb....lol but once the array editor is open how do I actually enter data? I tried typing it directly into the box like in Excel, but it disappears when I leave the box.

    I know there's something I'm missing.

    Thanks for any help.

  • Have you increased the size?

  • Have you increased the size?

    Thanks for your message.

    Turns out I wasn't going mad at all - there's a problem with my laptop, and it was stalling for some reason and not saving what I entered.

    I just tried it this morning in a completely new file after reading your message and it works fine.

    Many thanks.

  • Okay,

    So I've created an "array as json" file in the project files location, which allows me to edit the contents of the array.

    How do I link the array into my events sheet? I can't seem to call to it as it's not an actual array inside my objects.

    Thanks for any help.

  • You use the AJAX object to load it and Array.AsJSON to read it into the array.

  • For a bit more help, check out my recent thread here:

    Here's a quick overview:

    1. Right click on Files and select New --> Dictionary

    2. Edit your dictionary with keys and values (do NOT include quotes for text)

    3. Add AJAX to your project

    4. One of your first events should use AJAX to Request a Project File

    5. When it's loaded (AJAX "On [tag] Completed") then the Action for your Dictionary object should be "Load"

    6. You can then load AJAX.LastData into your Dictionary

    7. Now you can use keys to retrieve information from your dictionary

    8. If you created an array then you can do things like: Array.At(index) or Array Contains Value "Text"

  • Thanks,

    I'm trying to get the hang of it....

    What is a tag?

  • A tag is just a name you can assign to help Construct identify things. It's almost like a variable name, which means it can be anything you like.

    For example, when you use AJAX to "request" a project file you can add a tag like: "zebra_yoghurt". Then your next line would be:

    AJAX --> On "zebra_yoghurt" completed -- Dictionary --> Load from JSON string AJAX.LastData

    Another place where I use tags is with audio. When you play a music file, for example, you can assign it an optional tag. Again, it can be any name you want. By giving it a tag you can then do things like check to see if music with that tag is playing.

  • Hi again,

    I got as far as this:

    i.imgur.com/oC0s9NF.jpg

    But i'm still confused as the array isn't showing as an object I can use for events.

    Many thanks.

  • You need to add an array, then use Array.Load to load it.

  • [quote:319mkdi1]But i'm still confused as the array isn't showing as an object I can use for events.

    To add to what blackhornet wrote... In order to use many of the built-in features of Construct (like arrays) you have to first add them to your project. So go to your layout, right click, select "Insert New Object", and then pick Array. Now it will be available to events and actions.

    The next thing you will want to do is add an action for your AJAX event (On "shop" completed). Array --> Load --> AJAX.LastData.

    To make sure that everything worked, run your game using "Debug Layout" (instead of the triangular Preview button) and then click on your array on the left side of the debug panel. You should be able to see your data listed.

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