derkork / godot-statecharts

A state charts extension for Godot 4
MIT License
734 stars 35 forks source link

Transition class_name conflicts easily #57

Open WolfgangSenff opened 9 months ago

WolfgangSenff commented 9 months ago

Hi there!

I have noticed that the class_name of Transition, which you use, conflicts very easily with lots of other projects. I was wondering if it could be changed to something like StateChartTransition? I'm happy to open a PR for this, let me know if you'd like me to change that. I only noticed because it conflicts with my public game template, which is in pretty widespread use, so I'll be updating my template as well (we use Transition for scene transitions as an autoload, so that's where the conflict comes in, and Godot's error reporting on this is...poor, to say the least), but in general Transition seems to be used regularly across several projects, not just our two, meaning it's going to come up more often I should think, if StateCharts becomes very popular.

derkork commented 9 months ago

Changing the name itself is not going to be a lot of work, but it will break all existing scenes that use the state charts. I will have to do some tests to find a good way to make this change without breaking people's projects. It would really suck if you designed a big state chart and then your data is gone and you'd have to do it again.

I really wish there was a way of creating namespaces so this kind of problem wouldn't exist, but this is probably not coming any time soon (https://github.com/godotengine/godot-proposals/issues/1566).

derkork commented 9 months ago

So looks like the scenes are actually pretty unimpressed by the rename, which is a good thing. So this would mainly break existing scripts that use the API.