Hey,
Just giving my opinion on some things discussed here.
This sounds like a nice feature… but I don’t think it works in all situations. I’ll explain what I mean.
-
In the case of a simple variable, eg: NewVariable, this is fine.
-
In the case of arrays or structures, eg: Structure.Child.
If Structure is not declared, then GDevelop would have to declare both variables.
So Imagine if I type 3 or more new variables into the field, eg: Structure.ChildStruct.ChildStruct2.Child.
Maybe this is also OK to let GDevelop create multiple variables all at once? -
In the case of expressions.
Eg: Structure[Name].Child -or- Array[Number].Child.
How would GDevelop know where to declare the variables?
It doesn’t work in this case. -
With the current system, how would you tell GDevelop whether to declare the variable as a scene or a global variable? This would add an extra step.
I don’t think a feature is good or worth adding if it doesn’t always work.
Having 1 action/condition for scene & global variables allows to easily change a variable from one type to another. I find it way more useful this way.
Imagine you used a scene variable throughout a big project, and later you decided to change it to a global variable. Now you can simply delete the scene variable, declare it as a global variable, and you’re all set.
But if the events for scene & global variables are different, you’d have to search for all the actions & conditions and replace them manually. I faced this issue before and many hours of searching and fixing errors later, I finally was able to do the change. I’m not very good with math, but I think this is a LOT more time than simply delete → declare.
I have to disagree here. Check this topic out: [Feature in Backlog] A more efficient way to declare variables (from event sheet) - #14 by Luni