Global objects keep same name when an object in other scenes has that name

I have ~40 levels in my project. it will be a platformer game, so there are almost the same platform objects on each scene. not as global, just colpy-padted objects. now I changed something, and don’t want to go back and modify all objects in all scenes one-by-one. so I set the modified versions global (in the same name). now I have two versions of the affected objects with the same name in almost all scenes. is this normal? I mean two object with the same name is not allowed in one scene. it should not have overwriten the old ones when the object became global? and where the event editor will know wich one do I want to use?

Global objects are in a separate list of objects, that’s why they can have the same name. It is a bug though as GDevelop should make checks to prevent that from happening.

GDevelop references object by name, so I guess the first one he finds will be taken into account, by testing you can find out. I’d say it’s probably the scene object as it is the most common place where there are objects (global objects are not common) and GDevelop should therefore search for objects there first.

This should be fixed, but how? Should it override scene objects? Display a warning that objects will be overridden? Refuse to globalize if a scene has an object with the same name?

1 Like

thank you for your reply.
of course I tested it. I was just curious about the official version. unfortunately the result of my experiment was also what he told, the events are used the original object. “scene object” as you called it.

ps. the same thing happened with the object groups.

Sorry if this is necroposting, but I’m now encountering this issue for myself so I thought to share an idea.

In my opinion, the best fix is to use the same procedure already in use when duplicating an object: just add a 1 to it if another object is found with the same name. And if trying to rename, warn that another object with that name already exists.

The tricky part (I don’t know if this will be possible or difficult) will be keeping all the events intact while renaming the global object so that any events that used to reference the scene object(s) of the old name get pointed to the new global object - but in a perfect world I think this is the ideal solution.

If it won’t be possible I think overriding scene objects with a warning is also an okay solution - better in my opinion than having two objects with the same name - which seems to totally break the events so they won’t recognize the global object even after the scene object is deleted.

I think the most important aspect in any solution will be to keep the events working the same for the global objects that they used to with the scene objects, which is the primary challenge with the current system for inexperienced developers (me) with poor planning.

Again, just my opinion… there might be a better way I’m not thinking of.