ig.

EntityConversation

new EntityConversation()

Trigger to start a conversation between one or more speakers.

Author:
  • Collin Hover - collinhover.com
Source:

action :String

Input action to look for if not using ig.EntityConversation#autoAdvance to advance the conversation. IMPORTANT: only works when conversation pauses game via ig.EntityConversation#pausing.

Default Value:
  • tap
Source:

advanceTimer :ig.Timer

Conversation auto advance timer.
- created on init

Source:

animNameListen :String

Name of animation to play for each speaking entity, when they are listening. Tip: this property can be defined in a step to affect only that step!

Default Value:
  • listen
Source:

animNameTalk :String

Name of animation to play for each speaking entity, when they are talking. Tip: this property can be defined in a step to affect only that step!

Default Value:
  • talk
Source:

autoAdvance :Boolean

Whether conversation automatically advances.

Default Value:
  • true
Source:

autoComplete

Default Value:
  • false
Source:

cameraCentered :Boolean

Whether camera should center on each speaker and message rather than just keep them in screen.

Default Value:
  • false
Source:

cameraFollows :Boolean

Whether camera should follow each speaker when active.

Default Value:
  • true
Source:

durationPerLetter :Number

Duration in seconds per word for ig.EntityConversation#autoAdvance.
- average reading speed is 250 words per minute, or 4 words per second.

Default Value:
  • 0.1
Source:

durationPerStepMin :Number

Duration in seconds that a step should be visible for at minimum when ig.EntityConversation#autoAdvance.

Default Value:
  • 1
Source:

interrupting :Boolean

Whether conversation can interrupt and cancel other conversations. This only applies when one of the speakers in this conversation is currently in another conversation.

Default Value:
  • true
Source:

locking :Boolean

Whether conversation locks all entities and removes control. Only locks entities involved in conversation. Tip: this property can be defined in a step to affect only that step!

Default Value:
  • false
Source:

lockingPlayer :Boolean

Whether conversation locks the player and removes control. Does the same as ig.EntityConversation#locking, but for player only.

Default Value:
  • false
Source:

looking :Boolean

Whether conversation forces all participants to look at the entity speaking.

Default Value:
  • true
Source:

message :ig.EntityExtended

Currently active message entity that has a text property.

Source:

messageContainer :ig.EntityExtended

Currently active message container entity. IMPORTANT: this is only present when the message has a container!

Source:

messageContainerEntity :ig.EntityExtended

Message container entity class. IMPORTANT: when defined, overrides ig.EntityConversation#messageEntity, and so this must handle the message itself.

Source:

messageEntity :ig.EntityExtended

Message entity class. IMPORTANT: overridden by ig.EntityConversation#messageContainerEntity when it is defined.

Source:

messageFollowsSpeaker :Boolean

Whether messages follow speaker.

Default Value:
  • true
Source:

messageMoveToSettings :Object

Settings for when messages follow speaker.

Properties:
Name Type Description
matchPerformance Boolean true
offsetPct Vector2 | Object 0 x -1.3
Source:

messageSettings :Object

Settings for messages.

Source:

participate :Array

Map of names of non speaking entities participating in conversation.

Source:
See:

<readonly> participating :Array

List of entities participating in conversation, including those not speaking, populated at start of conversation.

Source:

pausing :Boolean

Whether conversation pauses game. IMPORTANT: only works when an advancing action is defined by ig.EntityConversation#action.

Default Value:
  • false
Source:

<readonly> speaker :ig.EntityExtended

Currently active speaker entity.

Source:

<readonly> speakerLast :ig.EntityExtended

Last speaker entity.

Source:

step :Object

Currently active step.

Source:

steps :Object

Conversation steps.
- automatically sorted by order on activate

Source:
Example
// set player to say 'hello world'
// with special settings for message
conversation.steps[ 1 ] = {
     // entity that should say text
     name: 'player',
     // text to show
     text: 'hello world'
     // order of display, defaults to step number
     order: 1,
     // whether speaking entity should have control removed
     // defaults to conversation's locking property
     locking: true,
     // name of animation to play while talking
     // defaults to conversation's animNameTalk property
     animNameTalk: 'talk',
     // name of animation to play while listening
     // defaults to conversation's animNameListen property
     animNameListen: 'listen',
     // text entity settings
     settings: {...}
};
// the following is the same as the above
// only it adds onto the end of the conversation
conversation.addStep( 'hello world', 'player', 1, {...} );

stepsSorted :Array

Steps sorted by order.

Source:

<readonly> stepsUnused :Array

Conversation steps unused, autopopulated on activate. IMPORTANT: use ig.EntityConversation#steps

Source:

<readonly> stepsUsed :Array

Conversation steps used, autopopulated on activate. IMPORTANT: use ig.EntityConversation#steps

Source:

triggerAfterDelay

Conversations should always trigger after delay.

Default Value:
  • true
Source:

activateStep()

Activates step when message added.

Source:

addStep(text, speakerName, order, settings)

Adds step to conversation.

Parameters:
Name Type Argument Default Description
text String words to speak
speakerName String <optional>
name of speaker entity
order Number <optional>
last+1 order of step in conversation
settings Object <optional>
settings that map directly to ig.UIText
Source:

hideStep()

Removes current step.

Source:

initProperties()

Initializes conversation properties.

Source:

nextStep()

Starts next step in conversation.

Source:

pause()

Source:

resetExtras()

Resets conversation extra properties.

Source:

setup()

Source:

showStep()

Shows current step.

Source:

teardown()

Source:

unpause()

Source:

update()

Source: