-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent default values in TileMap.set_cell() and TileMapPattern.set_cell() #80429
Comments
This is a documentation issue as changing the default value isn't possible without breaking compatibility |
Breaking compatibility when expectations are not being followed seems fairly reasonable. Especially when changing TileMap as a whole is something fairly desired, anyhow:
The class as a whole seems to be under active development and actually quite prone to minor tweaks like these. |
I am confused, I have the same problem, but I don't see a fix. In your example, how/where do you "get" the TileSetAtlasSource? I just specify 0 in set_cell everywhere. |
My test case:
My code might have a problem, the issue seems to suggests there is a fix, but I don't see it. |
Ok, I understand, so to clarify, alternative_tile must be specified like so: The documentation should have a big warning in red, recommending users to set it to 0 in gdscript. |
Godot version
v4.1.1.stable.official [bd6af8e]
System information
Godot v4.1.1.stable - Windows 10.0.19045 - Vulkan (Compatibility) - Radeon RX 570 Series (Advanced Micro Devices, Inc.; 31.0.21001.45002) - Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz (4 Threads)
Issue description
TileMap.set_cell() and TileMapPattern.set_cell() have different default values for the alternative_tile parameter. TileMap.set_cell() defaults to 0, allowing a tile to be placed at the given coordinates if no value is provided, while TileMapPattern.set_cell() defaults to -1, which instead erases the cell at the given coordinates.
My expectation was that the behavior of these functions would be consistent, given their similarities and that the documentation for TileMapPattern.set_cell() tells users to refer to TileMap.set_cell(). I am not sure whether the default value for both functions should be 0 or -1, and ask that someone more familiar with TileSets make the decision.
Steps to reproduce
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: