Skip to main content
GameDev.net gamedev.net

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro — $3/month.

Showcase of character dialogue displaying

Showcase of character dialogue displaying

Aristotel
Arhim's Journal · · 1 min read
1,956 2
Hello GameDev,

just a little something I made for displaying conversations in the game (and a perfect opportunity to try out screen recording). The following "conversation" was generated from this txt file:

[indent=1][CHARACTERS]
[indent=2]n = 3
char1 = Neil
char2 = Andy
char3 = Olaf
texture1 = data/img/portraits/Neil.png
texture2 = data/img/portraits/Andy.png
texture3 = data/img/portraits/Olaf.png
[indent=1]
[TEXT]
[indent=2]text1 = Andy, do you copy?
text2 = Yes Neil, what's up?
text3 = We got reports of enemy forces moving in from the south.
text4 = Your job is to take them out.
text5 = No problem!!!
text6 = What?! Orange army COs, this is gonna be fun.

The class loads up the file (using the config manager) and start parsing through the lines. The "<>" are used for specifying different commands. The is used for changing characters and is used for making dramatic pauses. The number of commands can be later extended if needed.

Additionally, when the mouse button is held down (or any keyboard key), the parser increases the scrolling speed and starts to skip over the 't' commands.

Cheers smile.png


Discussion

Loading comments...