Download

How do I make Blueprints composable?

I want to make a blueprint for a room and I want each room to have 2 lights in it. I want the room blueprint to have 2 input variables to determine the state of each respective light in the room. I.e. I want to expose the parameters of the light blueprint to the room blueprint. So at a high level my data looks like:

cell1: { //This is a Room type
door_light: { //This is a Light type
on: true
}
window_light: { //This is a Light type
on: false
}
}

cell2: { //This is a Room type
door_light: { //This is a Light type
on: false
}
window_light: { //This is a Light type
on: false
}
}

I know that I can bake in the light behaviors into the room so that there isnt a child blueprint and that would work, but it would lead to a lot of duplication as I hope to extend this pattern to other things as well: doors, light switches, and other objects in the room too. I would like to do this in the constructor script so that I can see what the results look like for every cell in their starting orientation. How do you all achieve this sort of composability?