Tilemap TileAt bug

0 favourites
  • 5 posts
From the Asset Store
This is a black tileset with 2 tilemaps, props, one animated character and more.
  • Problem Description

    tileAt returns incorrect value for a tile after loading json string.

    Attach a Capx

    http://1drv.ms/1GMrqN9

    Description of Capx

    A tilemap has tiles predrawn. At start of layout it loads a json string into the tilemap, which changes some of the tiles.

    Steps to Reproduce Bug

    • run project

    Observed Result

    The tiles that weren't changed now return -1 when using tileAt expression.

    Expected Result

    tileAt should return the correct value for all the tiles.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    win vista sp2

    Construct 2 Version ID

    212.2

  • Also, here's a suggestion. Why not add some offset values to load the tiles at a position other than 0, 0.

  • Closing as not a bug: your JSON string has the incorrect size in it (the width and height properties are 10 and 11). If I save TilesJSON again it has the correct size of 53x30. Some previous releases had bugs with saving the wrong JSON data, which should be fixed now, I think this is just a consequence of that.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Eh.. but the collisions are still there for the parts that aren't updated.

    Ashley , If you want to limit the use of the tilemap, you should force it to resize itself to avoid confusion. There is however the possibility that someone would want to update only a section of the tilemap- I don't think you should disregard that. This is an opportunity to make your product better.

    It's mainly just odd that the tiles outside of the updated area remain visible, as well as their collisions- so why not their tile number be accessible as well? It just seems like an oversight. Something just isn't right with it. I also don't think it is good to just assume nobody will ever update just part of the tileset and expect the rest to go unused- that sort of thinking limits creativity.

    edit: I guess I could make a plugin that loads in a section with offsets, etc.. I think I'll do that for now.

  • Everything should work if you save valid JSON data. The problem stems from the fact you are using invalid JSON data, probably saved with an old build that had a bug.

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