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?
You could have 1 BP telling the doors what to do, not the doors checking if conditions where met.
For example this is everything in the door bp:
All logic is being managed by another bp that tells the door what to do:
An array with reference to both instances of the door:
you can read this:
then use this: Online Karnaugh map solver with circuit for up to 6 variables
it will give you result such as this: y = A’C + AD’ + B’D
And you code this this NOT AND NAND nodes.
Use TRUTH tables it confuses next person that is debugging your code.
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.
Right, but then how do I send this to the door?
When the actor that has all the bools loops and doesnt find a false, trigger an event for the door to unlock/open.
I will try this, thanks for your help pezzot1!
Post your advances! These types of puzzles are fun.
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 feel I’m not getting the idea across on how this can be done… or how I would do it. So I’ll create a quick demo later.
I see you also posted this here: Set of conditions - Programming & Scripting - Unreal Engine Forums
So I’ll probably respond over there.
AnswerHub is down
This is the quick demo: ThirdPersonPractice Unreal Editor 2021 11 25 01 54 58 - YouTube
Am I close?
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