Let me give you a quick example, in Zelda Ocarina of Time as soon as the game starts and you get outside your treehouse, Saria comes and greets you. As you can see, this is an unique event that only happens once in the whole game and won’t happen again until you start a new game. There are many unique events in an adventure game so how do you work with this? I was putting these one-time events in my level blueprint but it started to look like a really mess.
Do I need to make a special blueprint for each one? They all could be instances of a parent blueprint yet every child will have different code, I don’t feel this is the proper way, creating a blueprint just for one-time trigger event in the whole game, but I don’t know maybe you could say “it doesnt matter is just code”.
I think, that your way of doing it in the level blueprint is ok. I remember, that in some Unreal Livestream, some rule of thumb was mentioned about things to be good candidate for the Level Blueprint:
Things that are specific to this single level only
Things that are to be done only once
So, exactly, what you are looking for.
To avoid this looking like a mess, you can use collapsed nodes, create functions and also create new Graphs to keep things organized.
I see, I imagined that it would be something like that since other blueprints don’t work really well with things that are already in the level. Well that solves my problem. Thanks.
Other Blueprints can access object in the world, using for example GetActorsOfClass. This one just should not be used too often, so a bad place is in tick. But if you do it in BeginPlay for example and keep a reference, this is ok.
On the other hand, placing everything into the Level BP is something one might be tempted, because it is so easy. For some prototyping and testing, that’s ok, but keeping things in places where they best fit, is important.
In your case, for those parts happening once for a specific level, the level BP is ok, but of course, not everything should go there.
What is it is a level that the player revisits and has to reload the map? What is the best way to make sure the one-time events, such as cutscenes, or upgrades don’t reset?
I’ve become wiser. The trick is to use DataAssets. Make a simple DataAsset, it doesn’t need any variable, then put it a name in your Editor for example. FireBossKilled. When you kill the FireBoss add that DataAsset to a variable that can be saved in the SaveGame, I like to save em all in an array of all my DataAssetsObtained.
Now, when you start your level, tell the GameMode in the BeginPlay() to make an IF check to spawn or not spawn the FireBoss like this.