How do I use this return?

0 favourites
  • 6 posts
  • so I am using a Ajax action to pull from this url

    steemmonsters.com/cards/collection/kiokizz

    I tried to load it into an array via the lastdata return from the ajax action but it doesn't seem to recognize it. I can see the last data in debug mood but I can't seem to get any other object to recgonize it when trying to retrieve it from there. Sorry I know its probably something simple but I am teach myself this whole this so maybe someone got a good tutorial on it?

  • That is not a C3 array structure. Make an array, get the JSON from AsJSON, and look at the format. You have to follow that same format for C3 to import it into an array.

    Having said that. This structure doesn't look like it will map to an array anyway.

  • Is it json format, should I be able to see it in debug mood if I tried to load as that?

  • You can use the JSON plugin to parse it, but you have a custom format, so you can't load it into an array or dictionary - they have their own specific formats.

    construct.net/en/make-games/manuals/construct-3/plugin-reference/json

    Dictionary format:

    {"c2dictionary":true,"data":{"one":"some text","two":"some more text"}}

    Array format:

    {"c2array":true,"size":[2,1,1],"data":[[["some data"]],[["some more data"]]]}

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • your data is in JSON format, but like blackhornet said it is not a format that C3 array will understand.

    You can load the LastData from AJAX into a C3 JSON object, and access the data by keys, and if you really wanted loop through that to load into an array.

    to get it directly into an array, you would have to have the script on your server build a C3 compatible JSON file. BlackHornet was suggesting taking an Array from C3 and outputting it as JSON so you can see what it would have to look like.

    here is code that worked fine for me:

    Edit: should have refreshed first! :)

  • Ok so it should be readable from the json load of lastdata I was thinking of looking like you suggested to make the array. Thank you both for helping my thought process

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