Dynamically assigning one blueprint to another

Hey all,

This is an odd one, I will do my best to explain it. So, I use an asset from the Marketplace that stitches individual levels/maps (as modules) together to procedurally generate a larger dungeon. I’m looking to do a fog of war type effect when entering each such room.

To accomplish this, I have BPs with collision boxes to act as the trigger and a Plane that sits in front of each room that dissolves when triggered by the previous BPs. I’ve tried having a public variable on the trigger BPs and it doesn’t work, even though they appear to be properly populated in the Details area, but if I pause the game with SHIFT-F1 and set the variable after the dungeon builds, it works fine (even though the name the same). If I try soft references, I get a similar error to this: “graph is linked to object BlueprintGeneratedClass in external map” when trying to save the parent level holding the dungeon. I have also tried adding tags and Get All Actors of Class with Tag in the Begin Play of the specific module but still no dice.

I’m trying to do it this way, to just get the plane in front of each room so that only that rooms fog of war is removed when entering that specific room.

Likely complicated even more by the fact that the dungeon building asset is in a streaming level, inside of a parent persistent level.

Any thoughts appreciated!

1 Like

So the player walks into a collision box just before entering the next room?

Why not just make this functionality part of the streamed level with the room in? Then you always know which room you’re talking to.

( I might have fully grasped the situation… :slight_smile: )

PS: You can use ‘get actors’ of class or with tags to find the right room if your collision boxes are in the persistent level.

Almost!

The boxes are inside of each room, so the FoW disappears for each specific room when entering said room.

I am doing exactly as you’re saying, but it’s not working:

1 Like

Sorry, don’t quite get what’s going on here… :slight_smile:

If the boxes are in each room, then why not make a blueprint for each room, containing the collision box and to FoW. That way, you can clear the fog on overlap, and you don’t need to figure out which one is which :sunglasses:

Thanks for your thoughts!

So it does work like this, but unfortunately, I can’t move the colliders separately from the FoW plane as it’s all in a single blueprint and each room can have up to 4 entrances. And then there are also different sized rooms. Each now will need its own FoW blueprint to accomodate.

However, I think I should be a to just simplely box the entire FoW plane in 4 box colliders. One on each of the 4 axes. I would imagine there would be an initial performance but I should think it would happen as the level is being stitched together anyways so may not be noticeable to the player.

I’m new, self-taught an unaware of this could be a massive performance issue.

Thoughts?

And again, very much appreciate your input :slight_smile:

1 Like

If you double click the BP, you’ll notice you can move the various components separately ( they go a kind of very light yellow color ) :slight_smile:

You can also scale them to fit the room.

You could also use 4 colliders, it won’t be a performance issue :sunglasses:

Oh heck yes, exactly what I needed.

Thank you!!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.