Hey Luni, thanks for listening to everyone’s feedback and concerns!
After trying out the new system, I can say that it works pretty well at this stage.
Since undeclared variables are a thing of the past, I thought I’d share some suggestions that I think can make declaring and editing variables more efficient and intuitive.
⠀
1. Variables panel consistency.
The variables panel should always have both the Scene and Global variables tabs. So if I open the variables panel from the Scene page, it should have both tabs available with the scene tab being selected. Same thing when accessing the global variables from the menu.
It should be consistent as with opening it from the events sheet page or through an action/condition.
⠀
2. Include a button to open the variables editor panel on all actions & conditions.
3. Quick way to add and edit variables when typing expressions.
Include the add or edit variables option in the context menu of objects, and show it whenever an undeclared variable is detected. Same thing applies when typing expressions in the events page.
⠀
4. Add/Edit variables for objects in a group.
If I want to use a variable for a group of objects, I can’t simply declare a variable right within the event because the edit variables button would be disabled for groups. I’d have to go to every object and declare this variable manually. And this would be big problem if there are many objects.
A workaround would be to only declare the variable for only 1 object and GDevelop will detect it. But I don’t think that’s a good idea (but I might be wrong here), because all the other objects would not have this variable declared.
Here’s my suggestion.
Keep the button enabled for groups which opens a group variables editor that includes all the mutual variables between the objects in this particular group. It is NOT a new type of variable, but this panel shows the mutual variables between objects in this group and gives the ability to add or edit them. Mutual variables with different values would appear as (Mixed Values), with the ability to change and overwrite the value on all objects by clicking on the edit icon on the right.
This would solve a big problem of having to declare or edit a variable for many objects in a group. But, the object variables would not be affected or removed if the group is deleted.
⠀
5. A clearer way to add children to structures and arrays.
The + icon at the right to add a child variable always confuses me if I have structures/arrays inside parent structures/arrays.
I think this design is more inline with the events system which is clearer to add children in the right places.
⠀
6. Not used variables.
Display an icon which indicates that the variable is not used anywhere, and a popup will appear if this icon is hovered over or clicked. This makes it easier to find and remove variables that are declared but never used.
⠀
7. Add a button to open the variables editor in the scene and event sheet pages (useful for mobile).
⠀
8. Fix a bug.
The new system does not allow having the same name for variables and objects. But I was able to cheat that by declaring a variable first then renaming an object to the same name.
⠀
I can edit and improve these suggestions if anyone have something worth adding or changing.