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,694
    That's valid Lua. Here's the example scene. I also included the updated Invector integration script that's on the Extras page. It allows vRemoveItemByID() to remove multiple items even if they aren't stacked. Previously it only removed multiples from stackable items such as gold; otherwise it would only remove 1.

    The example includes some other small details, so I recommend examining it.
    • I added an Override Display Settings component to the vendor, ticked Show Invalid Entries, and set the display setting for invalid entries. This way objects that are too expensive are shown as inactive buttons.
    • I made a copy of Text Field UI called Number Field UI and set its input type to Integer so the player can only input numbers.
    • The TextInput() command (which uses Number Field UI in this example) records the player's input as text. In a dialogue entry node, I used "tonumber()" to convert it to a number.
     

    Attached Files:

  2. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Thanks @TonyLi :)
     
  3. Frax228

    Frax228

    Joined:
    Jul 19, 2016
    Posts:
    48
    Hi. How to hide the cursor in Invector Support.
     
  4. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Just tick the show cursor setting on the dialogue system trigger on the NPC and when the conversation finishes the cursor will vanish
     
    TonyLi likes this.
  5. Frax228

    Frax228

    Joined:
    Jul 19, 2016
    Posts:
    48
    i need hide cursor in scene. like in all third person game
     
  6. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Inspect the Dialogue Manager. Untick the Input Device Manager's Control Cursor State checkbox.
     
  7. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @TonyLi how can I enable a gameobject from other scene? Example in scene 1, when my current quest state = success then the game object in scene two will be enabled
     
  8. DMRhodes

    DMRhodes

    Joined:
    May 21, 2015
    Posts:
    81
    Afternoon. Just wanted to let you know about a small issue using the new arrange only lassoed nodes feature. :)

    When you laso a specific group of nodes and arrange them, it will also arrange all the unconnected red nodes present in the conversation together with the lassoed ones even if they hadn't been selected. Kind of annoying, but easy enough to work around.

    Thank you for your time. Regards
     
  9. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Let's call the GameObject that you want to activate the target. Add a Persistent Active Data component to an active GameObject in scene 2 (not the target). Assign the target to the component's Target field. Then set the Condition to require that your quest state is success.

    Thanks for reporting that. I'll fix it in the next version.
     
  10. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi
    Hi @TonyLi thanks for the reply. How about in the same scene? For example. If the kill spider quest is success then the gameobject with the level loader script will be activated. I'm thinking of a adding a dialogue system trigger to the level loader gameobject then on the conditions set current quest state = success and add a dialogue event to enable the gameobject. Will that work?
     
  11. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Yes, you can do that. You might configure your spiders like this:

    upload_2019-3-23_21-34-11.png

    When you kill a spider, the Increment On Destroy increments a variable and then runs its Dialogue System Trigger. This trigger checks if the quest is active and the player has killed the required amount. If so, it sets the quest to success and activates the GameObject named Level Loader.

    Set up Level Loader like this:

    upload_2019-3-23_21-35-43.png

    The active parent GameObject (named Objects) has a Persistent Active Data component that activates Level Loader if the quest state is success.
     
  12. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @TonyLi I've tried it but still the gameobject doesn't get active even when I finished the quest even though I followed your setup. Here's the screenshot.
    I also have the increment on destroy component I forget to screenshot it
     

    Attached Files:

    • 1.png
      1.png
      File size:
      265 KB
      Views:
      684
    • 2.png
      2.png
      File size:
      265 KB
      Views:
      655
    • 3.png
      3.png
      File size:
      272.1 KB
      Views:
      638
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Hi @dinaloraven234 - Your GameObject is named "Tavern", so change the SetActive() command to:

    SetActive(Tavern)

    Alternatively, since it's in the same scene, you can add an OnExecute() Event instead of a Play Sequence, and hook it up in the inspector:

    upload_2019-3-24_10-25-59.png
     
  14. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi
    Hi @TonyLi I've encountered another bug. At first when I buy from the shop its running smoothly. No errors whatsoever. But when I go to a new scene(for example the tavern) then go back outside(the first scene where the shop is located at) then when I talk to the vendor I got an error: tried to invoke non value function ...... It seems the vgetitemcount gets deleted and dialogue system is checking for the Lua vgetitemcount. How to fix it?
     
  15. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Did you untick Use Instance on the player in both scenes? Here are some things to check:
    • Untick Use Instance on the player in both scenes.
    • Add a Dialogue System Invector Bridge to the player in both scenes.
    • Change scenes using the LoadLevel() sequencer command, or a Scene Portal component, or SaveSystem.LoadScene() or SaveSystemMethods.LoadScene().
     
  16. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @TonyLi thanks for your reply but my plan is I only have one player that goes through every scene and not setup the player for every scene. And also saves what the player have in his inventory in scene 1 carries through all the scenes. How to setup that?
     
  17. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    I'll see if I can expand the integration to handle that case.
     
  18. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
  19. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @TonyLi how's the expansion of the integration going? If its a hussle I'll just setup the player for every scene but how can I make the inventory items carry over to the other scenes? For example if I have 50 gold in scene 1 and acquired a sword, when I go to scene 2 or any other scenes the gold and that sword is still there as well as when I acquire a sword in scene 2 then go to scene 1 or any other scene the sword will still be in my inventory.
     
  20. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Hi @dinaloraven234 - It'll take a couple of days. If you want to turn off Use Instance, this is how it works: When you leave scene 1, the scene 1 player's Invector Inventory Saver records that the player's inventory has 50 gold and a sword. Then the Save System loads scene 2. When scene 2 is loaded, the scene 2 player's Invector Inventory Saver applies the recorded inventory (50 gold and a sword). (To save the player's stats, also add an Invector Stats Saver.)
     
  21. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Thanks for the tip mate! But I think there's a bug in the save system. The save and load works perfectly fine but when I use the clear saved game then click the load game the game goes back to the last time I save the game
     
  22. DMRhodes

    DMRhodes

    Joined:
    May 21, 2015
    Posts:
    81
    Hi, me again. I have another couple feature requests to throw into the mix for your future consideration if that's okay. Both regarding the lua wizard.

    1- In the script field Lua wizard when changing a Dialogue System number variable, one has the options of 'To' and 'Add'. Would it be possible to add a 'Minus' function for when one wants to lower a dialogue system variable please? Currently I circumvent this by selecting 'add' and just replacing the plus with a minus which works, but it would be great to save a click or two in the long run. :)




    2- Secondly, if you ever consider overhauling the wizard. A somewhat deeper functionality would be neat. For example allowing one to apply changes to Variable (A) using Variable (B) as seen in the lower script of the following example where the damage variable is subtracted from the enemy's HP.



    I hope you will consider it. Thank you for your time as always, regards
     
    Last edited: Mar 26, 2019
  23. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    How are you clearing saved games? Like this?

    upload_2019-3-26_13-16-10.png

    I'll add it in the next update!

    I will certainly consider it. I try to balance options and simplicity. In this case I think it won't add any extra complexity. PlayMaker does a similar thing, where you can specify a literal value or a variable.
     
    DMRhodes likes this.
  24. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    I'm clearing saved games using the demo menu
     
  25. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    The DemoMenu script is primarily just for the Dialogue System's demo. But here's a version that will work in the general case for your project, too. (Alternatively, you can use SaveSystemTestMenu.)
     

    Attached Files:

  26. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Thanks bro!
     
  27. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @TonyLi its me again. I dont know if something is wrong with my setup but the invector inventory saver doesnt work for me. When I drop gold or buy something from the shop (for example I drop 15 gold so my current gold in the inventory is 85) when I go to the scene tavern and open my inventory the gold reset backs to 100(starting money) I also used the load level command instead of vloadlevel and the gold still goes to 100 when I go to the tavern scene or any scene. And also when I use the load level command the persistent active data won't activate the disabled game object in my tavern scene even when the quest condition is fulfilled but when I use the vloadlevel by invector the persistent active data works fine
     
  28. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    There are a couple of setup steps in the manual that you might have missed. Please check these:

    1. Make sure your Dialogue Manager has these components: Save System, Dialogue System Saver, Json Data Serializer, and PlayerPrefs Saved Game Data Storer. (You can change to a different data storer later. PlayerPrefs makes it easy to test.)

    2. Add the Scripting Define Symbol USE_INVECTOR_INVENTORY. (This is probably already done; otherwise vGetItemCount() etc. wouldn't work.)

    3. If you have more than one Saver on the player GameObject, give each one a unique Key. And tick Save Across Scene Changes. Example:

    upload_2019-3-27_15-59-24.png

    For each Saver, make sure the Key is the same on all player GameObjects in all scenes. For example, the Invector Inventory Saver > Key could be "PlayerInventory" on all player GameObjects in all scenes.
     
  29. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Play Mask of Semblance at PAX East!

    Going to PAX East? (First of all, I'm jealous. ;) Have fun!) Visit Red Essence Games at Booth #21087 and play the latest demo of Mask of Semblance, which makes great use of the Dialogue System:



    Not attending PAX East? You can follow Mask of Semblance on GameJolt.
     
  30. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi thanks for the response. I haven't checked the save across scene changes so maybe thats causing my problem.
     
  31. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    If you get totally stuck, you're always welcome to send a reproduction project to tony (at) pixelcrushers.com. I'll be happy to take a look.
     
  32. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @TonyLi the invector inventory saver works now but I have a problem. Items or weapons I acquired or bought carries to other scenes but for example when I buy 4 health potions and my gold is 15 when I go to the new scene the gold value resets to 1 and also the health potions resets to 1. I followed all your instructions above added all components in the dialogue manager, added the invector inventory saver and stats saver and used the load level(tavern, spawn point tavern) sequence but still when I enter a new scene the number of items for that specific object( example the health potion) the value resets to 1
     
  33. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Hi @dinaloraven234 - What version of Invector are you using? And is EviLA's RPG Pack still in your project?
     
  34. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    My version of invector that im using is 1.2.3 I don't wanna update it as my FSM ai template isnt updated and might cause error when I update it to 1.3 and yes evilas RPG pack is still here but I'm using the shooter item list data
     
  35. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Thanks! I'll dig up a copy of 1.2.3, test it, and send you an example scene if possible.
     
  36. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Thanks @TonyLi if you can't find a copy I'll send you mine via mediafire or googledrive
     
  37. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Thanks but no need. I have a copy of 1.2.3 and I'll set it up later today.
     
  38. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Play Last Epoch at PAX East!

    At PAX? Visit the Eleventh Hour Games team and play the latest build of Last Epoch, made with the Dialogue System, and what's been called "the next great fantasy ARPG."

     
  39. DMRhodes

    DMRhodes

    Joined:
    May 21, 2015
    Posts:
    81
    Hello, I'm having a small issue with Start nodes if you have a moment please.

    Given the way I've built things up so far, there is a lot of linking between many multiple conversations in my dialogue. Most of the time these link to the Start node specifically in the next conversation. However when progressing from one conversation over to the next one, the Start node seems to create a single blank response button that one has to click on to move the conversation forward to it's intended progression.

    Ideally I would like the Start nodes to just be ignored entirely and for the conversation to flow over them into the next node. I tried both None() and Continue() sequencer commands but neither seemed to alleviate the issue. Would appreciate any input.

    Thank you for your time, regards
     
  40. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Hi @Candy-Bomber - Try changing the START node's Actor to the NPC. (A quick way to swap actors is to click the up/down button next to the actor dropdowns.) For various obscure reasons, this will probably fix it for you.
     
    DMRhodes likes this.
  41. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @TonyLi how's the example scene going? Im not rushing you andnim grateful for your excellent customer support :)
     
  42. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    It'll be later today, but as soon as I can.
     
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    @dinaloraven234 - Looks like it needed a little tweak for 1.2.3. This package has two example scenes and an update to InvectorInventorySaver.cs that works with 1.2.3 and 1.3.0. The update will also be in the next release. Looking at the way Invector does instances, it's not going to be practical to support Use Instance without requiring manual edits to Invector's source code, so you'll have to continue keeping Use Instance unticked.

    Add the two scenes "Vendor Save Load Scene 1" and "Vendor Save Load Scene 2" to your build settings. Then play "Vendor Save Load Scene 1". There's a vendor to the right and a portal to the left. In scene 2, there's a shotgun straight ahead.

    EDIT: Sorry, I just realized I tested the scenes in 1.3.0 and exported from there. If it doesn't work in your project, let me know and I'll export it from 1.2.3. I think it should still work.
     

    Attached Files:

  44. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Thanks I'll try it right now
     
  45. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Updated uMMORPG Addon Available

    The Dialogue System Extras page has an updated addon package for uMMORPG 1.165, which just released today with a breaking API change.
     
    Weblox likes this.
  46. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @TonyLi I just want to say thank you. Its fully working now with! Thanks again :). When I'm finish with my project I'll give credits to you for helping me and not tired of answering all of my questions. God bless you :)
     
    hopeful and TonyLi like this.
  47. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
  48. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @TonyLi its me again regarding the enabling and disabling objects, I have a persistent active data on a game object call tavernloaderparent and its child is the tavern loader with the scene portal script. I have set the condition on the persistent active data to quest skeleton extermination success to activate it but it does not work. Its on the same scene where I accept to start the quest but the enemies that are required to kill is on the other scene(dungeon). But if I accept and finished a quest on the main town scene, my test object on the tavern scene with the persistent active data works fine. But if I accept a quest on the main town scene, killed the enemies on the dungeon scene then goes back to the main town scene and finished the quest, the tavern loader doesn't activate.
     
  49. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    When you go to the dungeon and return to town, is the quest state still successful? There are a few ways to check it:
    • In-game, check the quest HUD and/or quest log window.
    • Or add a Lua Console component to the Dialogue Manager. In-game, press ~+L to open the Lua Console. Enter return CurrentQuestState("quest") where quest is the name of your quest.
    • Or go to the Dialogue Editor's Watches tab, select Menu > Add Quest, and choose the quest.
    Also make sure your Dialogue Manager has a Dialogue System Saver component.
     
  50. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi after I finished the quest, I check the game object with the persistent active data it always shows (last checked: false) I also checked it in the quest HUD and its in the completed quest. Here are the screenshots
     
    Last edited: Mar 29, 2019