Well, what I’m basically doing is scripting something for a very specific level in my random level generator. Normally, something scripted for a very specific level would be done in blueprint, but my level generator is still in an early stage where I can’t really do low level stuff with it in blueprint. It’s all in C++.
I have a lot of things in my random level generator configurable through blueprint with UPROPERTY and other things. And I have these objects called PostPassEvent objects that let me do some really level specific custom behavior that can’t be done as easily with the generic system I have in place. This is used for puzzles and other very specific things that only that one level will require. My blueprint object has a class reference to a PostPassEvent object. This PostPassEvent object is actually doing some custom behavior in C++ though.
So, for example, on level 2 I need to spawn a locked door from an area that is farthest away from the starting area in my area graph, and then spawn a key that is somewhere else. This should be done in blueprint, but I haven’t exposed blueprint event methods for this kind of thing, so my scripted events have to be done in C++ for now.
Spawning a locked door an key puzzle can potentially be generic enough to be reusable all over the place, but a very specific example is on level 1, traversing my area graph and making all areas branching off of the shortest path between the start and exit have locked doors until a certain objective is completed. This will allow players to quickly get to the main objective in a linear level, and then suddenly the game becomes nonlinear and lets them backtrack and explore once they are no longer noobs and have completed their first basic objective.
Doing this in C++ and not blueprint isn’t the best, but it works and lets me get the game out. I have to cut corners in just the right places or else I’ll be stuck working on this game for years.
Believe me, I care about writing high quality code