Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Creating a Dialog scripting routine

Author
Message
Kezzla
17
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 20th Oct 2013 15:52
Hi all,
As the thread title suggests I have been working on creating a scripting system
That is to be used for player/NPC dialog.

The way that a conversation branches can be very complex and up until now I have had trouble
with the whole thing.

Now I think I am getting somewhere. I would like to share what I have so I can get some feedback
and advice from others who have also worked on this problem.

Example program is attached.

I am not posting code at this point as this project is a jumbled mess due to me exploring many options.
I would be embarrassed to have it seen at this point, but when I have it cleaned up and optimized I will share the code.

what is shared is the scripting system I have been designing.

It is very simple.

it works like a normal subroutine.

this is the basic format.



So it searches the text file until it finds the target label
it uses > as a token.
line> is for lines of dialog
break> adds a horizontal line for seperation
choice> a sentence that can be clicked on followed by a token>the target label that the routine will point to if this option is clicked.

you can edit the script file yourself and play around with it.

I am interested in others methods of tackling this problem.
Can you think of a simpler and more versatile way of creating a dialog system?

share any thoughts, ideas or critiques you want.
cheers,
kezzla

Burn retina, burn!
Kingius Returns
12
Years of Service
User Offline
Joined: 17th Oct 2013
Location: UK
Posted: 20th Oct 2013 17:45
This reminds me of the format that I used when I created Necrotech, but because I built a whole game around it the format got a bit more complicated than your prototype.

In particular, dialog options had requirements which could be optionally specified. In your parlance it would be similar to saying...

choice[requirements]>A choice dialog

Requirements could be things like an object was in the inventory (e.g. so that a dialog choice that asked about it would only appear if the item had been found), the current health level of the player (e.g. to control asking for healing in a temple) or if a particular flag was set to a certain value (e.g. to say something had been done already).

I also had the same set of requirements which could be set onto the targets. In this way I could have multiple targets with the same name, but the correct one would be picked based upon the requirement matching. So for example asking about a dungeon one time might give one answer, but when it had been visited a flag was set and asking about it again would lead to another answer.

If you want to see the format I actually used, let me know and I'll dig it up for you.
Kezzla
17
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 21st Oct 2013 23:29
Cheers Kingius,
I am also now looking into implementing switches in the routines.

I may add some kind of if statement into the scripting.

I would like to see how you went about it if it is not too much trouble to dig up.

I must say that it is pretty cool being able to interact with actors and objects in the game world with dialog and conversation!
Brings the world that little more to life.

cheers again for sharing tips on your method.

kezzla

Burn retina, burn!
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 21st Oct 2013 23:42
Odd formatting, it's like a broken XML format

Login to post a reply

Server time is: 2026-07-06 10:39:53
Your offset time is: 2026-07-06 10:39:53