Re-adjusting levels

I have a game with more than 80 levels. I want to modify a specific event on all levels. Is there a way that I can do this for all levels at once?

You can only edit each event sheet separately. You can use an external event and link it in the scenes. Whenever you edit this event, it’ll get updated in all the scenes that it’s linked in.

1 Like

By “levels” do you mean scenes?

If so, then if you manually added the events to each scene, the answer is no.

What you’re describing is the purpose of external events, but unfortunately you would still have to go through all 80 scenes to update them to external events first.

1 Like

yes, scenes …

I hope that in the future there will be a way to be able to include a specific event and identify it as a “Global Event”

I’m not sure how a global event would work. You can use external events which create a shareable event sheet or you can create extensions or behaviors which can be used in any scene or with any object. Or you can use 1 scene with external layouts.

1 Like

As Keith mentioned, that IS what external events are for. To make one event sheet that you can reuse as many times as you want in as many scenes as you want. Even within the same scene, it helps you avoid repetition by just including the external event sheet when needed.

1 Like

Yes! Project files are JSON. Plain text. So with regEx or a simple search-and-replace you can do anything you want, very quickly.

I don’t know if this would work after creating 80+ scenes. Maybe you mean I should do this from the beginning.
Anyway, I meant a global event like a “Sprite” which I can add in any scene and generalize it to be present in all scenes.

Can you give me an example?

Open the json project file in a text editor and you will see what I mean. I’m sure you already know how to search/replace in a text editor.

1 Like

That’s not really how the event sheet works, as most events are object focused and most objects are scene specific.

Yes, you do need to have some pre-planning for using external events, but your ask around having an event that can apply to all scenes is one of the explicit purposes of external event sheets (Or functions/extensions, but those are mostly just external event sheets turned into a condition/action anyway). You’re not going to be able to find/replace events in every scene within normal GD5 standards.

Modifying the JSON as mentioned by per is definitely possible, but it will require you to know the json for the event you’re wanting to replace, and the json of the new event you want there. Any formatting errors will outright corrupt the project. Definitely still doable, but you need to be exact and methodical.

1 Like

For now, I will edit each scene one by one to avoid complications and errors. Then we will look at this through a new experimentation project.

Thanks for the clarification- per & silver

Keep in mind, external events need a scene to base them on. So you may run into problems if not all objects are the same type and name across all the 80+ scenes.

If all the scenes have the same objects, for example if you’ve created new scenes by duplicating an existing scene, then you could look into using only 1 scene and instead have an external layout for each level,

If you name each level’s external layout incrementally (so “Level1”, “Level2”, Level3"…), you can then store the current level in global variable, and using a “At the beginning of scene” event load the eternal layout. Somethign like:

1 Like

I expect this to be done as a “levels selection” through external events, getting blocked and unblocked, I mean similar to that but the event is different