Personally I've always figured out what the character is going to say, written the .h file, then written the .c file to put the lines together.
As
@Baste previously pointed out, the "dialog.snd" lines don't do anything and can safely be left out. I generally put the whole lot of stuff into case "First time" for reasons of (a) paranoia, due to (b) everyone else seems to have done it. But I never bother with "dialog.snd" anywhere else and my dialogs tend to work (after I've figured out which other silly mistake I made which stopped it from working, and you'll probably soon have some experience of that as well
).
Generally, the .c file is a list of "case" blocks. At its simplest, this can be something like:
Code:
case "part1":
dialog.text = DLG_TEXT[2];
link.l1 = DLG_TEXT[3];
link.l1.go = "part2";
break;
"dialog.text" is what the character says. It might be "d.text" instead - look for a line somewhere near the top of the .c file which says something like:
If that's there, and especially if you're modifying an existing file which uses "d.text", continue to use that.
"link.l1" is what you say in response. "link.l1.go" is the next dialog case to follow this one. If this is the end of the conversation then you'll probably have:
To give the player a choice, use several "link" lines, e.g.:
Code:
case "part2":
dialog.text = DLG_TEXT[4];
link.l1 = DLG_TEXT[5];
link.l1.go = "first choice";
link.l2 = DLG_TEXT[6];
link.l2.go = "second choice";
break;
You can have as many choices as you like, though if you have too many, you'll need to scroll down to see the later choices when you talk to the character.
The "DLG_TEXT" lines refer to the .h file. Line 1 of the file is the header, something like:
Program code starts counting from 0. So the line number in the .h file is usually 2 higher than the "DLG_TEXT" number. "DLG_TEXT[0]" is the second line in the .h file and the first line of actual text after the header.