FAQ

Table of Contents

How do I do <X>?

  1. Search for the topic using the search bar in the upper right area of this manual.
  2. Check the questions on this FAQ page.
  3. Search for "HOWTO" plus your question on the Pixel Crushers forum. The forum contains many helpful HOWTO articles.
  4. Post your question on the Unity forum thread or Pixel Crushers forum.
  5. Contact us any time for support: http://www.pixelcrushers.com/support-form/

Troubleshooting

Help! I'm stuck! Can I send you a reproduction project that demonstrates my issue?

Absolutely! We're here to help. Use these steps:

  1. Zip up your project's Assets, ProjectSettings, and Packages folders into a zip file. You can exclude other folders such as Library.
  2. Send the project (or a download link) to support (at) pixelcrushers.com along with the steps required to produce the issue.
    • Please include the exact steps to follow to reproduce the issue, such as "Open Scene 1. Click on Button A. You will see X, but you should see Y."

All customer files are handled confidentially.

How can I debug what's going on in the Dialogue System?

Set the Dialogue Manager's Debug Level to Info. This will log almost everything that's happening under the hood.

Use the Dialogue Editor's Watches tab or a Lua Console component.

When using multiple databases, why do conversations use entries from another conversation?

Conversations in two databases probably have the same ID number. Use the Unique ID Tool to make IDs unique.

Why does my project fail to build using Unity Cloud?

By default, Git ignores DLL files and doesn't upload them to Unity Cloud. If you're using the evaluation version, enable DLL versioning by removing .dll from your project's .gitignore file and your global gitignore file ([user].gitignore_global in Windows, ~/.gitignore_global in Mac and Linux).

Why are the NPCs' names and other text in the example scenes just a string of random numbers?

Your assets (such as scene files and dialogue databases) may have been created in Unity 4 in binary serialization mode. Unity 5 and Unity 2017+ cannot properly ready Unity 4's 32-bit binary serialization. You must open the assets in Unity 4, change to text serialization, export the assets, and then import them into your project.

How do I enable 2D physics/collider support?

See Enable Physics2D Support.

Why isn't 2D detection working?

If a Selector component isn't detecting your Usable, check the following:

  • GameObject with Usable component and Dialogue System Trigger has a 2D collider (e.g., BoxCollider2D).
  • GameObject is on a layer included in the Selector's Layer Mask.
  • Set Selector's Max Selection Distance to 9999.
  • Run Raycasts is set to In 2D.
  • Camera is set to Orthographic.
  • Transparent UI element isn't blocking collider.

How do I enable TextMesh Pro support?

See TextMesh Pro Support.


Writing Dialogue

How do I make text change dynamically during gameplay?

In your menu text and dialogue text, use the [var=varName] or [lua(code)] Markup Tags. During conversations, the [var=varName] tag will be replaced with the value of the named variable. The [lua(code)] tag will be replaced by the return value of the lua code. For example, to reference the player's age, you could use this Dialogue Text:

You're [lua(Actor["Player"].Age)]? You don't look a day over [lua(Actor["Player"].Age - 1)]!

How do I make the player have a conversation with himself/herself?

Tick Show PCSubtitles During Line in the Dialogue Manager's Display Settings. If only one dialogue entry is valid each turn and it has no force tag ([f]), then the Dialogue System will go through them without displaying the menu.

What happens if a dialogue entry links to NPC entries and PC response entries?

In this case, the Dialogue System automatically selects the first valid NPC entry and does not display a PC response menu.

Can I place emphasis tags on a subset of text?

Yes, but you must tick Use Rich Text.

Does the Dialogue System support voice-acted lines?

Yes. See Lipsync.

Can I prompt the player to input text during a conversation?

Yes. You can either use the [var=?varName] tag as described in Markup Tags or the TextInput().

How do I update the response menu while it's being shown?

Call DialogueManager.UpdateResponses() or use the equivalent PlayMaker or plyGame action.

How do I go backward in a conversation?

Add a script that listens for OnConversationLine (see Script Messages & Events), and record the line's dialogue entry ID. Examine ConversationLogger.cs for an example of listening for OnConversationLine. To go back, call DialogueManager.ConversationController.GotoState() to jump to a previous dialogue entry. See the Dialogue System Extras page for a Backtracking Example. Alternatively, tick the Standard UI Subtitle Panel's Accumulate Text checkbox to support scrollback.

How do I associate a GameObject with an actor?

Add a Dialogue Actor component.

Are Chat Mapper or articy:draft required?

No. You can use the Dialogue System's Dialogue Editor inside Unity.


Barks

How can I make multiple NPCs bark at each other?

You can set multiple Dialogue System Trigger components to listen for OnBarkEnd to string them together, or run it as a conversation using a Bark Dialogue UI component.

Barks

Yes. Tick Allow During Conversations.


User Interfaces

How do I slow down or speed up how long the NPC's subtitles stay on screen?

  • Set the Dialogue Manager's Display Settings > Subtitle Chars Per Second to a lower number. It defaults to 30 characters per second. If you set it to 10, subtitles will display three times longer.
  • Or change the Sequence or Dialogue Manager's Default Sequence to something that runs longer.

Why doesn't my Unity UI Dialogue UI accept input?

If you're using Unity 2017.3 or higher, you may need to tick the Force Module Active checkbox on your Event System's input module.

How do I show subtitles in overhead speech bubbles over characters' heads?

See these instructions: https://pixelcrushers.com/phpbb/viewtopic.php?f=3&t=2284

When the player has one response, how do I show it as a subtitle instead of a menu?

Untick the Dialogue System's Display Settings > Input Settings > Always Force Response Menu checkbox, and tick Display Settings > Subtitle Settings > Show PC Subtitle During Line.

Why does my conversation skip the player response menu for menus with one choice?

Untick the Dialogue System's Display Settings > Input Settings > Always Force Response Menu checkbox, or use the [f] markup tag. Also make sure that Is Player is true for the player actor.

Why isn't the continue button showing?

Make sure your dialogue UI has continue buttons, and that they're assigned to the dialogue UI component.

How do I adjust the display for notched devices such as iPhone X?

Add the SafeArea script provided by Unity in this article to your dialogue UI's main Dialogue Panel: https://connect.unity.com/p/updating-your-gui-for-the-iphone-x-and-other-notched-devices

How can I add additional functionality to dialogue UIs?

You can create a subclass of the dialogue UI class, or handle them in Script Messages & Events. If that's not enough, you can always write your own UI that implements IDialogueUI.

Does the Dialogue System support VR?

Yes. The Dialogue System Extras page has example scenes using the Oculus integration and
SteamVR integration assets for Unity.

In general, the only things to keep in mind for VR are to use Unity UI canvases that appear in VR (such as World Space or Screen Space Camera) and set up your project so the VR player can interact with Unity UI. This video covers the basics of interactiong with UI in VR: https://youtu.be/4tW7XpAiuDg

Why does my UI only show up in the left camera / not all in my VR headset?

Make sure to render in Screen Space - Camera or World Space.

How do I pause a conversation?

See How do I pause the Dialogue System?.

Using Unity UI, how do I fix a "layout rebuild while already inside layout rebuild loop" error?

Locate the offending Scroll Rect and set its Vertical and/or Horizontal scroll bar Visibility dropdowns to Auto Hide.

The Dialogue System seems to control cursor lock and visibility. How do I regain manual control?

Inspect the Dialogue Manager's Input Device Manager component. Untick Control Cursor State. The Input Device Manager is an optional component that you can remove. However, it detects whether the player is using joystick or mouse (if Detect Mouse Control is ticked). If using joystick, it keeps the cursor hidden if Control Cursor State is ticked, and when Dialogue System UIs are visible it ensures that a UI element is always focused so the player can navigate using the joystick. If it detects mouse movement, it shows the cursor, and it does not keep a UI element focused since this isn't needed for mouse selection. If you want to ensure that a UI element is focused even in mouse mode, tick Always Auto Focus.

Does the Dialogue System support Unity's new Input System?

Yes. See the Input Device Manager's separate manual in Assets / Plugins / Pixel Crushers / Common / Documentation for setup instructions.


Cutscene Sequences & Delivering Dialogue Lines

Why aren't Camera() commands working?

If the camera moves into the specified position then immediately swings back to "gameplay mode," your gameplay camera controller is probably taking control of the camera. Use Dialogue System Events or Dialogue System Trigger to disable control during conversations. Also make sure the camera angle name is correct.

Why does the screen immediately immediately visible right after Fade(out) finishes?

Use Fade(stay) instead to keep the screen faded out when the command is done.

How do I set a different default sequence for a conversation?

Normally, conversations use the Dialogue Manager's Default Sequence. To specify a different default sequence for a specific conversation, inspect the conversation's properties and tick Override Display Settings.

What runs first – a dialogue entry's user script or sequence?

The user script runs first. This way, your user script can set up variables that your sequence might need to reference.

It's too much work to edit the Sequence field for each entry! How can I automate this?

Use the entrytag keyword in your default sequence. See Entrytags.

How do I pause the sequencer?

See How do I pause the Dialogue System?.


Triggers

Why isn't the Proximity Selector working correctly in my 2D project?

Make sure you're not moving 2D rigidbodies manually (e.g., changing transform.position). This breaks Unity's collision detection. Use Rigidbody2D.MovePosition or AddForce. Also see Enable Physics2D Support.

How do I stop gameplay activity during conversations?

Use Dialogue System Events or Dialogue System Trigger configured to work OnConversationStart and OnConversationEnd. Or add a script that listens for OnConversationStart and OnConversationEnd Script Messages & Events.

How can I ensure actors idle at the start of conversations?

Use Dialogue System Events or Dialogue System Trigger or Script Messages & Events to set the actor's animator.

Is there a callback or a way I can find out when a conversation has ended?

Yes. Use Dialogue System Events or add a script that listens for OnConversationEnd (see Script Messages & Events).

How can I run arbitrary code during a conversation?


Quests

Can I use the quest tracker HUD without the quest log window?

Yes.


Saving & Loading

Can I save my own data with the Dialogue System's save system?

Yes. See the Save System page.

Can I add custom data to PersistentDataManager's saved-game data?

Yes. Assign a delegate method to PersistentDataManager.GetCustomSaveData.

How do I save and load using Moodkie's Easy Save?

See Easy Save Support.

Can I save to consoles and cloud services?

Yes, with some scripting. Due to NDAs, asset publishers aren't allowed to share code that uses console SDKs such as Nintendo Switch. This is the process to implement saves on consoles: Set up the save system as usual so you can test to make sure everything works correctly. For example, add a DiskSavedGameDataStorer to the Save System GameObject. Then make a new subclass of SavedGameDataStorer. Implement the methods (StoreSavedGameDataAsync, RetrieveSavedGameData, etc.). Then remove the original data storer (e.g., DiskSavedGameDataStorer) from the Save System GameObject and add your subclass in its place. You will probably want to implement StoreSavedGameDataAsync, and not StoreSavedGameData, because most consoles require that you save data asynchronously – that is, you let it save in the background while allowing the player to continue playing the game.


Lua

How can I debug my Lua scripts?

  • On the Dialogue Manager, set the Debug level to Info. This will log Lua commands to the console.
  • Or add a Lua Console to your project.
  • Or use the Dialogue Editor's Watches tab.

Why are my Lua conditions reporting errors?

Check the syntax differences under How to Write Lua Code.

How can I get to the code that raised the Lua exception in my Condition or User Script?

By default, the Dialogue System catches any exceptions raised by Lua code in Conditions and Script and simply logs that an exception occurred. If you're calling an external C# function in Lua, you may find it useful to allow the exception to filter up to aid in debugging. To do this, set DialogueManager.AllowLuaExceptions = true.

How can I access my C# scripts in Lua?

Register C# methods with Lua. See Registering Functions.


Scripting

What notification messages can my scripts listen for?

See Script Messages & Events.

Is possible to call a C# script function from a conversation?

Yes. Add a custom sequencer command or register a C# method with Lua. See Registering Functions.

How do I resolve Visual Studio issues?

Issues with Visual Studio, including VS Code, are not specific to the Dialogue System. However, although very rare, issues are more likely to happen with precompiled DLLs such as those included with the Dialogue System's evaluation version. Try updating Visual Studio, or upgrading or downgrading the Unity plugin.


Platform-Specific

Platform-Specific

If you tick a support checkbox in the Welcome Window to enable an optional Dialogue System feature, it should set it for all currently-installed build platforms. But if you install a new build platform after the fact, that one won't have the checkbox ticked. In this case, you'll need to tick the checkbox again.

Why don't sequencer commands work in my iOS, Android, or WebGL builds?

Unity is probably using code stripping. Move link.xml from the Templates folder to the root Assets folder.

Can I use code stripping?

Yes! The Dialogue System includes a link.xml in the Templates folder. Move it to the root Assets folder.

My mobile game doesn't use networking. Why does my build ask for networking permissions?

The Dialogue System includes some optional networking utility scripts. If your game doesn't use networking, you can remove the requirement for full network permissions in your builds by deleting these two files:

  • Scripts > Model-View-Controller > View > Sequencer > Sequencer Commands > SequencerCommandAudioWWW.cs
  • Scripts > Utility > LuaNetworkCommands.cs

Miscellaneous

Does the Dialogue System support multiplayer games?

Yes, several multiplayer solutions are supported for player-NPC conversations. (For player-player interaction, use a chat client instead.). Which solutions you use depend on the design of your game. You can use different dialogue databases for different players, or dynamically assign roles in a shared dialogue database at runtime, or conditionally run different dialogue trees (or different branches of the same tree) based on a variety of conditions including quest states, game objects and tags, and even complex Lua expressions. Although this may sound complicated at first because the Dialogue System supports many different methods, each one is actually very simple to use. And you're always welcome to contact us for support if any questions come up.

Every multiplayer game has different needs, and there are many different networking libraries – UNET, Photon, etc. – so there's no one-size-fits-all answer. Here's a brief description of a few approaches other developers have implemented.

  • Register custom Lua functions to update variables, quest states, and other Dialogue System data. In addition to using DialogueLua.SetVariable() and QuestLog.SetQuestState() to set them locally, the functions should also send the update to the server. When the player logs back in, the client receives a list of updates to apply locally. To reduce the amount of data to transmit and store, you can record ID numbers rather than quest/variable name strings.
  • Or keep the data in sync across all clients. If one player accepts a quest, all players receive the quest using a custom Lua function that sends the event to the server, which then broadcasts it to all clients.
  • You can also override your dialogue UI (such as UnityUIDialogueUI) to present a synchronized, shared dialogue UI to all players. Players could take turns choosing responses.
  • Or perform timed checkpoint saves. Grab the entire saved game string with PersistentDataManager.GetSaveData() and send it back to the server where it's stored as a string in, for example a MySQL database.
  • If you know you'll only be updating Dialogue System data inside conversations, you add simply add a script with an OnConversationEnd method that runs a checkpoint save.

How do I pause the Dialogue System?

To pause the Dialogue System, call DialogueManager.Pause(). To unpause, call DialogueManager.Unpause(). This will pause conversations, sequences, and barks. The sequencer commands AudioWait() and Voice() will also pause. Other than this, it won't pause AudioSource, Animation, or Animator components; you must do this on your own. Your scripts can listen for OnDialogueSystemPause messages to pause these components. (See Other Messages for more details.)

If DialogueTime is set to Realtime (the default), pausing will only affect the Dialogue System. If DialogueTime is set to Gameplay, pausing will set Time.timeScale to 0, and unpausing will set it to 1.

Can I use assembly definition files?

Please see Assembly Definition Files.

What files can I move or delete?

You can remove these three folders:

  • Assets/Plugins/Pixel Crushers/Common/Third Party Support
  • Assets/Plugins/Pixel Crushers/Dialogue System/Demo
  • Assets/Plugins/Pixel Crushers/Dialogue System/Third Party Support

Make sure you have imported any third party support packages that you need first.

If you've imported third party support packages, you can move Assets/Pixel Crushers into another folder except not into the Plugins folder. Assets/Pixel Crushers contains third party support files that depend on third party assets that are not in the Plugins folder. Unity compiles everything in Plugins first. Then it compiles everything outside of Plugins. If you move this folder into Plugins, your project won't be able to compile because the third party support files will not be able to find the third party assets since they haven't been compiled yet.

Optional:

  • Assets/Plugins/Pixel Crushers/Common/Templates
  • Assets/Plugins/Pixel Crushers/Dialogue System/Templates

You may want to keep the Templates folders if you expect to use them. They're tiny, and the template scripts are commented out so they won't have any impact compile times or build sizes.

  • All folders in Assets/Plugins/Pixel Crushers/Dialogue System/Prefabs

Keep the Dialogue Manager prefab which is located in the Prefabs folder. You may also want to keep the Basic Standard Dialogue UI prefab locaited in the Standard UI Prefabs/Templates/Basic folder to use as a reference when designing your own dialogue UI.

Do NOT move or rename anything in these folders:

  • Assets/Editor Default Resources
  • Assets/Gizmos

They are special Unity folders. Unity requires that they have this exact name.

As long as you remember that Plugins, Editor Default Resources, and Gizmos are special folders with special meaning in Unity, you can otherwise move the Dialogue System's folders around. It's well behaved in that regard. For example, you can move Assets/Pixel Crushers to, say, Assets/Addons/Pixel Crushers. Or you can move Assets/Plugins/Pixel Crushers/Dialogue System to Assets/Plugins/Dialogue System.

However, it may be easiest to leave Asset Store assets in their original locations. Not all assets are as well behaved as the Dialogue System. Some rely on hard-coded paths and can break if you move them. Instead, you can create a folder named something like "__Game" to hold your own files. This way your files will be organized separately from Asset Store assets.


<< Welcome to the Dialogue System for Unity!