Skip to content
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

Make compatible with Godot 4 #22

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Mitten-O
Copy link

@Mitten-O Mitten-O commented Aug 6, 2023

This MR makes the script compatible with Godot 4. Be warned, in addition to the changes genuinely required, such as syntax changes, I ended up changing the tile indexing a bit. This is because I ran into weird problems, which I believe were caused by replacing map_to_world/world_to_map with map_to_local and local_to_map. The "world" versions are not available in Godot 4 and apparently the "local" versions don't behave exactly the same from the point of view of this script. I was able to get everything working again by removing some offsets and converting positions to grid coordinates before converting them to point IDs. It's probable that a smaller set of changes would have worked if I properly understood the difference between these function families and their usage here, but this works, and gives smaller id:s which I prefer anyways. Nonetheless, this MR may serve better as a reference if someone wishes to implement Godot 4 compatibility cleanly, than something to necessarily merge as-is.

* Export syntax
* TileMap only has map_to_local, not map_to_world
* Color constants are capital
* TileMaps have layers
* Signal connecting syntax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant