Search Unity

[RELEASED] Dialogue System for Unity - easy conversations, quests, and more!

Discussion in 'Assets and Asset Store' started by TonyLi, Oct 12, 2013.

  1. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    Hi @akhil96 - Not all platforms. It has built-in support for RT-Voice, and it's designed to be very extensible so you could add support for other platforms without having to modify any Dialogue System scripts. If you have SALSA with RandomEyes (also supported), you can use RT-Voice and SALSA to get automatic, lipsync'ed text-to-speech by just adding two components (SALSA and RTVoiceActor).
     
  2. siblingrivalry

    siblingrivalry

    Joined:
    Nov 25, 2014
    Posts:
    384
    hi, how long is the sale going on for? Thanks

    Heheh I just saw the big 7 days left :)
     
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    Hi @siblingrivalry - The sale ends on September 22.
     
  4. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,116
    Hello,

    I am creating a sandbox rpg game. It has oculus rift Support. But I have Problems with my menus and my inventory when using the oculus.

    Could I use your Dialog System UI to display them? It is some text and some Buttons or textures...

    We are using rigged meshes made with MakeHuman for the game. Does Dialog System help making lips move when talking? No Need to be lipsync, it would even help if they just move...

    I know this is a bit off Topic, but I would use Dialog System for Basic talking and quests in my game, and if it would also help me with my General oculus and lip moving Problems it would be perfect!

    Thanks a lot for your info :)

    Firlefanz
     
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    Hi @Firlefanz73 - The Oculus Rift example scene on the Dialogue System Extras page includes some general purpose code for selecting Unity UI buttons by looking at them, which is a common way to select buttons in VR. You can use this to help your menu system. But the Dialogue System is not a menu system or inventory system, so it won't do everything that you're asking by itself. That said, it includes support for other inventory systems such as S-Inventory support. (The supported third party products are here.)

    Yes, there are several ways you can do this. You can use the built-in Voice() or AnimatorPlay() sequencer commands in dialogue entries, or you can use third party product support such as SALSA support to do automatic lipsync.

    The Dialogue System is perfect for talking and quests, and it's purposely designed to integrate well with other products and features. It doesn't provide a complete menu system or inventory system on its own, but it makes it easy to tie those systems into talking and quests.
     
  6. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    Here are some answers to questions received recently via email, in case they're also helpful to others:

    If the example scenes show a bunch of numbers instead of text for the NPCs' names, here are the steps to resolve the issue:
    1. Delete the Dialogue System folder.
    2. Change to Mixed mode serialization (Edit > Project Settings > Editor, then select Mixed from the Serialization dropdown).
    3. Re-import the Dialogue System.
    4. Optionally change serialization back to its previous setting.
    The example scenes are created in Unity 4 (which is 32-bit) since there are a number of developers still using Unity 4. A bug in Unity 5 (which is 64-bit) causes certain scenes to not import properly unless it's in Mixed mode. This isn't specific to the Dialogue System. Unity is aware of the issue and I believe is working on a fix.

    Yes! Under the hood, the Dialogue System runs a complete Lua scripting environment. You can define variables in your dialogue database asset and reference them in conversations, both to determine which branches to follow and to replace text procedurally. You can enter Lua code manually or use point-and-click wizards, whichever you prefer. There's also an option to include a status variable with each line of dialogue that's automatically updated whenever the line is spoken or presented as an option in the player response menu.

    Yes, absolutely. There's an extensive library of sequencer commands that you can add to any line of dialogue to run various events such as moving the camera, playing audio, sending messages to other GameObject, etc. If you're a programmer, you can also add your own C# methods to the Lua environment if you want. This way you can call them when checking which branch to follow or to run some code when saying a line. There are also components that you can add to GameObjects to update Dialogue System variables; for example, if you kill an Orc, one of these components could automatically increment your "OrcsKilled" Dialogue System variable.

    The save file only records the data that you've specified. It doesn't serialize the whole scene. Generally this makes the saved data is very small. It's stored in a text format, making it easy to review and debug. You can compress it on your own (for example using a third party zip plugin) if you want to make it smaller. The Dialogue System is used in several RPGs and other conversation-heavy games for mobile devices, such as Terra Monsters and Dead Bunker.

    Please also keep in mind that the Dialogue System's save system saves the game to a string. It's up to you to save the string to PlayerPrefs, a local disk file, a SQL database, etc. (The Dialogue System provides a basic GameSaver component that saves to slots in PlayerPrefs and a simple FeatureDemo menu for testing Dialogue System features such as saving and loading.)
     
    Last edited: Sep 16, 2015
  7. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    393
    Hi, before purchase I'd like to ask something about languages. I do have a asset named Localization package, is it compatible with this asset(or it can handle this easily)?
     
  8. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    Hi @zhuchun - The Dialogue System is not incompatible with Localization Package, but it doesn't offer any special features to work specifically with it.

    The Dialogue System has its own localization system. It doesn't do automatic translation. (Automatic translators don't provide very good results.) If you want to use Localization Package's automatic translation, you can export Dialogue System data to CSV format and load it into Google Sheets. The format of the spreadsheet is slightly different from Localization Package's format. You can copy the rows into a new sheet for Localization Package. After Localization Package fills in the translations, you can copy the rows back into the Dialogue System's CSV spreadsheet and re-import it back into the Dialogue System.
     
  9. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    393
    Hi, Thanks for the quick reply :)
    In fact I don't need auto-trans features, but Google sheets is very handy to manage our data, especially for collaboration and version control purpose. Can Dialogue System get copy from Google sheets and compile/import it automatically when we compile(the way localization package works)?
     
  10. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    It's my understanding that with Localization Package you need to click the "Update translations" button to import.

    The Dialogue System's importer doesn't import automatically. As with Localization Package, you need to click an Import button. This imports from a local file. I'll add Google Sheets import to the development roadmap so it can pull straight from Google without having to download to a local file first.
     
    Licarell likes this.
  11. Anderz

    Anderz

    Joined:
    Dec 5, 2013
    Posts:
    24
    Hi Tony,
    I'm having an issue with Lua variable conditions. We would like to check variable A against Variable B and see if the two equal each other.

    Here's what I'm using:
    Variable["Number1"] == Variable["Number2"]

    Problem is this doesn't work. I can see in my watch list the two variables equal each other, yet it never returns true. Manually entering the value of Number2, and not using a variable, works fine. But our values are dynamic, and therefore I need to be able to compare these two variables in the condition. Is this possible? If so, what am I doing wrong?
     
  12. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    Hi @Anderz - If it's what I think it is, it's such a subtle little thing that it threw me for longer than I'd like to admit. In the Dialogue Editor, make sure the variables' Initial Value dropdowns are set to Number:

    Initial Value specifies the variable type. The default is Text. If I had left the dropdowns set to Text, internally the values would be:
    • Variable["Number1"]: "23"
    • Variable["Number2"]: "23"
    If I then run the Lua code: Variable["Number2"] = 23, the values would be:
    • Variable["Number1"]: "23"
    • Variable["Number2"]: 23
    These are not equal because one is a string ("23") and the other is a number (23).

    Also, internally in Lua numbers are stored as floats. If you do a lot of weird math, it's possible that one of the values could end up being something like 23.00001 instead of 23. In this case, you can convert them to integers using the math.floor function: mathf.floor(Variable["Number1"]) == mathf.floor(Variable["Number1"])

    On a related note, readers may also be interested in the Lua Syntax Gotchas page. Lua has a couple little syntax quirks, such as using ~= for not-equals instead of the != used in C#.
     
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    Dialogue System 1.5.5 Patch 2015-09-16 Available

    A patch is available on the Pixel Crushers customer download site. If you need access, please PM me your Asset Store invoice number.

    This patch includes:
    • Changed: The Dialogue Manager’s Default Sequence now delays instead of doing camera closeups.
    • Improved: Recording SimStatus in saved games is now significantly faster.
    • Improved: Conversations now respect Override Actor Name on extra conversation participants, not just the primary actor and conversant.
    • Improved: Unity UI Typewriter effect can now run faster than one character per frame update.
    • Fixed: [QuestPopup] attribute wasn’t saving value selected from popup menu.
    • Action-RPG Starter Kit: Fixed bug syncing equipment when saving and loading.
    • PlayMaker: SetVariable and SetLuaField action values now default to None.
    • plyGame: Added option to set a Mecanim animator state when starting a conversation.
    These additions will also be in the next full release (1.5.6) coming shortly after the Unite conference.
     
    Ony likes this.
  14. Anderz

    Anderz

    Joined:
    Dec 5, 2013
    Posts:
    24
    Hi Tony, thanks for your detailed response. We noticed this ourselves and made sure all variables were set to numbers. However, we have a text input field in our conversation which lets the user set the second number variable, and the moment that input field is submitted, the variable sneakily changes type from a number to a string. This is not reflected in the Variable editor window ; we only discovered this via using the Lua console at runtime to check types before and after the input field. So that is why our comparison fails despite both being set, initially, as number variables. (For the record, we need these to be numbers because we do greater than and less than comparisons too).

    Is it possible to support numerical input fields in a future release? In the meantime, we will run a conversion from a text variable to number variable.

    Thanks though for pointing us in the right direction!
     
  15. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    Hi @Anderz - I'll publish a patch later today for the TextInput() sequencer command that supports number fields and also allows you to specify the range characters that are allowed in the input field (e.g., only 0-9).
     
  16. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    I'm sharing some more answers to questions received via email in case they're helpful to other readers:


    How does the Dialogue System's save system work?


    The Dialogue System's save system records the Dialogue System's state. (Internally, the state is the memory of the Dialogue System's Lua scripting environment.) This includes things like quest states, which responses the player has chosen, and user-defined variables. It also provides a framework for adding your own data to the Dialogue System's state, and it comes with components that do this to save positions of GameObjects, whether they're active or inactive, etc. It also saves the current level so it can load that level when loading a saved game. Saved game data is returned as a string that you can store using whatever method you want -- PlayerPrefs.SetString(), write to local disk file, write to SQL database, etc. You're responsible for writing the string to storage. The Dialogue System also provides a Game Saver component that lets you save to slots in PlayerPrefs without having to write any code.


    How does the Dialogue System's NPC relationship work, and how does it differ from Love/Hate?

    The Dialogue System's relationship system is fairly basic. It's replicates Chat Mapper's relationship system. (The Dialogue System implements all Chat Mapper features in Unity.) You can define a relationship type such as "Respect" or "Love" and manually associate numeric value between two actors. For example: Romeo + Juliet + "Love" + 50. In a dialogue entry's Script field, this would be expressed as:
    Code (sequencer):
    1. SetRelationship(Actor["Romeo"], Actor["Juliet"], "Love", 50)
    Then you can use GetRelationship() in the Conditions field to branch the conversation based on different values.

    Love/Hate's relationship system is much more sophisticated. It works independently of the Dialogue System's relationship system. A support package in Love/Hate provides similar functions that you can use the dialogue entry Script fields, such as:
    Code (sequencer):
    1. SetAffinity("Romeo", "Juliet", 50)
    as well as reporting deeds that Faction Members can judge:
    Code (sequencer):
    1. ReportDeed("Romeo", "Juliet", "Kiss")
    and controlling all other aspects of Love/Hate.


    Does the Dialogue System support multiplayer?

    The Dialogue System has been used in multiplayer projects, but it doesn't provide any multiplayer-specific features because the requirements are different for every project. For instance, do you want to show the same conversation for all players in the group? Allow only the initiating player to choose menu responses? Allow players to collaborate on responses? Have shared quests or individual quests for each player?

    Because the Dialogue System's UI subsystem is modular, you can swap in your own multiplayer-aware UI to handle the specific requirements of your project.


    How do I tie the Dialogue System into gameplay activity?

    One of the strengths of the Dialogue System is the broad support for gameplay integration.

    The easiest way is to control the Dialogue System during gameplay is to add a Dialogue System Trigger. You can configure it to fire on a variety of conditions such as entering a trigger area, receiving an "OnUse" message from the player, or when starting. When it fires, the Dialogue System Trigger can do things like start a conversation, make a character bark, update quest states, or play cutscene sequences. (See How to Set Up NPCs and How to Set Up the Player for more specific examples.)

    Alternatively, you can use the Condition Observer component to watch for changes in Dialogue System states during gameplay. The Quest System documentation has a Condition Observer example.

    If, on the other hand, you want a conversation to trigger something in-game such as activating a light, use sequences. Every dialogue entry (node in a conversation tree) has a Sequence field. You can use sequencer commands such as SendMessage() to invoke script methods and SetActive() to activate/deactivate GameObjects. There are lots of other sequencer commands, too, that do things like move GameObjects and play animations.

    For example, you could use SetActive() to turn on a Point Light GameObject, Audio() to play a lightswitch click sound, and MoveTo() or Animation() to animate the lightswitch. If you don't want to enter these commands into the Sequence field, you can use an interactive cutscene editor such as uSequencer or Cinema Director.

    You can also tie your own C# methods into the Lua environment using Lua.RegisterFunction(). Then you can reference them in dialogue entries' Conditions and Script fields.
     
  17. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    @TonyLi - In starting the architecture of my game I will be using assets such as Dialogue System, Love/Hate, Behavior Designer and most likely UniStorm. I'll most likely use Unistorm's time feature to keep track of days and use that to trigger daytime events, sleep, work, eat, etc. I see that some of these assets come with their own save system, would I need a game asset like Makonim to handle saving the overall states of each asset or could I use any one save system to control the other states?

    Sorry if this is a noob question...
     
  18. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    Hi @Licarell - Yes, if you're using Makinom as your overall framework, it's best to use Makinom to handle overall saving. Makinom (and other frameworks such as ORK Framework, plyGame, Adventure Creator, etc.) provide save/load UIs and writing to local disk files. Since the Dialogue System provides support packages for these frameworks, it's just a matter of adding a component such as Dialogue System ORK Bridge. (Makinom support is coming in the next version. Under the hood, Makinom is very similar to ORK.) The bridge component automatically feeds the Dialogue System's save data to the other framework's save system.

    The same applies to Love/Hate. Just add a Makinom Love Hate Faction Manager component, and it will automatically tie Love/Hate into Makinom's save system.

    UniStorm support will also be in the next version. So your NPCs will be able to branch conversations based on the time of day, or make comments about the current weather conditions.
     
  19. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    Too bad there isn't a head exploding emoji....:)
     
  20. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    People on the forum know I'm a big fan of component-based design. It's neat how small components (such as a component that returns the time of day) can combine to create interesting, emergent behavior, seemingly all on their own. :)
     
  21. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    @TonyLi - BTW, not to hijack the thread but... how is your quest system coming?
     
  22. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    The Sensible Sale took me by surprise -- in a very pleasant way, don't get me wrong! But it's delayed the procedural quest system a bit. I had hoped to release a beta before Unite, but it'll come out after. I have some improvements to make based on some awesome community suggestions on character motivations.
     
  23. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    Hi @Anderz - The Pixel Crushers customer download site now has an updated patch 2015-09-17. The TextInput() sequencer command now checks the initial type of the variable. If it's a number, the player's input is saved in the variable as a number. Otherwise it's saved as a string.

    Since TextInput() references the UnityUITextInputField by GameObject name, you can have one for numeric input and one for freeform text input if you want. This lets you set the Content Type dropdown differently for each, such as setting it to Integer Number for the numeric field.


    Patch 2015-09-17
    (New additions in this patch are marked [new].)
    • [new] Added: PersistentDataManager.RecordAsync and GetSaveDataAsync.
    • Changed: The Dialogue Manager’s Default Sequence now delays instead of doing camera closeups.
    • [new] Changed: TextInput now saves number variables as numbers, not text.
    • Improved: Recording SimStatus in saved games is now significantly faster.
    • Improved: Conversations now respect Override Actor Name on extra conversation participants, not just actor and conversant.
    • Improved: Unity UI Typewriter effect can now run faster than frames/second.
    • Improved: Eliminated garbage created by certain operations.
    • Fixed: [QuestPopup] attribute wasn’t saving value selected from popup menu.
    • Fixed: All scripts now reference UnityEngine.UI explicitly in case the global namespace has conflicting.
    • Action-RPG Starter Kit: Fixed bug syncing equipment when saving and loading.
    • PlayMaker: SetVariable and SetLuaField action values now default to None.
    • plyGame: Added option to set a Mecanim animator state when starting a conversation.
     
  24. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    I recently received a few inquiries about the quest system. Here's some general info for anyone who's interested:

    The Dialogue System includes an integrated quest system because quests are almost always intimately tied to dialogue. The motivations that NPCs express in conversations give context to the quests, and quests usually start and end in conversations.

    The quest system is quite flexible. I recommend playing the Quest Example scene to get an idea of a few things you can do with it. If you have NJG MiniMap, HUD Waypoint, or other supported products like that, you can also play the example scenes in their third party support packages to see how they integrate into quests to show quest waypoints, quest locations on the minimap, etc.

    Briefly, the quest system has four parts:

    1. Quest definitions in the dialogue database: You can define quest text and other data fields on the Items/Quests tab. A quest can be a simple quest with a description and a state, or it can be more complex with multiple quest entries (subtasks). Each quest entry has its own description and state. You can add custom fields such as the experience point value of the quest. Your code/PlayMaker FSM/etc. is responsible for actually reading this value and awarding the experience points, since it's different for every game. You can also use [var=varname] and [lua(code)] tags in your description texts to fill in text dynamically. All quest text supports localization.

    2. Quest triggers and gameplay integration: Components like Dialogue System Trigger and Condition Observer let you change quest states in response to gameplay events such as entering a trigger area. Components like Increment On Destroy increment Dialogue System variables when you kill enemies or harvest items. You can check quest states in conversations and other triggers' conditions, too. Finally, you can use the QuestLog class (or equivalent visual scripting actions) to control quests directly in your own code.

    3. Quest tracker HUD: This UI tracks active quests during gameplay. (More info)

    4. Quest log window: This UI shows a quest log window where you can review active and completed quests, toggle quest tracking (if the quest is marked trackable), and abandon quests (if the quest is marked abandonable). (More info)

    All UIs are fully customizable.

    The ability to add custom fields is really powerful (as are the [var] and [lua] tags). Some studios have even put Lua code in custom fields. When they activate or complete a quest, they run the Lua code. If they've registered their own C# methods with Lua, they can run arbitrary code for each quest this way. While this isn't required, and you can certainly create very complex quests without any scripting, this demonstrates how customizable the quest system is.

    For more info, see the quest system documentation or watch the video tutorial. Or post questions here, of course! :)
     
  25. ScottSummers

    ScottSummers

    Joined:
    Jul 12, 2015
    Posts:
    27
    When I import ORK Framework to a new project, and then import Dialogue System, I get this console message:

    Error importing folder (The pathName assets/gizmos is already mapped to caad45941235add46a0425918c1ae074. But the meta data wants it to be mapped to f8c78e69a28e92a48a5f30e53610cafc)​

    Will that cause problems later? (These are the latest versions of both assets.)

    Thanks for making them compatible!
     
  26. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    Hi @ScottSummers - No, it won't cause any problems. Enjoy working with ORK. I think they make a great combination for RPGs.
     
  27. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    558
    hey just a quick question, im using ufps and dialogue in a new project and im wondering if the save load feature can save objects/prefabs instigated at runtime, im using a building system and would like to save each part's rotation and postion...
    right now im trying with adding the PersistentPostionData script, not sure if i have to edit anything or add anything, also im using the ufps dialogue manager from test scene..
    thanx again for your help..
     
  28. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    Hi - None of the built-in persistent data components are designed for instantiated objects, but you could write your own. It would take a little scripting. The Dialogue System includes a template to give you a head start.

    If I can offer any guidance, just let me know. The persistent data template has two methods: OnRecordPersistentData and OnApplyPersistentData.

    In OnRecordPersistentData, store information about the instantiated prefabs in the Lua environment. For example, you might have a variable named "Instantiated Objects" that contains a string in this format:

    #items; item_1_prefabName; item1_x, y, z; item2_prefabName, item2_x, y, z, ...​

    In OnApplyPersistentPersistentData, retrieve that information from the Lua environment and re-instantiate the prefabs.
     
    Last edited: Sep 20, 2015
    llJIMBOBll likes this.
  29. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    Dialogue System 1.5.5.1 Released

    This is an interim release that contains several small improvements and bug fixes. You can download it right now from the Pixel Crushers customer download site. (PM me your Unity Asset Store invoice number if you need access.) It should be available on the Asset Store in a few days, give or take a little extra since Unite Boston is going on next week.


    Version 1.5.5.1
    Core

    • Added: PersistentDataManager.RecordAsync and GetSaveDataAsync methods.
    • Changed: The Dialogue Manager’s Default Sequence now delays instead of doing camera closeups.
    • Changed: TextInput now saves number variables as numbers, not text.
    • Improved: Recording SimStatus in saved games is now significantly faster.
    • Improved: Conversations now respect Override Actor Name on extra conversation participants, not just actor and conversant.
    • Improved: Unity UI Typewriter effect can now run faster than frames/second.
    • Improved: Eliminated garbage created by certain operations.
    • Fixed: [QuestPopup] attribute wasn’t saving value selected from popup menu.
    • Fixed: All scripts now reference UnityEngine.UI explicitly in case the global namespace has conflicting names.
    Third Party Support
    • Action-RPG Starter Kit: Fixed bug syncing equipment when saving and loading.
    • PlayMaker: SetVariable and SetLuaField action values now default to None.
    • plyGame: Added option to set a Mecanim animator state when starting a conversation.

    The next major release, 1.5.6, will include support for Makinom, UniStorm, Rogo Lipsync, and GameFlow, as well as some Dialogue Editor improvements.
     
    Last edited: Sep 20, 2015
  30. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    558
    Thanx again man for your reply :D
     
  31. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    2,142
    Hey, I just happened to jump onto the asset store and saw the sale including this asset. It looks interesting but I have a question about it.

    I'm planning a dynamic dialog system that occurs in real time and as the player is controlling the character. The player will not lose control of the character during the dialog scene. Additionally, the player will be able to interrupt an NPC's comments to interject at will (and based on if and when they do so, the conversation might branch differently). Additionally, when the NPC finishes speaking, the player has some amount of time to speak before the NPC either continues or breaks off the conversation altogether.

    So basically:
    -conversation occurs in real time and does NOT disable character movement (I imagine using stuff like the number keys to select an option)

    -player can select a convo option during another character's speech (I imagine some kind of timed trigger for the other character's speech, selected based on the audio clip's time, with sections of that time potentially going to different next steps in the conversation). In really awful pseudo-code:
    if (SisterDialog3Time >= 4:143 && SisterDialog3Time <= 5:485 && Input.GetKeyUp ("2"){
    Trigger SisterDialogChallenge;
    }

    -after a "speech" is finished, some variable amount of time is passed, during which the player can trigger a conversation choice, but if they don't then the sequence continues without their input.

    Also, because of these last two the dialog options will need to appear and vanish based on, I suppose, the time elapsed within the current "segment" or "node" I guess you might say.

    Is this possible for this system?
     
    Last edited: Sep 21, 2015
  32. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    Hi @EternalAmbiguity - Yes, the Dialogue System supports all of that.
     
  33. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    2,142
    Good to hear, thanks.
     
  34. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    6,512
    How can I call OnContinue from a script?
     
  35. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    Hi, find your dialogue UI, and call OnContinue. If it's assigned to the Dialogue Manager's Dialogue UI field, call:
    Code (csharp):
    1. (DialogueManager.DialogueUI as AbstractDialogueUI).OnContinue();
    Otherwise you can use something like FindObjectOfType<UnityUIDialogueUI>().
     
  36. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    6,512
    Okay, code example is basically exactly what I was looking for, but now I have an odd problem.

    In the following screenshot, an NPC named "Liz" is saying "Butts" but the name tag is saying her name is "Dialogue Manager"


    As seen here, the problem is only when displaying NPC subtitles, because the player, named "Player", shows up fine.


    This is what I'm using as my dialogue display settings for this. Am I doing something wrong here? It seems this should be working.
     
  37. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    Hi, the conversation trigger is choosing to use the Dialogue Manager as the conversant. Can you manually assign the right conversant GameObject? If necessary, you can add an Override Actor Name to it to use a name other than the GameObject name.
     
  38. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    6,512
    Is there no way to have it choose the name from the conversation itself? Or is there a specific workflow I should be using if I have 3 or more people in a conversation?
     
  39. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    This was a design decision to make it easier to use general purpose conversations, such as a generic villager or shopkeeper conversation, but allow you to specify different shopkeepers with different names and GameObjects.

    Depending on the way you're triggering the conversation, the actor and/or conversant may always have an assigned GameObject. Can you explain or post a screenshot of how you're starting the conversation?

    If additional participants have a GameObject that matches the name in the dialogue database, it will use that GameObject and its optional Override Actor Name component. If no GameObject matches the name in the database (for additional participants), it will just use the name in the database as-is.
     
  40. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    6,512
    What I did was just put the conversation trigger to activate on start and put it on the dialogue manager. This was all just to test things and by no means was a permanent thing. I don't have any gameobject assigned in either the actor or conversant field.

    What I'm trying to do is set up a framework to help me develop visual novels in Unity. Periodically I want to have it so that there are three or more people in a conversation with the player but these additional actors do not have gameobjects associated with them, just the names in the dialogue database.

    edit: for the time being, I'm just manually overriding the name system by attaching a script with
    Code (CSharp):
    1. nameText.text = DialogueManager.CurrentConversationState.subtitle.speakerInfo.nameInDatabase.ToString();
    to the dialogue name text element.
     
    Last edited: Sep 23, 2015
  41. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    Hi @Murgilod - sounds like that will work. You could also start the conversation using DialogueManager.StartConversation() without providing any transforms, and then you don't need to do the workaround you posted above.
     
  42. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    6,512
    Your solution works perfectly and is a lot less complicated than my version, thanks!
     
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    Happy to help! Sorry you couldn't use Conversation Trigger. Automatically assigning a conversant transform is usually a nice convenience in most cases, but in this case I'm glad you could trigger it with that method instead.
     
  44. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    Version 1.5.5.1 is now available on the Asset Store!
     
  45. The-Sovereign

    The-Sovereign

    Joined:
    Jul 15, 2015
    Posts:
    24
    I'm having a little problem with 1.5.5.1 version on Unity 5.2, when a conversation is triggered, the camera "shakes" and flash something on the screen. The same thing happens again, when the player's answers appear. I can't be more specific because I really don't understand what I see.

    Regards.


    EDIT: Ok, seems like the camera flips over the player character a few milliseconds, showing the ground. As if it will be placed over the player and return to its original position.
    EDIT2: Nevermind, Camera(Closeup); was guilty.
     
    Last edited: Sep 24, 2015
  46. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    2,142
    Bit of a problem here.

    I'm only just getting started on figuring this out. However, I saw something in the FAQ:

    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.

    I asked about this:

    "-after a "speech" is finished, some variable amount of time is passed, during which the player can trigger a conversation choice, but if they don't then the sequence continues without their input."

    You said this was possible, so I assume there's some kind of workaround to this?
     
  47. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    Sorry about that. I'm glad you got it all sorted out. The default Dialogue Manager prefab still uses the Camera(default) sequencer command. The next release will change this to Delay({{end}}) since that seems to be more practical for the majority of cases.

    Many people make the first player response something like "[say nothing]" or "..." and set the Dialogue Manager's Response Timeout. If the player doesn't choose a response before the response timeout period, it will auto automatically choose the first response. Link this to your NPC response(s) that occur when the player doesn't choose a response.

    If you need a different response timeout for each entry, let me know. I'll send you a small sequencer command script that does this.
     
  48. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    2,142
    Very clever. Now is there a way to make it (that single option) invisible? I'd prefer a truly "dynamic" system where the conversation can progress without input, but if I can make it so the player doesn't realize a choice is being selected, it will have the same effect. I imagine I'll be alright about the timeout, the main key is to have them flow.

    A couple more questions. I was trying find a way to change the inputs so I could use the key 1 for the first response, 2 for the second, and so on (though perhaps it should be 1 for the second, if "..." is the hidden first response), but I'm not sure how I'd do that. I saw on the "wiki" or downloadable documentation web pages that there's a general keyboard/gamepad functionality, but I didn't see anything about using specific keys for whatever number the response is in the list.

    Along those same lines, if possible I would like to be able to use a single key to cycle through the list (like the down arrow does now, but a specific key) and then another (or maybe the same, if you can detect the difference between holding a key and pressing a key) to select the dialog option. The player will be moving with WASD and the mouse during the conversation, so there's not really "room" or "time" to have them stop and use the arrow keys and enter to select dialog options.

    Additionally, how would I add voice-over to a line without regarding facefx, or some other lipsync tool? I'm not concerned about lipsyncing right now, and it won't be a big concern for me (one benefit of a system where you move around while talking is you won't be looking at the other person often), but I do want to prototype the actual voice-overs and such. Is there a way to do that?
     
  49. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    Hi @EternalAmbiguity - Yes, in this case you'd use a small sequencer command. I'll post it here later today.

    Add a Unity UI Button Key Trigger component to each response button. (Component > Dialogue System > Unity UI > Effects > Unity UI Button Key Trigger) This lets you assign a key code (such as '1') and/or an input button (such as gamepad button 'A').

    I've been giving instructions above using Unity UI, since that seems to be the GUI system that everyone's standardizing on. In this case, look into using Unity UI's built-in navigation system, with extra Dialogue System-specific notes here. (Also, please keep in mind that if you want to change or completely replace the way the Dialogue System does its UI, you can provide your own code and the rest of the Dialogue System will work happily with it. Instructions for custom UI code are here.) You can do most things with the built-in Unity UI code, though; you probably won't go the custom code route, but I thought I'd mention it.

    Put your audio files in a Resources folder. Then use the AudioWait() sequencer command in your dialogue entry's Sequence field.

    Here's an example:
    • Let's say an NPC named Fred says, "Hello, world," and you've recorded a file helloWorld.wav.
    • Put helloWorld.wav in a folder named (for example) Assets/Audio/Fred/Resources/helloWorld.wav.
    • In the Dialogue Editor, inspect the "Hello, world" dialogue entry. Set the Sequence field to:

      AudioWait(helloWorld)
    You can add an audio source to your NPC to customize its behavior; otherwise the Dialogue System will automatically add one when needed.

    You can read more about sequences in general here. If you have a lot of lines, you'll probably want to use entrytags to automate it. You can read about entrytags here.
     
    EternalAmbiguity likes this.
  50. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,021
    EternalAmbiguity likes this.
unityunity