Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | yahwhey |
Hey there!
I’m trying to create a tool which would make setting cells various layers in a Tilemap quicker.
In order to do this im looking for something like a signal which is emitted by a tilemap when a cell is set in editor which a tool script can connect to .
Anyone know how I could approach this?
Currently using Godot 4 alphas
Cheers!
I didn’t test it, but You can override set_cell method of tilemap. In theory You could do something like this inside a custom script extending from tilemap script :
func set_cell ( int x, int y, int tile, bool flip_x=false, bool flip_y=false, bool transpose=false, Vector2 autotile_coord=Vector2( 0, 0 ) ) :
.set_cell ( int x, int y, int tile, bool flip_x=false, bool flip_y=false, bool transpose=false, Vector2 autotile_coord=Vector2( 0, 0 ) )
emit_signal("yoursignal",yourargument)
Inces | 2022-09-07 17:27
Did a bit more digging and it looks like you cannot override certain native functions.
See this github issue https://github.com/godotengine/godot/issues/55024
Might have to look for another solution
yahwhey | 2022-09-12 21:25