In "PROGRAM\Storyline\Ardent\DIALOGS", you should find "blank_dialog.c". And in "PROGRAM\Storyline\Ardent\DIALOGS\ENGLISH" is the corresponding "blank_dialog.h". Whenever I'm creating a new dialog, I start by copying those files and renaming the copies to suit the character whose dialog I'm writing, then start filling them in.
Start by copying "blank_dialog.h". Rename the copy to suit the character whose dialog you're editing - perhaps "Salazar_dialog.h". The file initially looks like this:
Code:
string DLG_TEXT[2] = {
".",
".",
}
Replace the first "." with something Salazar can say to you when nothing is happening - perhaps something simple like "Hello"." or "Get lost!". Replace the second "." with what you'll say back. After that, you can add more lines for the important dialog. For a simple dialog, you just need to add more pairs of lines - he says something, you say something back. When you've finished, count how many lines of dialog text there are and edit that first 'string DLG_TEXT[2]' line - replace the 2 with the new number of dialog lines. If you're using Notepad, there's a nice little trick. Put the cursor to the last line of dialog and press Ctrl-G, or click "Edit" and then "Go to". That will tell you the line number you're looking at. The first line of the file is that 'string DLG_TEXT' line, so the first line of dialog text is line 2. The line number of the last dialog line is therefore always 1 higher than the number of dialog lines.
Now copy "blank_dialog.c" and again, rename the copy to suit the character e.g. "Salazar_dialog.c". The name must match the "dialog.h" file. The file starts by setting up some useful variables, then most of the file is a big 'switch' block. Look at case "First time" - this controls what the character will say when you first talk to him. There's some stuff which I don't fully understand myself, but the important bit is this:
Code:
dialog.text = DLG_TEXT[0];
link.l1 = DLG_TEXT[1];
link.l1.go = "Exit";
Programs often count starting at 0. So DLG_TEXT[0] is the first line of text in the "dialog.h" file and DLG_TEXT[1] is the second line. The simplest dialog cases all look like that:
- dialog.text is what the character says.
- link.l1 is what you say back.
- link.l1.go is the dialog case which will trigger when you have said your line.
So as it stands, he'll say one line, you'll say one line, then the dialog goes to case "exit", which is a special one that you'll see in "blank_dialog.c" and which closes down the dialog, returning you to the game.
To make use of what you wrote in the "dialog.h" file, you just need to write more such "case" blocks. Look at "Slave_Commandant_dialog.c" and "Slave_Commandant_dialog.h", for example. The first two lines of "Slave_Commandant_dialog.h" are what he says and you say if you talk to him while he's just following you around. And in "Slave_Commandant_dialog.c", case "First time" is exactly as it was in "blank_dialog.c". The next case is:
Code:
case "Intruder":
PlaySound("VOICE\ENGLISH\pir_capHH.wav");
dialog.text = DLG_TEXT[2];
link.l1 = DLG_TEXT[3];
link.l1.go = "Intruder2";
break;
case "Intruder2":
dialog.text = DLG_TEXT[4];
link.l1 = DLG_TEXT[5];
link.l1.go = "Exit";
break;
Remember, program counts starting at 0, and the first line of "officer1_dialog.h" is the 'string DLG_TEXT' line. So DLG_TEXT[2] is actually the
fourth line of "officer1_dialog.h". In general, whatever line number you're looking at in a "dialog.h" file, the matching DLG_TEXT line in the "dialog.c" file is 2 less.
You don't need the 'PlaySound' line - I'd found a voice file which sounded appropriate to the situation. For a simple, basic dialog, don't bother with this. So, he says a line, you say a line, and the dialog goes to case "Intruder2". (Because you're an intruder in his camp! Make up your own names, don't just copy "Intruder".) Case "Intruder2" is the same, except the dialog now goes to case "Exit", which is a special case that closes down the dialog and returns you to the game.
For a longer dialog, just have
link.l1.go lead to another case, then write the next case the same way. And so on. When the dialog is over, end with
link.l1.go = "Exit"; to stop.
And if you want to trigger a quest case, the 'AddDialogExitQuest' line goes just before the 'link.l1.go = "Exit";' line. (It can probably go anywhere in that block, but as far as I'm concerned, it's neater if I set up the 'AddDialogExitQuest' just before the dialog exits to trigger the quest.
)
One more thing. Don't forget to save these dialog files in your own storyline folder, not in the "Ardent" one, otherwise your storyline won't find them!