How do I upload array from JSON?

0 favourites
  • 5 posts
From the Asset Store
You can upload screenshots and photos to your server very easily.
  • I spent a lot of time designing a array on a different website (Because I don't own Array Editor) and exported it as JSON. I don't know what is wrong because there SHOUD NOT be multiple types of JSON and it is still not working.

    Here is the exported JSON:

    "[ { "Mom": "Dad", "Store": "Market", "Coffee": "Powerup", "Shovel": "Cow", "Jumped over": "Went around", "Robber": "Bad Guy", "": "" }, { "Mom": "Grampa", "Store": "Truck", "Coffee": "Panda", "Shovel": "Wall", "Jumped over": "Licked", "Robber": "Hot Glue", "": "" }, { "Mom": "Springy", "Store": "Beach", "Coffee": "Pet", "Shovel": "Turtle", "Jumped over": "Forgot about", "Robber": "Cute Squirrel", "": "" }, { "Mom": "Jam Pam", "Store": "Spa", "Coffee": "Toilet", "Shovel": "Mountian", "Jumped over": "Gave a Donut to", "Robber": "Big Bug", "": "" }, { "Mom": "Da Boy", "Store": "Dunkin Donuts", "Coffee": "Money", "Shovel": "Big Boy", "Jumped over": "Smashed", "Robber": "Evil Chipmunk", "": "" }, { "Mom": "Mr.", "Store": "Wendys", "Coffee": "Happiness", "Shovel": "Car", "Jumped over": "Tattle Tailed on", "Robber": "Santa", "": "" }, { "Mom": "Mrs.", "Store": "Da Bank", "Coffee": "Bacon", "Shovel": "TV", "Jumped over": "Ate", "Robber": "Fortnight Boy ", "": "" }, { "Mom": "Boing", "Store": "Starbucks", "Coffee": "Milk", "Shovel": "Traffic Jam", "Jumped over": "Threw", "Robber": "Police", "": "" }, { "Mom": "Bob", "Store": "Factory", "Coffee": "Friend", "Shovel": "Cliff", "Jumped over": "Bounced over", "Robber": "Ghost", "": "" } ]"

    (Just remembered the weird content! This is for a AI generator that will generate funny stories.)

    Of course, If you are here to tell me that I just have to remove all the (")s I already spent a bunch more time on that and it uploaded fine...

    Until I test it and try to print coordinate 1,1 and it prints 0...

    Please help me.

  • You can try loading that string into JSON object, but not into a C3 array.

    Arrays in Construct have a specific structure, for example:

    {"c2array":true,"size":[2,2,1],"data":[[["line1"],["line2"]],[["Hello!"],["How are you?"]]]}
    
  • Oooh! Thank you! So I would use the Parse action, but the manual said that I should request a project file with AJAX and then put that into the Parse action. How do you add a JSON file as a project file?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's better to prepare array files directly in Construct using the built-in array editor.

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