Hello, this is my first time using this forum for help with something I am stumped on. I am trying to make a puzzle where the player has to interact with three wind chimes in the correct order to open a door, but I cannot get it to look at the three indexes all together. I have a couple of pictures below with the puzzle manager and what the chime blueprint looks like. The player blueprint calls on the chime blueprint first. Any help would be appreciated.
You can just compare the arrays like this
You also seem to be clearing the player sequence if it’s incorrect. Which it will be for the first 2 chimes.
You only need to check when the array length = 3, you also need to limit the array len to 3
Thank you very much, I knew I was missing something!
I’m sorry, though this helped me greatly. I’m struggling with the array comparison still. I’m trying to get it to clear the player sequence once the chimes have been interacted with incorrectly, if it was done in the wrong order, it would softlock and become impossible to solve after that. Do you have any more insight for this?
This is what I have after the solution in the puzzle manager.
You need a button ( or similar ) to push for the player to try and open the door. If they have the combination wrong, that button can reset the player seq array. That way, its always a simple comparison like I showed above, does the player seq == correct seq.
If you don’t have that button, you’re left with the problem that you have compare the arrays by shifting them around. For instance, if the correct answer is 123, and the player rings 13123, that’s kind of correct. They did do 123, right after the 13. See what I mean?
Looking at your code, I think you have a central ‘puzzle manager’ actor, and each chime registers being run with that?
Here’s my windchime
The puzzle manager
And the door
If you want to be able to do this without the door button, then you need to be able to shift the player array around to look for the correct combination. It may not be the game mechanic you want.
Another way, is to make sure the player can only interact with each chime once, and then needs the door button to reset them. Very similar.
Your are correct, the puzzle manager I have is the central one that receives the Chimes ID or index, the comparison runs through there and the door ref isnt exactly a button, its to destroy that door ref when the arrays match. Destroying the door is not what I intend to have happen but thats what I went with for testing.
Did you try the code, does it work for you?
At the moment, I can’t work on it right as someone else is doing something with the project, I’ll get back to you once I’ve tried the code.
The code works as intended. Thank you for your help!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.