Tilemap TileAt bug

Bugs will be moved here once resolved.

Post » Sun Oct 18, 2015 1:14 am

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
B
47
S
22
G
65
Posts: 1,127
Reputation: 38,395

Post » Thu Oct 22, 2015 5:27 pm

Also, here's a suggestion. Why not add some offset values to load the tiles at a position other than 0, 0.
B
47
S
22
G
65
Posts: 1,127
Reputation: 38,395

Post » Thu Nov 12, 2015 12:01 pm

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.
Scirra Founder
B
400
S
236
G
89
Posts: 24,546
Reputation: 195,471

Post » Thu Nov 12, 2015 4:08 pm

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.
B
47
S
22
G
65
Posts: 1,127
Reputation: 38,395

Post » Fri Nov 13, 2015 11:59 am

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.
Scirra Founder
B
400
S
236
G
89
Posts: 24,546
Reputation: 195,471


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests