GDevelop icon indicating copy to clipboard operation
GDevelop copied to clipboard

Object-variable expression missing for Number variables

Open jack-ii opened this issue 1 year ago • 3 comments

Is there an existing issue for this?

Describe the bug

If I want to fill a global/scene variable with the declared type Text with an object variable, there is an entry for it in the expression editor. But if it is a variable with the type Number, the entry is missing. The same e.g. with Storage save actions. 1 2


Another problem, it is not possible to pass a boolean value from a scene boolean variable to a global boolean variable because boolean variables do not allow expressions.


GDevelop version

5.4.204

jack-ii avatar Jun 20 '24 18:06 jack-ii

Thank you for reporting an issue.

Indeed, we forgot to hide VariableString() for objects.

A new system has been introduced fro variables in the 5.4.203. Please take a look to the release note:

  • https://github.com/4ian/GDevelop/releases/tag/v5.4.203

You can also find more details on the forum:

  • https://forum.gdevelop.io/t/new-unified-variables-and-variables-declaration-in-gdevelop-5-4/58723

Another problem, it is not possible to pass a boolean value from a scene boolean variable to a global boolean variable because boolean variables do not allow expressions.

This has never been possible with expressions. Boolean values can be copied using conditions and actions.

D8H avatar Jun 25 '24 09:06 D8H

Indeed, we forgot to hide VariableString() for objects.

Ah okay I thought so. That mean we should use autocomplete? Maybe it would still be good to have an entry in the expression editor. If you don't know the name of the object, you get a clean easier to read list of object-variables and above all you can create an object-variable there, without having to switch to the scene editor first. For everything else there is also an expression menu, I wouldn't remove it specifically for variables, there is no disadvantage to leaving it there.

This has never been possible with expressions. Would be good if this works in the future :)

jack-ii avatar Jun 25 '24 09:06 jack-ii

That mean we should use autocomplete?

Variables must be declared and their names directly used in expressions (without Variable()).

D8H avatar Jun 25 '24 09:06 D8H