Oversight around loading from a file

Describe the bug

Not exactly a bug, but rather an oversight with the “Load a text from a file”.
The “load a text from a file” will always save to scene variables, even if the given scene variable is undeclared. It’s likely a holdover from before declaring variables was mandatory.

Steps to reproduce

  • Create a local variable called “testString”

  • create a text file, and place it next to the directory of your game.

  • add an “Load a text from a file” event, and use “testString” as the load path.

If you follow all of these steps, you will notice that instead of the text being stored in the local variable, it will instead be stored in the scene variable “testString”.

Share a very simple GDevelop project showing the bug:

Please can you create a screenshot of your events. You will probably see the “scene variable” icon next to the variable name.

It does. That’s the point, that the event is one of the few that are still tied to a specific variable scope left in the engine.

There are some actions (mostly network or file managent) that only work with scene variables.

Is there any specific technical reason for that?