Getting chatty


I’m currently working on NPC dialogue. Players will be able to participate in a branching dialogue with certain NPCs. To this end, I have designed a scripting language for dialogue files.

The scripts are inspired by those used for interactive fiction games / interactive novels. They are written in such a way that they are both easy to author and easy to translate.

Currently, the scripting side is well developed; touching a trigger or character initiates dialogue; parsing the scripts from SSQC basically works (string buffers); and strings are being sent to CSQC for rendering. Next up is programming the actual display part in the CSQC GUI code, which is why I created a mockup. I’ll need positions for the background and each line in percent of the screen size, and the only way to get those is applying a good old fashioned tape measure. It’s done like this for all CSQC displays in SJ.

Stuff is subject to change, especially the background.

Here’s an example snippet from a dialogue script:


Dialogues can be as much as 10 levels deep and 10 – 12 lines can be displayed per page.

The player will receive quests via dialogue (except the main questline, which auto-activates in the first level and daisy-chains from there.)

As far as I know, FTE has full support for UTF-8 which will become interesting once translations are made (there will be at least English, German and Danish versions.) Strings from code can be translated, too, by GNU gettext.

I’ve been putting branching dialogues off for a long time, because I was unsure how to display them – an old idea was to use a console object (FTE can display multiple consoles and they also support links.) Well, it somehow fell into place now and I guess consoles can still be useful elsewhere.

I have to thank Spike, as usual, and this time also Sharkbanana (who is working on a game using FTE as well) for a pile of grizzly programmer wisdom. I’m sure I can be a nuisance sometimes. Programming stuff like this robs me of my last nerve and only large doses of metal music will ease the throbbing brain ache. \m/


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: