[Solved] UPDATE 5.4.203 / Variables not working anymore

Variables went through a technical change. For more information, read this topic: New unified variables and variables declaration in GDevelop 5.4

Hello,

the new update 5.4.203 contains changes to the handling of variables. It has now been greatly simplified - that’s basically a good thing.

But it seems that there are now problems with variables that were not previously created in the variable editor.

Is there a way to include all undeclared variables as scene variables with one click? If not, would be useful in this case.

Thanks in advance!

Best regards!

Unfortunately, there is not, no.

The previous instructions for variables remains useable, you can copy/paste them.

THe thing you cannot made is the mix the new instruction with the old variables, for using the new instruction, variables have to be declared, that cannot be made automatically because of previous variables was untyped.
In the variable editor there is a list of undeclared variable that can help to let you know which ones have to be declared.

The engine cannot find what type was used on variables, even less if there’s a variable that changes from one type to another, or worse if a scene variable has the same name as a gobal variable. Which one to choose?
This poses more of a problem than letting people declare variables themselves.
This is why this have to be made manually, this is just a transition phase, once it’s done you won’t get problems anymore.

1 Like

Hello,

Thank you very much for the quick and detailed answer!

The problem is not the declaration of the variables, but rather the changing of each individual condition and action - especially at many events.

Here it would be good if at least all number and text variables were converted into the new simple variable condition/action.

Even if it may not be absolutely necessary, I would find it “cleaner”.

EDIT: Like in the post of ZeroX4 Different visual representation for NONE declared variables it would be better - was that changed back?

Best regards!

1 Like

Hello,

will there now be any changes regarding the variable issue?
Since I would like to continue working, I would need to know whether I need to manually adjust all events or not. Not that I’m doing a lot of work now and this will be adjusted in the next update.

As already mentioned. I think the variant where all events are converted and then marked in red is a little better. So all you have to do is declare the variables in the variable editor.

I would be very happy for some brief information.

Thank you!

By the way - Gdevelop is damn awesome! I spend half my day in the software :+1:

Best regards!

Hi,

I’ve made a post here: New unified variables and variables declaration in GDevelop 5.4 if you’ve not seen it already :slight_smile:

I would need to know whether I need to manually adjust all events or not.

Remember that no, you don’t need to manually adjust all events. They continue to just work. When you work with a variable, remember to declare it otherwise the new action/condition related to the variable won’t work and will complain that you must declare it.

But that’s it. Are you making a new action/condition using a variable? Declare it. Change nothing else.

To help you, GDevelop displays undeclared variables in the variables editor (but can’t automatically declare them because it has no sure information about the type, initial value, etc…). But again, you can do this progressively as you work on your game (or take a bit of time to declare everything).

The new variable system won’t change, though we may add some links to quickly declare a variable in some place in the UI.

2 Likes