4ian / GDevelop

🎮 Open-source, cross-platform 2D/3D/multiplayer game engine designed for everyone.
https://gdevelop.io
Other
11.29k stars 871 forks source link

Update modified variable names on the Event Sheet #5571

Open LuniMoon opened 1 year ago

LuniMoon commented 1 year ago

Issue based on this forum's topic request:

Need feature to automatically update variable names in event/action sheets across game based on the changes done in Game Settings> Global variables or in the instance through Properties, or in the object through Object >Variables.
For example,

If the instance variable InstVar for an object has been renamed to InstaVarNew through Properties, any events/actions where InstVar is used should be automatically replaced by InstaVarNew.
If the GlobalVariable (LevelVar) is restructured as GlobalVariable(PlayerStats.Levelvar), then events/actions where LevelVar is used should be automatically replaced by PlayerStats.Levelvar.
This feature will help developer quickly implement the changes to the structure/variables and evolve variables model as appropriate. Currently, after making the changes in Instance/ObjectVariables/Game Settings> Global variables, developers have to update the variable name/structure manually in the event sheet.

Please note that this change is only request for any structural/name changes to the variables and not their type (changed from Boolean>Num, etc.). In case of such changes, the corresponding events where these variables are being used must be highlighted for developers to review.

Today variable names have to be updated by hand if their name has been changed via properties. In order to be more efficient and reduce small repetitive actions, GDevelop's system is required to update the names of said modified elements.

Input from engineering: some exploration is needed since a scanning of the event sheet would be required in order to update the changed names.

kons-dev commented 1 year ago

For the time being, could this be done by search and replace in the json file?

4ian commented 1 year ago

You can do it on your own like this - but be sure to make a backup of your json file before because there is a risk of corrupting it or replacing things that are not your variable if the name is too generic/too short.

That's why it needs to be done by GDevelop to be 100% safe :)