rdBPtools Tutorial 2.3 – Nesting Blueprints
Last Updated: 3rd December 2024
Tutorial created using rdBPtools version 1.40
One of the most powerful features of rdBPtools blueprints is that they can be nested within each other – it becomes very easy to have sub-blueprints which have their own behaviors and randomization.
To keep it powerful, the random generator has to be able to work up and down the chain of nested Blueprints producing the correct (and repeatable) random numbers – all children Blueprints will get their random numbers from the top-most rdActor Parent – choosing a Seed for the parent will set what the random will be for all children. Using a random Seed each time produces random for all children too (except if over-ridden).
In this tutorial, we expand on the random plant from Tutorial 2.2.
Step 1. Build the RandomPlant from Tutorial 2.2.
If you haven’t already, go to Tutorial 2.2 and create the random plant from the 3 selected actors. This is our base blueprint.
Step 2. Create the randomization for the plant and a pot.
The next step is to tell our actors how we want them to be random.
Add a pot and saucer to the level, and then place the random plant blueprint onto the pot in a way that it looks like it is growing properly (allow for some random movement).
Right click on the RandomPlant blueprint and select “Randomize Settings” from the rdBPtools SubMenu.
Now enter some value to describe how we want it to be random. The image to the left shows how the plant will be a random Yaw around -180* and 180* and with some slight movement (between -1,-1 and 1,1 with z remaining static)
The scale is randomized too – only slightly in the x/y but slightly more in the z.
For the pot, just a slight movement and a random Yaw between -180 and 180 is used.
Step 3. Set the RandomPlant to NoHarvest
Now we want to ensure the random plant doesn’t get harvested when creating the prefab so it retains it random variation. It’s simply by adding the Tag “NoHarvest” to the Plant prefab:
Step 4. Create a new Blueprint from those two actors.
Now we select both those actors, Right-Click and select “Create from Selection” in the rdBPtools Submenu of the context menu that opens.
We want it to be based on the BP_ContainerBaseX Blueprint so select that, and we want it Collated in Folder (just because), Randomized. If you’re using rdInst, tick Instanced Static Meshes too – if not, use StaticMeshes as there’s only one instance of each mesh being shown.
As the Plant has the NoHarvest tag, we don’t need to worry – but if you don’t want to add the tag for some reason, you can also stop the Prefab Creating from harvesting them by un-ticking the “Harvest” options.
Then just click “Create” to make the Prefab.
Step 5. Done.
We’ve now added size and location variation to our plant.