GDevelop icon indicating copy to clipboard operation
GDevelop copied to clipboard

Nested/Child Instance Variables are not editable

Open AtomicCrocStudios opened this issue 3 years ago • 4 comments

Describe the bug

I know this was a bug before, so I am not sure if it has snuck back in. As of beta 110 you can not edit instance variables if they're a child / is nested. I have attempted to covert them to a string/number but no change.

If the variable does not have an child / is nested, it works fine.

image

Please double check that the bug is not already reported in the issues list.

To Reproduce

Steps to reproduce the behavior:

  1. Create an Object with a Child / Nest Variable.
  2. Place it on the Scene.
  3. Unable to Edit.

Other details

  • Windows 10
  • Beta 110

AtomicCrocStudios avatar Jun 05 '21 04:06 AtomicCrocStudios

In instances list there are icons for add, and another for change types of variables, i can't see the icons, are you really on beta 110?

image

Anyway, can you send a project file for reproducing the issue?

Bouh avatar Jun 05 '21 09:06 Bouh

In instances list there are icons for add, and another for change types of variables, i can't see the icons, are you really on beta 110?

image

Anyway, can you send a project file for reproducing the issue?

In that image you're not using a child/nested variable.

If the variable does not have an child / is nested, it works fine.

110% sure I am in beta 110

image

Here is an example project: InstanceVars.zip

AtomicCrocStudios avatar Jun 05 '21 09:06 AtomicCrocStudios

Hi @AtomicCrocStudios,

Here is what's happening (and that is maybe not clear with the UI):

  • In the example you sent, your object has 2 (object) variables:

    image
  • When you change youCanEditMe to 5 for instance, the IDE creates an instance variable with the same name youCanEditMe with value 5, that overrides the object variable:

    image
  • And if you click the Reset button on the newly created instance variable in the Properties panel, it removes it so that the object variable is now the truth value:

    image

Changing the children of an object Structure variable at the instance level is a bit trickier, it would need to first copy the whole object variable in the instance, and then change the value of one of its children. You can do it by:

  • Open Instance variables dialog:

    image
  • Click Edit object variables

  • Select YouCantEdit

  • Copy it

  • Come back to instance variables dialog

  • Paste it

  • Modify the child value

And if you close the dialog, you can see that the instance variable in the Properties panel now appears as an overwritten object variable and you can edit its child:

image

We should maybe add a button for Structure object variable to give the possibility to directly copy-paste them at the instance level from the Properties panel instead of having to follow the above path to do it.

But it could bring confusion because if one does it, and then changes the object variable (adding a child for instance) expecting that every overwritten instance variable to have the same change, one would be disappointed.

But it could be a whole feature to develop.

AlexandreSi avatar Feb 11 '22 09:02 AlexandreSi

I just saw the same issue referenced in https://github.com/4ian/GDevelop/discussions/2351

AlexandreSi avatar Feb 23 '22 14:02 AlexandreSi

I close this issue. The problem doesn't occur since changes in the app.

Bouh avatar Mar 14 '24 14:03 Bouh