General Integration Tips

Player Controls & Pausing the Game

To disable the player's movement and camera controls during conversations, you can add a Dialogue System Events component to the player. Configure the OnConversationStart() UnityEvent to disable the player's movement and control components. Configure OnConversationEnd() to re-enable them. If you need to do more to pause the player during conversations, see the bottom part of the Interaction Tutorial.

Alternatively, you can tick the Dialogue System Trigger's Actions > Start Conversation > Pause During Conversations checkbox to pause the entire game during conversations. This will prevent enemies from moving in to attack during conversations. However, if you want to keep the game unpaused but only want the enemies to wait until the conversation is over, hook into the C# events DialogueManager.instance.conversationStarted and .conversationEnded. Add a script to the enemy that hooks into these events. When conversationStarted happens, stop moving and attacking. When conversationEnded happens, resume moving and attacking.

Accessing Data In Conversations

You can register C# methods with Lua so you can access them in conversations – for example, getting the amount of health a player has, or giving an item to the player. More info: Registering Functions

UX In Conversations

Conversations typically use sequencer commands to perform user experience activity such as animation and audio. You can write custom sequencer commands to perform custom user experience activity. More info: Cutscene Sequences, Cutscene Sequences Tutorials

Saved Games

If the other asset doesn't have a save system, or if you prefer to use the Dialogue System's save system, set up the Dialogue System's save system and write custom savers. More info: Save System, How To: Write Custom Savers

If you are using a framework asset that has a save system, you can set up the Dialogue System's save system and provide its data to the framework asset. To grab the Dialogue System's data as a string and give it to the other asset to save:

...
This is the main Save System class.
Definition SaveSystem.cs:17
static SavedGameData RecordSavedGameData()
Records the current scene's savers' data into the SaveSystem's internal saved game data cache.
Definition SaveSystem.cs:858
static string Serialize(object data)
Returns a serialized version of an object using whatever serializer is assigned to the SaveSystem (JS...
Definition SaveSystem.cs:1155
Definition MessageEventsEditor.cs:7

When loading a saved game, when the framework asset gives you back the string, reapply it to the save system:

static void ApplySavedGameData(SavedGameData savedGameData)
Applies the saved game data to the savers in the current scene.
Definition SaveSystem.cs:896
Holds the data for a saved game.
Definition SavedGameData.cs:16

<< Third Party Integration