In gdevelop 5.6.281, Undeclared children variables are marked as errors in the editor (they were not marked as errors in the previous version of the engine)
Steps to reproduce
Create a structure variable with one child declared (example, foo with child bar).
Modify the declared child variable using the point as an accessor. The editor does not mark it as an error.
Modify an undeclared child variable, once again, using the point accessor. The editor will not allow it.
Modify the same undeclared child variable, this time using square brackets as the accessor. This works.
The thing that makes it weirder, is that when you go into the action or conditions pop-up, it does not mark it as an error.
Why are you doing this? Is there a feature that you are going to implement that requires us to not have the ability to use undeclared child variables?
When you previously removed the ability to use undeclared parent/top level variables, you told us to use structures if we wanted to have undeclared variables. But now it seems like you are doing another sweeping change without even warning the community in advance. Again.
Please communicate with us before doing major changes to the engineâs functionâŚ
Hey fella, I donât remember seeing you in the front-line infantry during the Vars WarsâŚ
Anyway, I was right there at the front, sounding the charge, when someone grabbed me from behind and dragged me away from the âfriendlyâ fire, saving my life in the process.
Then he told me something Iâll repeat to you now:
I didnât mean it seriously⌠and it wasnât about you. but It actually did happen to me for real in some of that threads but it wasnât you or any of the dev. Iâm sorry if you got the wrong idea.
Nah, donât worry, I could never get mad at you.
You could literally crumple me up like a piece of paper and I wouldnât even react.
That being said, Iâll admit the new update caught me a little off guard at first⌠it took me a while to get the hang of it.But this time, at least for me, it didnât really hit me (as far as the project is concerned) hehe,.. so i stayed on the sidelines.
Davy I think you may be talking about something different from the OP.
There will always need to be a way to use undeclared dynamic variables for logic, which is supported by arrays and structure variables. The OP is saying that the editor is now treating this as an error if using dot notation (structure.mydynamicchild) whereas it didnât before.
They arenât saying that undeclared variables should be allowed in general, just that the method that is allowed today shouldnât show up as an error.
There has been no change for dynamic access. You can still do MyStructure[MyIndexVariable]. Only variables like MyStructure.MyChildStructure.MyNumberChild becomes red when they are not declared.
The biggest issue is that it retroactively breaks projects that previously worked with the point accessor and undeclared variables.
Adding a compatibility-breaking change in a minor update is, frankly, a poor practice.
It also doesnât really make sense to stop people from using the point accessor to use dynamic/undeclared variables, as all the features that you mentionned as advantages of forcing declared variables already worked without actively stopping the user from doing so.
It doesnât break projects. Unless there is a regression I donât know about, you donât have to do any change. You can run your project and it still works the same.