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:
    12,692
    I don't see anything wrong with the screenshots so far. "Did you find the vote?" has two links, to the Yes/No responses.

    "No, I haven't yet." (the screenshot in your second post) doesn't have any responses, which looks right.

    Luds is the player, right? I assume so because the Yes/No response nodes are blue.

    Is the Dialogue Manager's Subtitle Settings > Continue Button set to something other than "Never"? If so, it's probably waiting for the player to click a continue button. If this is the case, try setting it to Never just to make sure the conversation flow works properly. You can add continue buttons later.

    If that doesn't address the issue, please feel free to email a copy of the project to me at tony (at) pixelcrushers.com. I'll be happy to take a look.
     
  2. snowcult

    snowcult

    Joined:
    Feb 6, 2014
    Posts:
    295
    Boom, that works :) Setting it to never allows me to choose the "No" option now. Alright, I'll steer through the docs and find how to do continue. Thanks for that!
     
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Great! Continue buttons are a little complicated in order to give them the flexibility developers wanted. If you only want to continue by pressing a key or controller button, make the GUI button invisible. If you want the player to be able to click anywhere on the screen to continue, make the continue button invisible but covering the whole screen. Otherwise, for a normal continue button, just follow the steps as described in the docs. And if you run into any issues, please post here or email me any time!
     
  4. hike1

    hike1

    Joined:
    Sep 6, 2009
    Posts:
    401
    using 1.36
    rpg kit lite 2.15

    Doing the rpg kit 2.1 tutorial written, the video is wrong now.



    'to make an NPC bark:

    Add an NGUI Bark UI component to the NPC.'

    Can't find this other than the c# script, is that it?
     
  5. hike1

    hike1

    Joined:
    Sep 6, 2009
    Posts:
    401
    Found it, should be in the tut

    component/ dialog system/ third party /ngui
     
  6. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Yes, you can just add that script. You should also be able to add it by selecting menu item Component > Dialogue System > Third Party > NGUI > Bark UI. I'll double-check that when I get back into the office. [EDIT: Never mind, you just found it. :) I'll add this to the documentation.]
     
  7. hike1

    hike1

    Joined:
    Sep 6, 2009
    Posts:
    401
    I guess I'm confused, I didn't realize that everything was already
    done in 'level 1 ds'

    I name 'level1 ds' level 1 and add it to build settings.



    ' Method 1: Use the modified Level 1 scene.
    Rename the scene RPG/Game/Scenes/Level 1 to Level 1 Original.
    Rename the scene Third Party Support/RPG Kit/Example/Level 1 DS to Level 1.'

    That was great, except I went ahead and did method 2 also, made a big mess. Dumped dialog system,
    reimport the whole thing, (I know, didn't need to, just the 3rd party part), imported the ngui, RPG, and
    Ai for Mecanim, works now.

    Now the barker is barking 'nice weather, eh?', etc. the guy on the
    left end with no title above his head is a shopkeeper with no conversation, the converser
    and shopkeeper (guy on far right) has a little conversation before
    you shop.

    A question, is Ai for mecanim now included with RPG kit, or just some bits of it?
     
  8. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi Terry, I'm glad it's working now. To my knowledge, Zerano included the complete AI for Mecanim in RPG Kit.
     
  9. Justinas_Ma

    Justinas_Ma

    Joined:
    May 8, 2014
    Posts:
    31
    Hey there, it seems that the new Unity UI bark script fails to get Sequence end. If I tick "Wait until sequence ends", bark is shown forever and "Set Enabled on dialogue event" script doesn't execute "On end". If you need any more info, please let me know.
     
  10. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi Teshla, here's an updated support package.
     
  11. dakotapotter

    dakotapotter

    Joined:
    Oct 22, 2014
    Posts:
    1
    IM trying to start the conversation when my player collides another object such as the character or actor in the scene

    I used the DialogueManager.startconverstion("Conversation")

    but IM getting an error saying unidentified "DialogueManager" I tried renaming the Dialogue Manager to DialogueManager thinking the space was the problem but it didn't change anything. Any suggestions?
     
  12. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi dakotapotter, put this in the "using" section at the top of your C# script:
    Code (csharp):
    1. using PixelCrushers.DialogueSystem;
    Then start the conversation similarly to this:
    Code (csharp):
    1. void OnCollisionEnter(Collision collision) {
    2.     DialogueManager.StartConversation("Conversation", collision.transform, this.transform);
    3. }
    The code above tells the Dialogue System to start a conversation named "Conversation" with the colliding object as the Actor (i.e., the main conversation participant, or the player), and the object containing this script as the Conversant (i.e., the other participant).

    You may prefer to use a built-in Dialogue System component instead of your own script. (It's also less code for you to have to maintain.) As described in How to Set Up NPCs, you could use a Conversation Trigger set to OnTriggerEnter. In this case, you'd want to tick Is Trigger on one of the colliders or add a child GameObject with a trigger collider.
     
  13. EDarkness

    EDarkness

    Joined:
    Feb 1, 2013
    Posts:
    506
    I haven't messed with dialog options in a while. Good to see you're still working diligently as always. I'm going to be working with this in the near future for quests and I have a lot of catching up to do.
     
  14. Justinas_Ma

    Justinas_Ma

    Joined:
    May 8, 2014
    Posts:
    31
    Hey, thanks for the quick fix! Works like a charm!
     
  15. Alic

    Alic

    Joined:
    Aug 6, 2013
    Posts:
    137
    Hey Tony, got a possible bug for you. When using a ProximitySelector component and the new UnityUISelectorDisplay component on my player, the name message and use message appear correctly unless the object with the usable component is destroyed while in range of the Selector. When this happens, the SFUnityUISelectorPanel's gui elements simply never disappear! This is not an issue with the old GUI components.

    The new UI is incredible, by the way! Thanks for supporting it so fast!



    Adding a quick 2 lines gets it working the way I want by the way, but I'm not sure this addresses the root problem (are usables staying registered when they shouldn't be?) and I'm not sure it works for all use cases:

    public void Update() {
    if (usable != null) {
    UpdateDisplay(IsUsableInRange());
    }
    else
    HideControls();
    }
     
    Last edited: Oct 22, 2014
  16. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Thanks for letting me know about the issue. I'll make sure it's fixed in the next release. I think Unity's new UI system is really nice, too. The Dialogue System's support package for it probably isn't taking advantage of everything the new UI system has to offer. If you have any suggestions or feature requests, please let me know!
     
  17. EDarkness

    EDarkness

    Joined:
    Feb 1, 2013
    Posts:
    506
    I haven't messed with dialog options in a while. Good to see you're still working diligently as always. I'm going to be working with this in the near future for quests and I have a lot of catching up to do.
     
  18. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Sounds good! Recent versions have improved the Quest System with things like better language localization and improvements to the quest log window to make quests easier to integrate with conversations. Skim over the Release Notes for an overview of the recent changes. And if you have any questions, as always please feel free to post here or email me directly!
     
  19. EDarkness

    EDarkness

    Joined:
    Feb 1, 2013
    Posts:
    506
    Is the quest system still tied to your UI, or can we have our own UI now?
     
  20. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    You can use your own UI. Like with the dialogue UI, the quest UI is completely independent from the quest data. If you want a base framework to build on, you can create a subclass of the abstract class QuestLogWindow which already does most of the data handling for you. Subclasses for Unity GUI, the new Unity UI, DF-GUI, and NGUI are included.
     
  21. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    The Dialogue System v1.3.7 has been released! It should be available on the Unity Asset Store in a few days. You can download it right now on the Pixel Crushers customer download site. (PM me your invoice number if you need access.)


    Version 1.3.7

    Core:

    • LuaInterpreter:
      • Added: Lua 5.0 table.getn() and table.setn() functions.
      • Added: print() function writes output to Unity console view.
      • Fixed: Upper bound issue with math.random() function.
      • Fixed: Parsing error involving if-then statements.
    • Added: CSV import/export to LocalizedTextTable.
    • Added: Dialogue Manager > Em Tag For Old Responses option (for graying out visited responses)
    • Changed: LookAt() sequencer command keeps subject upright (instead of changing up vector) by default unless you specify allAxes.
    • Changed: ChatMapperProject.Load/Save() methods moved to ChatMapperTools static utility class.
    • Improved: Added optional gameplay alert message to Increment On Destroy.
    • Fixed: Positioning error with Unity GUI Typewriter Effect when used with centered, multi-line text.
    • Unity 4.6 UI (beta):
      • Fixed: UnityUIBarkUI wasn't observing Wait Until Sequence End checkbox.
      • Fixed: When a Usable was destroyed while selected, the selector still showed its use message.
    Third Party Support:
    • Action-RPG Kit: Added menu item to automatically set up player prefab; renamed ARPGSaveLoad to DSSaveLoad.
    • Adventure Creator: AC() sequencer command has optional third parameter stepNumber; fixed: Third Party Lua action wasn’t syncing Lua values back to AC variables.
    • NGUI: Fixed flash of full text before typewriter effect starts.
    • plyGame: Reassigned example scene animations that were reset with latest update to plyGame.



    Coming Soon:
    • Full pop-up menu selection for conversation triggers, bark triggers, Lua triggers, etc. No more having to manually type in conversation titles and Lua variable names!
    • Unity 5 compatibility
    • plyGame Support: Incorporation of new plyGame features
    • Cinema Director Support
    • Unity UI: Portrait sprites
     
    snowcult likes this.
  22. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Nice update :)

    Is the support for ORK Framework still planned btw ?
     
  23. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Yes, absolutely. I plan to release support for ORK Framework and Hitbear's Platformer-RPG Kit by the end of November.
     
  24. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Amazing news, thanks. :)
     
  25. Enki

    Enki

    Joined:
    Jun 2, 2013
    Posts:
    20
    How would I go about tying in a currently created object with the quest system? ie, one of my conversants is looking for an object, and I've added an item to the dialogue table, but that's just an internal tablename. I'd like it to coincide with a gameObject I have, which has an Item script attached.
     
  26. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi Enki, you need to sync up the internal table with the game world state. The third-party support packages might provide a workable model to follow. Most of them set a field named "Count" in the item (for example, Item["Pie"].Count). This way, you can check the Count field in a dialogue entry's Conditions. Example:
    • Conditions: Item["Pie"].Count > 0
    • Dialogue Text: Here's your pie.
    • Script: Quest["Bakeoff"].State = "success"
    The most direct way to set Count is using DialogueLua.SetItemField(). Example:
    Code (csharp):
    1. DialogueLua.SetItemField("Pie", "Count", 1);
    or
    Code (csharp):
    1. int count = DialogueLua.GetItemField("Pie", "Count").AsInt;
    2. DialogueLua.SetItemField("Pie", count + 1);
    You can also use Lua.Run() for lower-level Lua access. Example:
    Code (csharp):
    1. Lua.Run("Item['Pie'].Count = 1");
    (These are in the PixelCrushers.DialogueSystem namespace, so add "using PixelCrushers.DialogueSystem" to the top of your script.)

    The third-party packages listen for messages like OnConversationStart(). Take Adventure Creator for example. OnConversationStart() populates the Dialogue System's Item[] table with Adventure Creator's inventory. OnConversationEnd() updates Adventure Creator's inventory with any changes that occurred in the Dialogue System's Item[] table during the conversation.

    If you don't want to manage any scripts, there are other options. Say the player picks up an item by walking over its pickup object. Presumably your Item script would handle this in OnTriggerEnter(). You can add a Lua Trigger to the pickup object. Set its trigger to OnTriggerEnter. Set the Lua Code field to:
    Code (Lua):
    1. Item["Pie"].Count = Item["Pie"].Count + 1
    If you want to keep track of items in the Variable[] table instead, you can use Increment On Destroy. This is useful for general "count" quests such such as kill quests or gather quests. It assumes the pickup object is destroyed when the player picks it up. Instead of writing Lua code like the Lua Trigger example above, you can just provide a variable name (e.g., "NumPies"). You can find an example of Increment On Destroy on the enemies in the Quest Example scene.

    Lua Trigger and Increment On Destroy update the Quest Tracker HUD if you have one assigned to the Dialogue Manager GameObject. They also update the Item[] / Variable[] table immediately, so you don't need to do any syncing in OnConversationStart().
     
    Last edited: Oct 28, 2014
  27. Enki

    Enki

    Joined:
    Jun 2, 2013
    Posts:
    20
    That is awesome, thanks for the reply!
     
  28. Alic

    Alic

    Joined:
    Aug 6, 2013
    Posts:
    137
    Nothing comes to mind immediately, except that maybe down the line you could move over to it more as the default, with a couple different premade gui styles like you have for the old gui, and one component that doesn't have to override the selector (though setting it up was certainly no big deal.) Maybe a gui theme with basic animation transitions already set up, which could save future users some time? That's the one thing I don't look forward to nowadays with the new GUI, is setting up animatior components over and over again, though once done they can of course look amazing.

    The mention you made of a dialog choice option menu which can handle an arbitrary number of responses would be a pretty cool thing to have out of the box. Maybe also a few themes with continue buttons already implemented in various ways, since while easy to do that is one of the less intuitive things about setting up the dialogue system.

    None of these things are things I still need, I'm just brainstorming about what would make the awesome new UI even more intuitive to use with the extremely awesome dialogue system.

    I'm excited to see that you're working on Cinema Director integration -- I picked it up in the recent sale and have pretty much decided to go with it for my rpg's cutscenes. Your support is so good it almost feels like I have someone else working on my game with me! Thanks Tony.
     
    Last edited: Oct 30, 2014
  29. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    That's what I love about the Asset Store. I feel like I have a whole team working with me. Michal Kolasinski worked on KGFMapSystem for a year. It's like hiring a programmer for an annual salary of $25. :)

    Everything you mentioned regarding the new UI is in the plan, plus the option of using sprites for portrait images. (The Dialogue System still continue to fully support the legacy GUI system even after the new UI becomes the default.)

    Cinema Director support is mostly ready. I'm just working out an issue with prefab cutscenes with the Cinema Suite guys.
     
  30. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Version 1.3.7 is now available on the Unity Asset Store!
     
  31. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    Just tried importing the latest version to a new Unity 5 beta project and having some compile error.

    Any idea on a timeline to support Unity 5?
     
  32. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Unity 5 support, Cinema Director support, and additions for plyGame and Unity UI support should be in the next release, hopefully within two weeks.
     
    schmosef likes this.
  33. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    The next release will include updated support packages for Action-RPG Starter Kit, AI for Mecanim, and Core GameKit. You can download advance copies from the customer download site (PM me your invoice number for access) or right here:

     
  34. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    767
  35. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi! Take a look at Scripts/Supplemental/Utility/QuestTracker.cs. This is a quest tracking HUD written for Unity GUI. It implements these messages, which are sent by the Dialogue System:
    • void OnQuestTrackingEnabled(string questName): Called when the player enables tracking in the quest log window.
    • void OnQuestTrackingDisabled(string questName): Called when the player disables tracking in the quest log window.
    • void UpdateTracker(): Called when quest states or quest entry states change, or after Increment On Destroy. You can also call it manually, even in a conversation or cutscene sequence using SendMessage().
    There currently isn't an equivalent for the new UI system, but it's on the roadmap.

    If you're instead talking about the quest log window, some instructions are here. If any of it is unclear or incomplete, please let me know and I'll expand it.
     
  36. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    767
    Hi Tony, it's indeed that questtracker script I looked at and guested there would have been an update using the new GUI system (as it's code is using the legacy). But ... you just confirmed an update using the new system will be provided in the future. That will be the reason I couldn't find any ;-) I'll leave the questtracking as last part of the GUI then, I still have a lot of work implementing/skinning the other parts first.
     
  37. DieHappyGames

    DieHappyGames

    Joined:
    Feb 24, 2014
    Posts:
    44
    Hey Tony, long time no see. I just wanted to thank you for keeping up the Adventure Creator support. I've been AWOL while trying to learn all the complexities of that kit and though it does a lot very well, it still doesn't come close to what DSU does to streamline dialogue and provide incredible depth through lua implementation. Still the best money I ever spent on the Asset Store. :)
     
  38. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Thanks! I really appreciate the kind words!
     
  39. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Version 1.3.8 is still under development but will include Unity 5 support. Here are some things to note if you plan to upgrade your project to Unity 5:

    • If you have any Triggers (such as Conversation Trigger) set to OnTriggerEnter, you may need to add a Tag or GameObject to its Condition to prevent it from triggering when the scene starts. The new PhysX in Unity 5 reports OnTriggerEnter when scenes start with nested colliders, such as Private Hart in the Feature Demo. His main GameObject has a capsule collider, and a child GameObject named AI has a trigger used for the Dialogue System. In Unity 5, starting a scene in this configuration generates an OnTriggerEnter message.

    • All custom sequencer commands must be in the namespace PixelCrushers.DialogueSystem, PixelCrushers.DialogueSystem.SequencerCommands, or the global namespace.

    • Version 1.3.8 will not support the option to switch to NLua. I'll work on that in a future update.
     
  40. Pauloxande

    Pauloxande

    Joined:
    Feb 8, 2014
    Posts:
    110
    TonyLi Hi, sorry to ask you again but how to make the icon blink when the mission is completed and when completed the icon disappears.
    Did before, but now I'm not getting.
    Can you help me friend
    In the example we have in the package is not changing the icons
     

    Attached Files:

  41. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @Pauloxande, temporarily set the Dialogue Manager's Debug Level to Info and try again. The cutscene sequencer will log commands to the Console. Make sure the Sequence Trigger is actually starting. If it starts, you'll see debug lines like:

    Dialogue System: Sequencer: KGFMapIcon(KGFMapIcon_triangle, Sobreviva !!!)​

    If the Sequence Trigger is not starting, perhaps its Condition is failing.
     
  42. jura_wd

    jura_wd

    Joined:
    Jan 28, 2014
    Posts:
    32
    Hey guys!

    I'm trying to import my articy:draft v2.3.7 xml using your Dialogue System.
    But it's not working, I see only long error message:

    InvalidOperationException: 'ConditionNode' is not a valid value for PixelCrushers.DialogueSystem.Articy.Articy_2_2.TypeOfJourneyPointType.
    System.Xml.Serialization.XmlSerializationReaderInterpreter.GetEnumValue (System.Xml.Serialization.XmlTypeMapping typeMap, System.String val)
    ....

    Looks like you're not supporting latest articy (with 'ConditionNode' stuff).
    Could you tell me, when that will be fixed?

    Thanks
     
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Hi @jura_wd, I'll check this with articy:draft v2.3.7 and get back to you. Please make sure you're using the Dialogue System v1.3.6+. Support for condition nodes was added in v1.3.6. The version is listed in Assets/Dialogue System/_README.txt. Please also feel free to email the XML file to tony (at) pixelcrushers.com. I'll be happy to take a look and make sure it imports properly in the latest version.
     
  44. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    There is a patch on the Pixel Crushers customer download site that resolves an issue importing articy:draft 2 projects with JourneyPoints that contain ConditionNodes or OutcomeNodes. (Thanks to @jura_wd for reporting the issue!) If you're importing articy:draft 2 projects and the importer is failing, please apply this patch. If you need access to the download site, please PM me your Asset Store invoice number.
     
  45. jura_wd

    jura_wd

    Joined:
    Jan 28, 2014
    Posts:
    32
    Awesome support! Really appreciate that!
     
  46. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Happy to help! Nevigo said they'd include a fix for their XML schema in their next bugfix release, so if you're using articy:draft XML elsewhere in your project, keep an eye out for it.
     
  47. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    Several people have asked how to create an interactive tutorial using a Dialogue System conversation. The next release will include an example. You can also download that example right here: Tutorial Example
     
  48. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    767
    Hi Tony,

    I just upgraded to version 4.6 RC1 and notice some error because Unity introduced a breaking changes to the UI Text field.

    Code (CSharp):
    1. Assets/Dialogue System/Scripts/Supplemental/UI/Scripts/Dialogue UI/UnityUITextFieldUI.cs(61,43): error CS1061: Type `UnityEngine.UI.InputField' does not contain a definition for `value' and no extension method `value' of type `UnityEngine.UI.InputField' could be found (are you missing a using directive or an assembly reference?)
    2. Assets/Dialogue System/Scripts/Supplemental/UI/Scripts/Dialogue UI/UnityUITextFieldUI.cs(93,56): error CS1594: Delegate `PixelCrushers.DialogueSystem.AcceptedTextDelegate' has some invalid arguments
    Edit: I replaced the .value by .text and it seems to work perfectly again.
     
  49. Keitaro3660

    Keitaro3660

    Joined:
    May 20, 2014
    Posts:
    86
    hei tony, is this asset support for multiple conversant in 1 conversation?
    i tried to do conversation of 1 player with 2 other actors.
    but it seems the NPC name only recognize 1 NPC character despite i have 3 Actors in that conversation...
    it only change the NPC image, but the NPC name is stick to that conversant name.

    can it be done?
    what should i do?
     
  50. OsefOsef123

    OsefOsef123

    Joined:
    Jun 30, 2013
    Posts:
    3
    Hi @TonyLi, first of all, I want to say a huge thank you for your amazing work on the Dialogue System, it saved me a lot of hours, and is super easy to use, definitely one of the best assets purshased on the Asset Store.

    However, I'm facing a little problem, which I think might be a bug, and I'm sure other people might encounter this problem too... I have a quest state observer that can't seem to be called when I change the quest's state by C# code.
    My observer is added like this:

    Code (CSharp):
    1. QuestLog.AddQuestStateObserver("Debate_0", LuaWatchFrequency.EveryUpdate, OnQuestStateChanged);
    I naturally assumed that the EveryUpdate watch frequency would check the quest state at every Unity update, and execute the callback when the state changes, but when i changed the quest's state, using this:

    Code (CSharp):
    1. QuestLog.SetQuestState("Debate_0", QuestState.Active);
    The OnQuestStateChanged callback is not executed. However, I found out that it is called if the quest's state is changed via a SetQuestStateOnDialogueEvent component, or, and this is the weird part, the above code works and executes the callback, if I have the Dialogue editor window opened on the Watches tab, and I add a watch on the "Debate_0" quest state, with the Auto-update checked.

    I can only assume that the EveryUpdate watch frequency is not really called at every update if you don't set a watch in the editor, which is a problem for me, since it won't work when i build the project.

    I hope the issue is clear here, and anyone who could help me figure this out would be of great help.


    [EDIT]
    After further "investigation" in the source code, I found out that the EveryUpdate watchers were only called if the Lua.WasInvoked property was set to true, which is not the case when you call QuestLog.SetQuestState(), apparently because the Lua code is not run by the Lua class, but by another method in the LuaInterpreter...

    I'm not totally sure about this, but I know that if I add
    Code (CSharp):
    1. Lua.WasInvoked = true;
    after changing the quest state in my code, it solves the problem.
    I don't know if this behaviour was intended or not, but, in any case, it's not very intuitive to have a quest state observer not being called if the quest state is changed by C# instead of Lua.
     
    Last edited: Nov 12, 2014