I’m working on a Level Design Toolkit, so I’m working a lot with construction scripts. Currently, I’m working on a door system which can let you set specific keys to open doors.
My question is the following:
When selecting an object via the editor, I can set variables for specific actors, for example:
This is where it gets messy.
I need to check when this variable is NULL or None. So basically I’m using the ‘is valid’ node which works perfectly. The issue is that after setting this variable to null, I lose all the references from that object.
My instant thought was to create a temporal variable storing the selected actor from the editor, but it keeps setting it to null eventhough this is not the original variable, like if it was being stored as a reference in memory and not as a value.
I’ve tried setting the temporal variable only when the original wasn’t null, but it didn’t work.
There is on HUGE problem with construction scripts.
You should not use references to other actors in levels inside construction script.
Construction script fires when actor is loaded by level. At that point there is no guarantee any other actor is loaded into level, it all depends on load order, which is different in editor and in packaged game, also many things that editor fixes when are running from editor, are not fixed in packaged game and may crash it.
For level design toolkit either use C++ or PCG system. You can also check Dungeon Architect, and Prefabricator plugins from FAB.
ps.
Or you are doing actual editor tool in blueprints? Well problem may be that ASSET reference is to actual asset on disk, while spawned actor reference is to actual actor in level, unreal is confusing in which one is what. Same with code in blueprints, you have actual blueprint class code, then multiple copies of code that are actual spawned actors code, confuses people a lot while debugging.
Maybe I chose the wrong words. I’m not working on a Procedural Plugin nor something similar.
By Level Desing Toolkit I mean; a useful kit of already made systems such as door systems, splines, measuring objects, etc. I’m not using this in play mode, just for the editor.
For this I’m using Blueprints but I had to do some stuff on C++ because some nodes weren’t available for Blueprints.