The demo for this tutorial can be found at: http://www.shadowvault.net/conv1.taf
Assuming you don’t want to use the built-in Adrift conversation system of “ask [name] about [subject]” and want to create your own conversation system along the lines of “talk to [name]” and then follow it with a list of dialogue options, this little tutorial should hopefully point you in the right direction. It contains enough information to (hopefully) steer you towards a decent conversation system.
1) The first thing you need is a character to talk to. In this instance we’ll call him Bob because a) it’s a nice enough name and b) it’s going to be typed a lot during this tutorial and while not as elegant as Horatio, it’s certainly a lot quicker to type.
2) Put Bob in the same room as the player starts. (You don’t have to do this – you can put him wherever you want – but for the purposes of learning how to use the conversation system, it’s probably best to start off as simple as possible.)
3) Create a variable called con and set it to 0. This will be the variable which handles the whole conversation system. When it’s set to 0, that means the player isn't actually speaking to anyone.
4) Create a task called talk to bob. (You might want to create a few synonyms for “talk” to cover people typing say to bob or speak to bob. Make say and speak synonyms of talk and Adrift will handle the rest for you. Often, it’s also a good idea to put an asterisk * after the character’s name. This will stop the player running into problems if he types say to bob “hello”; say to bob “hello” and say to bob are two different things.)
5) In the message upon completion box, you need the text that is displayed whenever the player speaks to Bob. Here we have:
”Hello,” says Bob. “What do you want to talk about?”
1) “The weather.”
2) “Politics.”
3) “Adventure games.”
Remember to set the task can be completed in to the same location as both the character and Bob are in.
6) Go to Restrictions and create a restriction that the player must be in the same room as Bob.
7) Go to Actions and create an action that changes the con variable to 10.
8) Go to Reversible and click the Repeatable task box, otherwise the player will only be able to speak to Bob once.
The initial task which allows the player to speak to Bob is now set up but only half the job has been done. Run the game now and type talk to bob and all that will be displayed is
”Hello,” says Bob. “What do you want to talk about?”
1) “The weather.”
2) “Politics.”
3) “Adventure games.”
Typing 1, 2 or 3 will result in an error message because you have yet to set up any response tasks.
9) Setting up response tasks is easy. First you need to duplicate the talk to bob task. (You could also create another task for this but as most of the information you need is already in the initial task, it’s quicker and easier to duplicate it.) Duplicate the task three times, once for each of the conversation options.
10) Change the first duplicated task from talk to bob to 1, the second to 2 and the third to 3. Of course, the problem you'll run into here if you have a lengthy conversation system or conversations with more than one character is telling them apart. Before long, you'll have multiple tasks called 1, 2 and 3 and keeping track of them will be a nightmare. So instead of calling the first task simply 1, call it 1 - bob10 - the weather, press return and then put 1 on the second line. The first line will tell you all you need to know about task to keep track of it; the actual information that Adrift uses to handle the conversation is on the second line. Essentially, the first line will be ignored by Adrift (unless someone actually goes and types 1 - bob10 - the weather while playing the game!) and is there just for your reference.
[Quick breakdown of the first line: 1 - dialogue option; bob10 - who you're talking to and the current value of the con variable; the weather - what you're talking to Bob about.]
11) Go the Message upon completion and delete the text already there. Replace it with Bob’s response to the player asking him about the weather. In this instance:
”Oh, it’s fine. Bit cloudy,” says Bob.
12) Go to Restrictions and change the con to 10. Go to the Actions and change the con to 0. Simply put, this checks whether the con is 10 (which means the player is speaking to Bob) and then changes it to 0 (the player is no longer speaking to Bob). Here the conversation ends until the player types talk to bob again and starts it off once more.
13) We then have to take care of the other two conversation options. Change the second duplicated task to 2 - bob10 - politics, press return and change the 1 to a 2. Change the text in the Message upon completion box to
”I’ve never cared much for politics,” says Bob.
Go to Restrictions and change the con to 10. Go to the Actions and change the con to 0.
14) Change the third duplicated task to 3 - bob10 - adventure games, press return and change the 1 to a 3. Change the text in the Message upon completion box to
”I'm a big fan of them!” chortles Bob enthusiastically.
Go to Restrictions and change the con to 10. Go to the Actions and change the con to 0.
That ends the basic conversation system. The player can speak to Bob and he will respond with three set responses. As far as conversations go, nothing Bob says will be very stimulating and there's also no variety in his responses; if the player speaks to him a hundred times, he’ll respond each time with the exact same thing. But it’s a start.
If you want a better conversation system - with varying responses from Bob or maybe just a little more flexibility - see part 2.