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

Add "Tilemap Hook Scripts" or similar to allow easier and tighter coupling of Tilemaps and Tool scripts #10439

Open
IntangibleMatter opened this issue Aug 14, 2024 · 0 comments

Comments

@IntangibleMatter
Copy link

Describe the project you are working on

A 2D platformer with a large amount of tilesets with complex rules.

Describe the problem or limitation you are having in your project

Godot's autotiling system is powerful, but also very limited. You can't set the tile for n number of tiles away from an edge, set how tiles group within a larger tileset, or any other similar thing. This means that you have to write scripts that either run at runtime or as tool scripts to update the tilemap.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Tilemaps should have a property that allows you to attach a Tool Script that can then be ran with a button (automatically added to the Tilemap's inspector), making it much easier to run tool scripts on tilemaps. Other options include running when a piece of tile drawing is finished, when a scene is saved, or other "commit to tilemap"-type actions.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

A tool script class specifically designed to interface with tilemaps could be added, which could then be attached to the tilemaps in an array (similar to Custom BBCode or other such features). These tool scripts, when attached, can listen for signals in the tilemap such as "Tile drawn" or "refresh map", or be run through a button press. These scripts then run through the tiles in the scene and modify them in some way or another, effectively acting as in-editor custom autotiling, but a bit easier than implementing a whole plugin.

If this enhancement will not be used often, can it be worked around with a few lines of script?

This would be a huge quality of life improvement for anyone using tilemaps in an advanced way, and considering how many people use Tilemaps I think this would be used often.

This functionality is already doable with Tool scripts, but it's not exactly easy to do.

Is there a reason why this should be core and not an add-on in the asset library?

Modifies the interface of a core node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants