Picking a Conversation Event

Return to Content Manager Page.

Picking a Conversation Event

When the player talks to an NPC, it runs the following logic to determine what conversation event will be played:

1. Checking for introduction events:

1.1. if the player never talked to this NPC before, the game will play an event called npcName_first.

1.2. if the player has a companion and this companion never met the NPC before, the game will check if an event called npcName_meets_companionName exists. If it does, it will be played.

2. Checking for task related conversations:

There are two types of task related conversations: progress events and completion events.
Progress Events are simple conversations related to an ongoing task, while Completion events are conversations triggered to mark a task as completed, when all requirements are met.

2.1. Progress Events:

The game will execute the ContentManager method “preventTaskDialogues” to determine if it can check for task progress conversations.

2.1.1 The game will execute the ContentManager method “checkTaskDialogues” so that it can play any custom task progress conversation it needs.

2.1.2 The game will automatically check all registered task data for any valid conversation for the specified character. If it finds any event, it will be played.

2.2. Completion Events:

The game will execute the ContentManager method “preventAutoCompleteTasks” to determine if it can check for task completion conversations.

2.2.1. The game will execute the ContentManager method “checkAutoCompleteTasks” so that it can play any custom task completion conversation it needs.

2.2.2. The game will automatically check all registered task data for any valid task completion conversation for the specified character. If it finds any event, it will be played.

3. Checking for fixed map conversations:

The game will check if the NPC that the player is talking to has a fixed conversation event for the current map, using the following logic:

3.1. The game calls the ContentManager “preventMapDialogues” method to determine if it can actually check map conversations:

3.1.1. The game now calls the ContentManager “checkMapDialogues” method so that it can play any map dialogue it needs.

3.1.2. The game will now check if the NPC that the player is talking to has a fixed event, called npcName_store_map_0, where 0 is the id of the current map.
If an event with that name exists, it will be played.

4. Checking gift reaction conversations:

4.1. The game calls the ContentManager “preventGiftChecking” method to determine if it can actually check for gift reactions:

4.1.1. The game now calls the ContentManager “checkGifts” method so that it can play any gift reaction event it needs.

4.1.2. The game will now check for the default gift reactions.
There are several conditions it applies here:
a) The player must not be inside a festival
b) Player must be holding an item
c) The item that the player is holding must be configured as a valid gift.
d) The NPC must not have received a previous gift on the same day.

After validating those conditions, the game will search for the appropriate reaction for the current gift:

4.1.2.1. If an event called npcName-gift-itemName exists, it will be played.
4.1.2.2. The game will play a default gift reaction based on how much the NPC likes the item being gifted. One of the following events will be played:

  • npcName-gift-loved
  • npcName-gift-liked
  • npcName-gift-disliked
  • npcName-gift-hated
  • npcName-gift-normal

5. Checking for animal reaction conversations:

5.1. The game calls the ContentManager “preventAnimalChecking” method to determine if it can actually check for animal reactions:

5.1.1. The game now calls the ContentManager “checkAnimals” method so that it can play any animal reaction event it needs.

5.1.2. The game will now check for default animal reactions.
There are some conditions it applies here:
a) The player must not be inside a festival
b) The player must be holding an animal

After validating those conditions, the game will search for the appropriate reaction for the current animal:

5.1.2.1. If an event called npcName-animal-fullAnimalName exists, it will have priority (example: benjamin-animal-dark-chicken)
5.1.2.2. If an event called npcName-animal-animalRace exists, it will be played now (example: benjamin-animal-chicken)

6. Priority Conversations

Priority Conversations are used only by the ContentManager. The game calls the “performPriorityDialogue” method to play them.
It’s intended for conversations that should happen even if the NPC is already in the middle of a conversation sequence.

7. Conversation Sequences

A sequence is used when one conversation event should only happen immediatelly after another one (if the player talks to the same villager a second time).

As usual, you can prevent it from happening with a ContentManager method: “preventContinuingConversation“.

7.1. The game will pick the last conversation event played by this NPC and add “_cont” to it’s name, then check if an event with that name exists and play it if it does.
You can add as many “_cont” events as you want, for example:
:benjamin_say_something

  • :benjamin_say_something_cont*
  • :benjamin_say_something_cont_cont*
  • :benjamin_say_something_cont_cont_cont*

8. Priority 2 Conversations

Priority 2 Conversations are used only by the ContentManager. The game calls the “performDialogueIgnoringHistory” method to play them.
It’s intended for conversations that can be repeated over and over, but that aren’t important enough to break sequences.

9. Regular Conversations

At this point, the game will make a list with every automatic conversation event that this NPC has and pick one at random.
Events that have already been played for the day won’t be added to the list.
Events with higher priority will be added multiple times to this list (as many times as the priority value)
At the end, if there’s any event on the list, it will be played.

10. History Cleaning

If there was no available conversation event, the game will remove all but the last played event from the NPC history.
After clearing the history, the game will restart the process from the first step, skipping this one if it’s reached again.
You can prevent this cleaning from happening with the ContentManager method “preventHistoryCleaning“:

11. Default Conversation Events

If even with a clean history, the game still couldn’t find any conversation event to play for this NPC, it will try to find a default event to run.

11.1. Map Default

First, the game will check if an event called npcName_default_map_0 exists (where 0 is the id of the current map) and play it if it does.
You can prevent this from being played with the “preventMapDefaultDialogue” method of the ContentManager:

11.2 General Default

At last, the game will check if the NPC has a npcName_default event and play it. Every standard NPC has one of those.
You can also prevent this event from being played with the “preventDefaultDialogue” method:

12. Last Possible Dialogue

It should never reach this point for the standard characters, but in case you disabled some of the default conversations or added new characters, you can use the “performLastPossibleDialogue” method of the ContentManager to show an event.


Method List

preventTaskDialogues(characterName, eventData)

The characterName argument holds the name of NPC that the player talked to.
The eventData argument is the NPC’s event object (Game_Event).

Return true to prevent the game from checking task related conversations, or false to allow it.

checkTaskDialogues(characterName, eventData)

The characterName argument holds the name of NPC that the player talked to.
The eventData argument is the NPC’s event object (Game_Event).

Return true if you triggered a conversation event, or false otherwise.

preventAutoCompleteTasks(characterName, eventData)

The characterName argument holds the name of NPC that the player talked to.
The eventData argument is the NPC’s event object (Game_Event).

Return true to prevent the game from triggering task completion conversations, or false to allow it.

checkAutoCompleteTasks(characterName, eventData)

The characterName argument holds the name of NPC that the player talked to.
The eventData argument is the NPC’s event object (Game_Event).

Return true if you triggered a conversation event, or false otherwise.

preventMapDialogues(characterName, eventData)

The characterName argument holds the name of NPC that the player talked to.
The eventData argument is the NPC’s event object (Game_Event).

Return true to prevent the game from triggering fixed map conversations, or false to allow it.

checkMapDialogues(characterName, eventData)

The characterName argument holds the name of NPC that the player talked to.
The eventData argument is the NPC’s event object (Game_Event).

Return true if you triggered a conversation event, or false otherwise.

preventGiftChecking(characterName, eventData)

The characterName argument holds the name of NPC that the player talked to.
The eventData argument is the NPC’s event object (Game_Event).

Return true to prevent the game from triggering gift reaction conversations, or false to allow it.

checkGifts(characterName, eventData)

The characterName argument holds the name of NPC that the player talked to.
The eventData argument is the NPC’s event object (Game_Event).

Please note: This method is called even if the player is not holding an item or if the player already gifted the NPC today.

Return true if you triggered a conversation event, or false otherwise.

preventAnimalChecking(characterName, eventData)

The characterName argument holds the name of NPC that the player talked to.
The eventData argument is the NPC’s event object (Game_Event).

Return true to prevent the game from triggering animal reaction conversations, or false to allow it.

checkAnimals(characterName, eventData)

The characterName argument holds the name of NPC that the player talked to.
The eventData argument is the NPC’s event object (Game_Event).

Please note: This method is called even if the player is not holding an animal.

Return true if you triggered a conversation event, or false otherwise.

performPriorityDialogue(characterName, eventData)

The characterName argument holds the name of NPC that the player talked to.
The eventData argument is the NPC’s event object (Game_Event).

Return true if you triggered a conversation event, or false otherwise.

preventContinuingConversation(characterName, lastEventName, eventData)

The characterName argument holds the name of NPC that the player talked to.
The lastEventName argument holds the name of last event played by this NPC.
The eventData argument is the NPC’s event object (Game_Event).

Return true to prevent the game from triggering a sequence event, or false to allow it.

performDialogueIgnoringHistory(characterName, eventData)

The characterName argument holds the name of NPC that the player talked to.
The eventData argument is the NPC’s event object (Game_Event).

Return true if you triggered a conversation event, or false otherwise.

preventHistoryCleaning(characterName, history, eventData)

The characterName argument holds the name of NPC that the player talked to.
The history argument is an array with the name of every conversation event played by this character on the current game day.
The eventData argument is the NPC’s event object (Game_Event).

Return true to prevent the game from cleaning the NPC history, or false to allow it.

preventMapDefaultDialogue(characterName, eventData)

The characterName argument holds the name of NPC that the player talked to.
The eventData argument is the NPC’s event object (Game_Event).

Return true to prevent the game from playing a map default event, or false to allow it.

preventDefaultDialogue(characterName, eventData)

The characterName argument holds the name of NPC that the player talked to.
The eventData argument is the NPC’s event object (Game_Event).

Return true to prevent the game from playing a default event, or false to allow it.

performLastPossibleDialogue(characterName, eventData)

The characterName argument holds the name of NPC that the player talked to.
The eventData argument is the NPC’s event object (Game_Event).

Return true if you triggered a conversation event, or false otherwise.