top of page
Search

Aethersea: How do you solve a problem like Corruption?

  • mfordyce200
  • Mar 17, 2022
  • 2 min read

I am truly cursed.


For the second time in this semester, my project has corrupted. Thankfully, I still had my backup file ready to go to continue working. Unfortunately, I didn't update it with the edits I made last week. Things are not going well to say the least.


Either way, we adapt. Ensuring both our new live project file and our back up are functioning, we set to work continuing to add new features. I also decided here to drop the camera. I had been having continuing issues making it work along with our new dialogue code, and it was not cooperating. Weighing up what was more important for the project, I chose to drop the camera and go for a more classic Baldur's Gate esque approach.


Speaking of dialogue, we have dialogue now! Thanks to our Interaction interface, we now have a (not pretty) working basic dialogue system. Also set up at this time is a new Dialogue CSV file, allowing quick and easy changing of dialogue without needing to open up the full project

ree

The intent here is to act as though I am receiving dialogue from a writer, and implementing it as a designer. To implement these dialogue elements, we have created a brand new pair of functions within the NPC_BP Blueprint. Dialogue Create, and Dialogue Get Lines


Dialogue Create is simply a function that creates the dialogue widget and then calls Dialogue Get Lines to change the line being displayed.


ree

The more interesting code is in Dialogue Get Lines.


ree

Here, the dialogue is being checked to make sure it matches the right conversation, and is being displayed in the right order. An additional check is also made to ensure only one line of dialogue is being passed through to Dialogue Create. If too many or too few lines are being passed, there's a batch of reset code that also acts as removal code for when the conversation ends.


This function is called by a Player_Interact function call, which the blueprint recognises thanks to its added Interaction_I Interface. Within the NPC blueprint itself is some additional code, shown below.


ree

The top section is activated on session start, and retrieves all the lines of dialogue for that specfic NPC, as defined by its NPC_ID. By doing this, we can also set multiple generic NPCs to have the same ID, and thus the same dialogue easily within the level editor. Also included here are some additional flash upgrades, including having the NPC face the character from where ever they start the conversation, and some code to add and remove an interaction prompt on the player's screen.


ree

ree

As you can see in the game, both the NPCs shown here have their own dialogue, and face the player from their original positions. Finally, we did some additional work to test the function using the chests behind the NPCs. These work on the same Interaction_I Interface function as the NPCs, but rather than have a dialogue CSV and data structure, they have a simple Text variable, that is passed to the Dialogue Box widget when the player interacts with the Chest.


ree

Moving from here, we're going to aim to have a more advanced version of the dialogue with player reaction and choice. After that, we're going to adapt our chests to be part of a new inventory for the player!



 
 
 

Comments


bottom of page