I’ve started work on my second game and I’m still playing with a bunch of ideas. One idea I wanted to try was something I thought would be simple, but is giving me some trouble.
Basically, I have some pillars that activate when the player approaches. At BeginPlay each pillar adds their “IsActive” bool value to an array in an instance of a tracking BP placed in the level. They are updated in the array each time the pillar’s “IsActive” state changes.
I’ve set it up so I can theoretically add as many of these pillars as I want. As long as I assign the correct instanced actor value of the tracking BP for each pillar, I’m able to know which of the pillars are activated, and which aren’t.
So I have the tacking BP that keeps that track of which pillars are set to “true” or “false” but I don’t actually know what to do when all the bools in the array are set to true.
Since this relies on specific instances over hard coded values I’m not really sure where to proceed from here. If this was a one-time set up I could make the thing go through each array listing and check its value, but since the number of listings in an array can change depending on how many pillars I want to use I need it to be more flexible than that.
Is there an easy way to check how many listings in an array are set to true, compare it to the total number of items in the array and then activate another actor if they match?
I’ve tested the state tracking pretty extensively and it works, so that’s not a problem. I just need to know how to get the tracking BP to realize that everything in the array is set to true and I can take it from there.