Objects strcutre [Limited variable types :( ]

0 favourites
  • 1 posts
From the Asset Store
Change delay, create new lines, "backspace" the text
  • I've always wonderes by we are limited to number and string variable types. Having objects or arrays would be so amazing. This is a serious limitation to the engine in my opinion.

    This rant is because i would to have "something" in C2 that would allow me to do this structure:

    {

    "training": {

    fishes: ["-1", "1", "2", "3"]

    },

    "Island": {

    fishes: ["-1", "4", "5", "7"]

    },

    }

    That json file would be retrieved with Ajax.

    How could i do this? using XML

    <zones>

    <training>

    <fish>-1</fish>

    <fish>1</fish>

    ...

    Thanks in advance

    [EDIT]:

    using the xml ideia, i managed to get the fishes for a specific zone seprated by a , doing this:

    RegexReplace(

    trim(

    RegexReplace(

    zones.StringValue("/Zones/Training"),

    "(<.+>)(.+)(<\/.+>)",

    "ig",

    "$2,"

    )

    ),

    "\s+",

    "g",

    ","

    )

  • 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)