06/01/2023 - Door Progress


Current Mechanic State

So far I have managed to complete several steps of the door including a placeholder opening trigger and a complete unlocking mechanism. The door is initially locked, to open it the player has to knock, and then sign the paper that comes through the letterbox before returning it. Currently the player does not have to actually sign the paper and I am unsure whether this will be implement as I am unsure how I would track changes to the render target that would be attached to the paper. The door can be seen in action in the video below.

https://drive.google.com/file/d/1Tn4mCVTSmRGZQQQbKqsa0z_yYeJ_p1sv/view?usp=share...

Currently the process of opening the door is just a collision overlap trigger for the players controller. I would like to develop this further so that the player has to physically turn the knob and push to open the door.

Development process

Door Design

The door consists of several components including multiple collision boxes and a scene component I used to store a location.

Unlocking the door

Initially upon runtime, the door is locked and the player has to perform several actions to unlock it. These can be split into three sections.

Knocking

Knocking is triggered when the something overlaps with the door's collision box called knock box. It then checks whether the letter has been spawned yet, if that is not the case then it does so after a short delay. Note that the collision checks whether the colliding object is the letter. This is due to my experience with testing it when the knock would trigger when taking the letter out of the letterbox. The knock is just a print string for now, I will replace this with an audio clip later on.

Spawning the letter

In the open flap macro, the below code takes place. The first section is a small animation of the letterbox flap opening. After a short delay an instance of the letter actor is spawned. The location of the spawn is the letter spawn scene component. This is positioned to be behind the letterbox so the letter can come out with a small animation. The letter spawn scene component was created to have an easy way to find the right location behind the letterbox without having to take rotation and world coordinates into account.

After spawning the only thing the letter does is a small movement animation of it moving out of the letterbox.

Submitting the letter

Note that this section is in need of some extreme remodelling as I have since learned of the set timer by event node which would simplify this process greatly.

There are several delays that occur in the letter submission process, the first is triggered when the letter first leaves the collision box.

After the delay timer is finished, the player is able to submit the letter back into the letterbox. The code checks whether the letter is overlapping the collision box, and if it is not being held before triggering the submission process.

The submission process consists of moving the letter to a position to start the animation from, and then destroying the grab component of the letter so the player can no longer pick it back up.


The below shows the animation section of the letter. This is done using delta timing though it may be redone with a move component to node if I can get that to work. After this, the close box trigger for the door actor is triggered before the letter destroys itself.

The door's close box trigger simply starts an animation of the letterbox closing.

Opening the door

The current process of opening the door is simple, if the players motion controller overlaps the handles collision box, the code checks whether the door is locked before either printing locked, or performing the open door macro.

The open door macro performs three simple animations, the handle turns, the door opens, then the handle returns.

Leave a comment

Log in with itch.io to leave a comment.