I wanted to see if there are any tips out there for allowing reuse of level blueprints.
I find myself building a bunch of puzzle logic in the level blueprint where I reference objects in the map directly. I’m starting to think about moving these puzzles to new maps and have a rising feeling of dread settling in.
Any tips on how I can best structure puzzle logic in level blueprints (where I have to make lots of references to actors in the map) to make this less painful for myself in the future?
Hello,
Not sure this is what you are looking for but in file you can “save as” I used this for a maze generator. I saved a base level and use it for each different level with maze in, saving with the dedicated name each time.
To transfer blueprint stuff : You can copy paste full graph content, and variables and functions will copy too, but you’ll have to right click variables and create them (and then set them if value is not the starting one) and fill / create functions (this part sometimes needs some work)
i never code in level blueprints. i make dummy actor objects and put code in there, so on a new map i can just drag out my dummy actors as needed to access their functionality.
I like your approach Furroy. I’ve copied/pasted all of my level blueprint stuff into a stand-alone blueprint. It’s not that different I suppose, you just have to replace actor references with variables and then plug in the references in the scene outliner.
Instead of that manual feeding of variables.
Do: “get all actors of type” and either foreach or pick value of zero item in array (if its just single actor).
However 4.7 makes some improvements to all of this it is better to wait for 4.7 atm than to manually do something that hopefully will be nicely solved in 4.7.
I probably didn’t explain this very well. The blueprint has other blueprint variables defined, I simply plug those in from the drop down once I’ve dragged the puzzle blueprint into the level:
Trying to find the objects programatically would have the benefit of being self-contained but it would have the downside of requiring more logic if I have more than one of said objects in the map - imagine having 2 of the same puzzle for instance. You could work around this by tagging objects for a specific puzzle but this is just slightly more effort than selecting the needed objects in the blueprint properties as shown above.
I use Furroy’s and Nawrot’s approaches as well, no logic in level blueprint and GetAllActorsOfClass, but I can see your problem if you need references to a specific actor and there can be multiple of that class in your level. In that case I would assign them via the level blueprint, but make sure that whatever actor holds your “level logic” is prepared for missing references and prints a warning when that is detected.