Difference between revisions of "Conversations with other characters"

From ADRIFT 5 Manual Wiki
Jump to: navigation, search
(Enter Conversation task)
(General Commands)
Line 138: Line 138:
 
"Err, excuse me," the old lady exclaims.  "That's a bit impolite isn't it?".
 
"Err, excuse me," the old lady exclaims.  "That's a bit impolite isn't it?".
 
</FONT></td></table>
 
</FONT></td></table>
 +
 +
== General Commands ==
 +
Topics that have "General Command" selected, but neither "Introduction" or "Farewell", are things that the player can say to the character during the conversation.
 +
 +
In the example, these are the "Fine thanks", "Introduce yourself", "Nothing much" and "Say Sorry" topics.
 +
 +
Here is the "Introduce yourself" topic:
 +
 +
[[File:ConversationIntroduceSelf.jpg]]
 +
 +
The text of the conversation repeats the text they entered back to them, and tells the player Mildreds proper name.
 +
 +
Now that the player knows what the characters proper name is we need to set its "is this character known to the player" property, so that the %CharacterName% function will now display the characters Proper name (Mildred), and also so that the player can refer to the character as Mildred in commands:
 +
 +
[[File:ActionKnownToPlayer.jpg]]

Revision as of 06:08, 30 July 2012

Construction.gif

This tutorial describes how to use conversation tree's to give a character the ability to converse with the player in a natural way, responding in a sensible way to what the player tells them and questions asked of them.

The sample game

The sample game used in this tutorial is written to C:\Program Files\Common Files\ADRIFT\Samples\Conversation.taf (or the equivalent on your operating system) by the ADRIFT installer.

Double click on it to open it in the developer, then press the run button to start the game and follow this tutorial.

This sample has two locations, and at one of these locations is a bed of flowers and a character called Mildred.

Introduction

When the game starts you will get the introduction, a description of the initial location (and Mildred) and a mention of the exit to the south:

Conversation Sample
This is a very basic sample of conversation trees in ADRIFT 5.

To start a conversation, type "say whatever to whomever".

By the flower bed
There is a small flower bed here, with pretty flowers in it. An old lady is kneeling down next to the flower bed, tending the flowers. An exit leads south.

The title in red is from the Bibliography page of the Options.

The first text to be output is from the "Introduction & end of game" dialog box.

ConversationIntro.jpg

Because "Display first room description" is ticked, the short (in boldface) and long description of the location is shown next.

  • The player can turn off the display of the short location description using the runner options.

When a character is present at a location, we would normally get a message like "The old lady is here", but in this case the mildred character has the following in her "What to show when character is in location" property.

%PCase[%CharacterName%]% is kneeling down next to the flower bed, tending the flowers.

The %CharacterName% function is used to ensure that mildred is described as "an old lady" initially, then by her proper name once the player learns what it is. The %PCase[]% function capitalises the first letter.

Finally "An exit leads south" is printed because the "Show exits from locations as well as descriptions" option has been ticked on the General tab of the games' Options.

Using a talk-to task

The simplest way to do a conversation is to write a "talk to %character%" task which simply displays a pre-written conversation. This tutorial is for a much more interactive conversation, but we should still provide a response if the player types this.

We dont know Mildred's name yet, so enter the command "talk to old lady". A "Talk to character" general task has been created which contains the message:

Try <u>say</u>ing something, <u>ask</u>ing about something or <u>tell</u>ing someone something.

So the player will see:

> talk to old lady
Try saying something, asking about something or telling someone something.

This has been added to explain to the player that they need to use the "say", "ask" or "tell" commands in a conversation.

The Character Conversation tab

Conversations are usually specific to a particular character, and if you open the Mildred character and go to the Conversation tab you will see listed the thirteen conversation topics that have been added to this character.

ConversationMildred.jpg

Usually the first thing a character will say is one of the introduction topics, shown with a green arrow, which will either be active or passive.

Open the Active intro:

ConversationActiveIntro.jpg

Notice that under "Type of topic" that both "Introduction" and "General Command" are selected.

Selecting "Introduction" indicates that this will be the first thing that the character will say, and prevents the passive introduction from being shown.

Selecting "General Command" allows you to enter a command in the same way as in a general task. But conversation commands must be preceeded by the command "say", so the player must type "say hello" to trigger the active introduction:

> say hello
(to an old lady)

"Hello there", you say

She looks up from her gardening. "Oh hello there, what can i do for you?"

If the player had typed "say hello to old lady" then they would obviously be talking to Mildred. Because they did not say who they wanted to talk to, ADRIFT automatically checked to see if there was one other character in the same location and picked that character (printing the "to an old lady" message to say who was chosen).

If there were multiple characters at the same location then the player would have to say who they wanted to say hello to, however once a conversation has been started it will be assumed that they will continue talking to the same character and so they wont have to enter the characters name again until they leave that conversation.

Note that the default description has been set to display only once, so if we say hello again we get Alternate Description 1 which will print:

> say hi there
"Hello again", you say cheerily

"Ah hello again to you too, How are you?"

Using the Restriction: be in conversation with

The description for Mildred says:

%CharacterName% looks to be around 60 years old, with silver hair.  
She is wearing her gardening clothes, and is kneeling down next to the flower bed

But it also has two alternate descriptions:

, busily tending the flowers.

and one with the restriction "The player character must be in conversation with character Mildred", set to display after default.

.  %CharacterName% is looking up at you, trowel in one hand.

If you examine the old lady now, while you are in conversation with her, the restriction will pass and show the default description followed by the second alternate description:

> x old lady
The old lady looks to be around 60 years old, with silver hair. She is wearing her gardening clothes, and is kneeling down next to the flower bed. She is looking up at you, trowel in one hand.

If we leave the conversation (by saying goodbye, which is described in the next section) the restriction will now fail, displaying the default description followed by alternate description 1.

> say goodbye
"Well, I gotta go and explore this place. Bye for now."

"OK, Bye then". The old lady goes back to tending the flowers.


> x old lady
The old lady looks to be around 60 years old, with silver hair. She is wearing her gardening clothes, and is kneeling down next to the flower bed, busily tending the flowers.

Active Goodbye

This is the "Active goodbye" topic. It has both "Farewell" (which exits the conversation) and "General Command" selected.

ConversationActiveGoodbye.jpg

The command for this topic must be preceeded by "Say", so the player can type "say goodbye", "say bye", or "say cheerio".

Enter Conversation task

Using any of the conversation commands will put the player into conversation mode, but you can also start a conversation with a task.

If you look at the "Pick flowers" task you will see that it contains a response from Mildred. Because she has spoken to the player we need to put her in conversation mode, so on the Actions tab you will see the action "Enter conversation with character Mildred".

Note that neither the Active or Passive introduction is shown in this case. It is assumed that the task that performs this action will itself print everything that Mildred needs to say at this time.

> pick flowers
You reach down to pluck a flower from the flower bed.

"Err, excuse me," the old lady exclaims. "That's a bit impolite isn't it?".

General Commands

Topics that have "General Command" selected, but neither "Introduction" or "Farewell", are things that the player can say to the character during the conversation.

In the example, these are the "Fine thanks", "Introduce yourself", "Nothing much" and "Say Sorry" topics.

Here is the "Introduce yourself" topic:

ConversationIntroduceSelf.jpg

The text of the conversation repeats the text they entered back to them, and tells the player Mildreds proper name.

Now that the player knows what the characters proper name is we need to set its "is this character known to the player" property, so that the %CharacterName% function will now display the characters Proper name (Mildred), and also so that the player can refer to the character as Mildred in commands:

ActionKnownToPlayer.jpg