Sign in to follow this  
davenirline

rpg dialogue system creation

Recommended Posts

can you please show me links of tutorials on how to make this system systematic. i think coding it along the game flow is quite cumbersome. there must be some dialogue engine control where dialogues are written in txt files and are just loaded during runtime. i am having problems with these.

Share this post


Link to post
Share on other sites
Actually reading text in from a txt file is very easy:

#define MAX_DIALOG_LENGTH 1024
char dialog [MAX_DIALOG_LENGTH];
FILE* f = fopen("dialog.txt");
fgets(dialog, MAX_DIALOG_LENGTH, f);
fclose(f);



I th ink the general idea you're looking for may be going more towards scripting. You might want to look into books such as Lex and Yacc or Game Scripting Mastery if you feel like you want more dynamic dialog. With a good scripting language you could write something like:

bool SavedMe = false;
function Talk()
{
if(!SavedMe)
{
say("Help, help! These monsters are ravaging my house!");
}
else
{
say("Thank you for helping me! You're my hero!");
}
}



and then in your code you detect when the monsters are all dead, set "SavedMe" to true, and the dialog will change accordingly.

There's really no easy answer to this type of dynamic dialog. Both the books above are rather challenging reads with a lot to learn and try to implement. Good luck to you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this