Godot version: v3.1.1
OS/device including version: Windows 10
Issue description
After playing a while with the TileMap I got the following error:
ERROR: tile_get_tile_mode: Condition ' !tile_map.has(p_id) ' is true. returned: SINGLE_TILE
At: scene/resources/tile_set.cpp:449
This happens both when I try to run the project and when attempting to put/draw some tiles in the editor.
After re-creating the TileMap the error disappeared.
Steps to reproduce
Sadly I'm not sure how I got to this error.
I mainly played with the position of the TileMap and the cell options (like Half Offset and Tile Origin)
This error can be related with autotile, not with the other options. And it should be tested in master, i think that some work was done about that.
I am still getting this issue in Godot 3.2.1.stable.
I too am still getting this.
+1
Me too when clicking my tile map node, not sure if you'll need a proyect
I'm faced with this error when I was trying to place a tile (with autotile) with the method in a script (set_tile(pos)), I get this error for every method call and tile isn't placed.
I'm using autotile with tileset - 128x128 by each block and some configured collisions.
I get this error when I try to place an autotile at runtime.
@Devlin556, you are setting these tiles at runtime? After _ready() has ran?
@ZingBlue Yes, and I guess I fixed this by using set_tile(pos, 1) (when the required tile is first) instead of set_tile(pos, 0). Try this.
In my case that won't work. It also occurs for me just by clicking the node, even when the game isn't running.
Correction, when I first click one TileMap, then select another.
Im also getting this error when I update a bunch of tile cells and call update_bitmask_region or update_bitmask_area..
Godot v3.2.1.stable.official
I don't know if this is still relative, but reimporting tileset in Tile Set property of TileMap fixed this issue for me.
That also removes all tiles though.
Is there a way to reimport without removing all the tiles from the scene? Cause it does fix the issue but only temporary.
I encountered this error too in 3.2.2 stable. was doing tilemap editing using set_cellv.
I found that this only occurs when calling update_bitmask_region and
There is a tile with it's id set to something that the tilemap doesn't have.
example: have a tilemap with 2 "single tiles" and 2 "autotiles" but set_cellv(someposition,4)
id -1 clear, 0 and 1 "single tiles", 2 and 3 "autotiles". 4 is null... hope this gives some ideas.
@LukasOfLockless same here, I only get this error when I'm trying to update the bitmask on a tile that does not exists on my tileset.
I fixed this problem by reseting my tiles as my tile for some reason had an id of 2 so when I remade it and I made sure it was 0 and then it started to work, I also had to make sure the upadate was called after all my tiles were drawn
On 3.2.2 I'm getting a similar error
scene/resources/tile_set.cpp:480 - Condition "!tile_map.has(p_id)" is true. Returned: SINGLE_TILE
From calling one of the following two lines of code it fails, but not all the time, and it's always for the same tile not any other tile. I don't know if this helps but it seems consistent the above errors where this is just failing for a lot of people regarding something gone wrong in the tileset that cannot be easily fixed, and seems linked to the tileset getting mixed up with its IDs.
var shapes=tileset.tile_get_shape_count(id)
one_way=tileset.tile_get_shape_one_way(id,0)
For me, it only seems to do it with one specific tile. I've tried deleting the collision polygon for this id to no effect and the tile id is correct and everything is just normal, there is nothing wrong. I cannot reimport everything because I have over 200 tiles and you can't easily create this many tiles.
Most helpful comment
I too am still getting this.