• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Different dialogue lines for different npcs

1

100thKnight

Guest
This is my first post so i hope that's the right section. So basically what i'd like to understand is how to make different npcs have different dialogues. I already have my dialogue system and it works, when the player press a button and there's place meeting with an npc, it creates a textbox with the dialogue, but i don't know how to display different dialogues for every npc. For the place meeting i use a parent object which all the npcs are child of.
 

kburkhart84

Firehammer Games
Assuming you want to use parent/child objects so that NPCs don't have to be different objects for every one, I would store all dialog somewhere, say, an array or data structure. Then, you can just put an index variable for each piece of dialog. I'm sure there are some freely available dialog systems out there that you could use for reference as well.

The main point is to keep to keep the actual dialog separate from the objects that use it. Then, its easy to replace and update as needed. And you can eventually add things like languages, regional changes, etc... if all the NPCs just access the stuff from a single point of truth.
 
Top