Crank Puzzle to Plate Puzzle in "Forgotten Memories"

 Name: Jared Barker

Date: April 5th, 2023

9:43 PM EST

Crank Puzzle to Plate Puzzle in "Forgotten Memories"



The Problem:
The problem with the crank puzzle is trying to get the player to push the lever and rotate the crank by 180 degrees. I originally thought that it would rotate by setting the physics to true whenever the player collides with the pole. Next, it'll check to see if the rotation is correct. If it's at the correct rotation, then the puzzle will be solved and the door/gate would open.





The problem with that is that when the player pushes the lever, it pushes the entire actor and tilts it till it falls down. This can be a problem because not only will it make the difficult to check if the puzzle can be solved or not, but it'll be extremely difficult to see if the crank will rotate without the locks for the x, y, or z location. I tried making a second one where it has a physic constraint connecting the two mesh, but it didn't move at all when trying to push it. 





The Solution:
I decided to scrap the idea for the time being and create the plate puzzle. So in that puzzle, if the player presses the plates in a specific order then the puzzle will be completed. 
So in the blueprint construction script, it loops through the length of the correct code(which is our string variable), next it gets the substring of the randomized code variable while adding the static mesh component with spacing. After that, it adds the collision box after setting the mesh relative location, then it set the component tags from the make array node. Finally, it binds the event to the auto-generation function event.


After the construction script, we move on to the Plate automatic generation function. In that function, it simply cast into the player's character while getting the component tag variable, calling the add code function, and returning the node.



Lastly, there's the Add Code function. In that function, it appends the inputted code with the function and set's the input code. 


Next, it checks if the length of the input code and the correct code are equal. If it's true, then it will check if the codes themselves are equal. If that's also true, then it'll complete the puzzle and it'll activate the blueprint that you want to use (like opening the door). If not, however, then it'll reset the input code.

 
There are more puzzles that needed to be done, but this should cover one of the puzzles that will be implemented in the game. I may use the crank if I can solve it in time, but for now, I'll scrap it and move on to another puzzle.



Comments

Popular posts from this blog

Xodius Studios Blog #5 Notification Pop Up, Intro-Level Design, Menu Indicator, Pause Menu UI Bug, and Interaction Bug

Importing assets and animations from Unreal 5.0 to Unreal 4.27.2

AI Adventures #14 Polishing the game for demo release - "Forgotten Memories" - By Michael Marquez