getting a js bug Array.Height to number

0 favourites
  • 5 posts
From the Asset Store
Match same tiles with each other as fast as you can and earn more score during a limited time!
  • I am working on loading data into a array form AJAX and that seems to be working fine. but then I am trying to load the Array.Height into a number(int) var. and I get a js error when I run the page "set_int.without a number type" but I then do a loop from 0 to the var I set and that seems to work. please see attachment for what I am doing in the code


  • Sounds like you might have set the array sizes as strings instead of numbers in the JSON file:

    "size":["10","1","1"][/code:gu0d88su] instead of [code:gu0d88su]"size":[10,1,1] [/code:gu0d88su] ?
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here is my array


    "c2array": true,

    "size": "[8,7,1]",

    "data": [ [["Type"],["Y-Top"], ["X-Left"], ["Length"],["Dir"],["Movement"],["MovDir"]],


    ["Plat"],["15"], ["0"], ["50"],["H"],["0"],["H"]], [

    ["Plat"],["15"], ["60"], ["20"],["H"],["0"],["H"]], [

    ["Plat"],["10"], ["79"], ["50"],["H"],["0"],["H"]], [

    ["Plat"],["27"], ["10"], ["30"],["H"],["0"],["H"]], [

    ["Plat"],["22"], ["36"], ["5"],["V"],["60"],["H"]], [

    ["Plat"],["29"], ["61"], ["15"],["H"],["100"],["V"]], [

    ["Latt"],["27"], ["40"], ["15"],["V"],["0"],["V"]]]


  • It should be

    "size": [8,7,1][/code:1y0yqiex]
  • Try int(,2)).

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