Let’s see if I can explain myself. There is this one level, the map is all white, then on the right there is a box, when you click it the color changes, now it is red. You place it on a floor plate and this causes all the red doors to open unless those doors require another color as well. Suppose there are two doors and both need blue in addition to red, so they are not open. But there is a button. Then you go and click the button two times and you change the color of the button to blue. Then a door opens, the second one, you press the button and the first one opens but the second one closes.
I have variables set for the color. Now I want the door to check these variables whenever the box is on the plate, and if they are true then make the door open (I know how to animate it, I just need the conditional part).
Why not just use the AND conditional node? You will need an Interface to communicate between the doors and the puzzle pieces. More information on actor communication can be found here.
I don’t seem to find any luck in that actor communication, perhaps I am not in the right blueprint to do so? Where should I put the instructions and the conditions?
Okay, I am going to make it simpler, because I still haven’t found a solution yet right, I should have replied sooner… So, let’s say that this is the part I want to change.
I would want to instead of let the boxes array be there, change in for the boxes in plates array that the plates created and that checks whether there are boxes overlapping them.
You can simplify it further: if a valid box is in its plate, set a bool to true, if it leaves the plate, set it to false.
Every time a box is in a valid plate, after flipping the bool, loop through all the bools to see if they are all true meaning player has set them all.
If even one is false, break out of the loop and wait for next box to be placed to check again.
Like this you have a plate actor that waits for a valid box, when this condition is met it communicates to another actor and tells it that its bool is true and to check the others.
Now that I look at it and do it accordingly, this solution doesn’t fit what I wanted because yeah, right, boxes have to be on plates, but they can be on any plate and still work, not all boxes have to be in a plate for a door to activate, furthermore, some levels may have more and less plates, not just a set of boxes and plates for every level. So what I thought is check if the boxes are overlapping with the plates and create an array from those, then use this array to check for the color. How would you do that?
I mean, I could do something with what you show in the video but my idea was rather to have the doors be able to require multiple colors, and only one of them, let’s say a door needs blue and red, then there would only be the need for to plates, and to change the color of the boxes to those two for the door to open.
Still, thank you very much for your effort I am learning a lot believe it or not