Class Conversation
The base class for all conversations with an NPC. You can setup a conversation by inheriting from this class, adding the component to an NPC object, and using Speak(string) and PresentYesNoQuestion(string) in DoConversation() to talk with the player
Namespace: WeaverCore.Assets.Components
Assembly: WeaverCore.dll
Syntax
public abstract class Conversation : MonoBehaviour
Properties
| Edit this page View SourceDialogBoxResult
The result of the yes/no dialog box
Declaration
public Conversation.YesNoResult DialogBoxResult { get; }
Property Value
Type | Description |
---|---|
Conversation.YesNoResult |
Methods
| Edit this page View SourceDisplayTitle(string, string)
Display an WeaverBossTitle. This is mainly used to display the name of the NPC the player is talking to
Declaration
protected void DisplayTitle(string title, string minorText = "")
Parameters
Type | Name | Description |
---|---|---|
string | title | |
string | minorText |
DoConversation()
Override this method to customize the conversation with a player. Use Speak(string) to speak with the player, and use PresentYesNoQuestion(string) to prevent the player with a yes/no question
Declaration
protected abstract IEnumerator DoConversation()
Returns
Type | Description |
---|---|
IEnumerator |
HideConversationBox()
Hides the conversation box
Declaration
public void HideConversationBox()
PresentYesNoQuestion(string)
Presents a yes/no question prompt to the player. The result is stored in DialogBoxResult
Declaration
protected IEnumerator PresentYesNoQuestion(string message)
Parameters
Type | Name | Description |
---|---|---|
string | message | The message to say in the prompt |
Returns
Type | Description |
---|---|
IEnumerator |
PresentYesNoQuestion(string, int)
Presents a yes/no question prompt to the player. The result is stored in DialogBoxResult
Declaration
protected IEnumerator PresentYesNoQuestion(string message, int geoCost)
Parameters
Type | Name | Description |
---|---|---|
string | message | The message to speak |
int | geoCost | How much geo the player need to pay to select "Yes" |
Returns
Type | Description |
---|---|
IEnumerator |
ShowConversationBox()
Shows the conversation box
Declaration
public void ShowConversationBox()
Speak(IEnumerable<string>)
Speaks a series of messages to the player. Each message is split into seperate pages
Declaration
protected IEnumerator Speak(IEnumerable<string> messages)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<string> | messages | The messages to speak |
Returns
Type | Description |
---|---|
IEnumerator |
Speak(string)
Speaks a message to the player
Declaration
protected IEnumerator Speak(string message)
Parameters
Type | Name | Description |
---|---|---|
string | message | The message to speak |
Returns
Type | Description |
---|---|
IEnumerator |
Speak(params string[])
Speaks a series of messages to the player. Each message is split into seperate pages
Declaration
protected IEnumerator Speak(params string[] messages)
Parameters
Type | Name | Description |
---|---|---|
string[] | messages | The messages to speak |
Returns
Type | Description |
---|---|
IEnumerator |
StartConversation()
Starts a conversation with the player
Declaration
public void StartConversation()
StartConversationRoutine(bool)
Starts a conversation with the player
Declaration
public IEnumerator StartConversationRoutine(bool makePlayerLookUp = true)
Parameters
Type | Name | Description |
---|---|---|
bool | makePlayerLookUp | Should the player look up when starting the convo? |
Returns
Type | Description |
---|---|
IEnumerator |