Hi there.
I have many instances of one blueprint around a level of my turn-based game.
Blueprint have 2 boolean parameters, let’s call them “Active” and “On”.
On is randomized and player cannot control it directly, so at any given turn there are some On and not On actors that are stored in respective arrays in Level Blueprint (dispatcher “EndTurn” triggers event with resorting logic).
I want the player to be able to make one of On actors Active when player clicks on that actor.
But I also want to allow only one Active actor in level.
Thus, when the player clicks on actor, I want to check if:
- Current actor is On, then somehow notify player if it is not On(that’s easy)
- Current actor is Active, then make it not **Active **(that’s easy)
- Current actor is not Active, then check all other On actors if any of them is Active. If nothing found, make this actor Active. Else, notify player that there’s another Active actor at the moment.
My first thought was to create function in Level BP that has actor on input(to know which actor was clicked), checks things using already existent arrays, then outputs Bool True if any Active were found in On array or False if not. But afaik, there’s no way to call Level Blueprint function from Class Blueprint.
Also, in this tutorial an Event Dispatcher thing is described, but creating Custom Event from 100+ instances of my BP does not look like a good idea.
What else can be done to help with my Blueprints’ miscommunication? Seems like I miss something very obvious…
Thank you in advance.