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,697
    Hi @Stickeyd - Is Portrait Image 1's Image component > Color set to red? It looks like the animation is just animating the Color's alpha value (fade in/out), but since the Color is set to red, it fades in/out the red-tinted image.

    I'm assuming your characters have Dialogue Actor components with Portrait Animator Controllers. When the character appears in a subtitle panel, the Dialogue System will assign its Portrait Animator Controller to the portrait image's Animator component. The Animator will then immediately start playing the Portrait Animator Controller's default state. Consider making a default idle state that doesn't animate the alpha, and set it as the default state.

    Side note: This is just an aesthetic note. Try animating the red/green/blue color values from 0 to 255 instead of the alpha value. It will darken the image instead of making it transparent. You might prefer the effect.
     
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Add a Dialogue System Corgi Event Listener component to the Dialogue Manager GameObject.

    If you're using Corgi's save system, you do not need to use Inventory Engine Saver. You can set up Corgi to save inventories. See the Corgi / Inventory Engine documentation.

    Use MMSaveLoadManager to save and load games.

    The setup is different in this case:
    Add these components to the Dialogue Manager GameObject:
    • Dialogue System Saver
    • Save System: UNtick Save Current Scene. Set Frames To Wait Before Apply Data to 1.
    • Json Data Serializer
    • PlayerPrefs Saved Game Data Storer (not used in this case, but silences a warning)
    Identify inventories that you want to save. These inventory GameObjects should have Inventory components. Add an Inventory Engine Saver component. Set a unique key for each inventory such as "mainInventory", "foodInventory", etc.

    On the player prefab, add a Position Saver component. Set a unique key such as "playerPosition".

    Use the SaveSystem class or SaveSystemMethods to save and load games.
     
  3. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    In playmode the color becomes red for some reason(only when this animation is running) But in editor the color is not red. This is the issue. Look. Here is the color. https://gyazo.com/1ffb9224bc9b60d6a4bb7d4db96fddbb
     
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Then it's probably either the animation clip or a custom script.

    Make sure the correct animation clip is assigned to the animator controller, and that the correct animator controller is assigned to the character's Dialogue Actor component. Also, inspect the animation clip and untick Loop.

    If that doesn't resolve the issue, look for custom scripts on your Dialogue Manager, dialogue UI, and character.

    Also feel free to send a reproduction project to tony (at) pixelcrushers.com if you'd like me to look at it directly.
     
  5. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    I solved all of these issues. I actually had a focus animator component at the subtitle panel and it stopped working when I was renaming the portrait images, as it seems that the parent animator was hard-wired to work only with this certain portrait image name.

    However, I seem to not be able to smoothly darken the color for the posture change because it gets overwritten by focus animation(which too darkens and whitens the color a bit) so the animation on the portrait image does nothing with the color.

    Can't change the alpha for the same reason. The color changing is being busy with focus animator

    UPD: Another issue that I just found out is that if I change the name of the portrait image that is set on the Focus Animation Controller animations, so that it works with the new Portrait Image 1, it changes it for all the panels and if I will have different names for them it obviously will break everything. So I... need to create 6 different Focus Animation Controllers for all of my dialogue panels and set different names in them?
     
    Last edited: Jan 25, 2022
  6. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @Stickeyd - Can you modify your panel's Focus Animation Controller to leave the portrait image alone? This way, (1) it will allow the character's portrait animator to control the portrait image, and (2) you won't have to make separate animator controllers.
     
  7. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    I don't think so... I think we together with you changed it to be that way a long time ago for some reason. Regardless, I just created 6 animation controllers and 12 animation clips and it's alright. Working well now. Even though I have to change alpha and not the black /white color. But it's okay for me that way.
     
  8. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    Another issue im having:

    I have 4 different emotion sprites. Default one is 1.

    So if I have animation clip that changing the sprite to 2, I have to set a default sprite in the animation clip as because otherwise it makes the image empty. The animation clips in unity work in such a way that they need to have a input data, they don't work with consideration what sprite is already in the image.

    So if I have the animation clip, I have to set 1 as the sprite and then animation changes it from 1 to 2. But then, when I change it to 2, I need to change it to 3 sometimes. The issue is that if I try to do so it first sets the image to sprite 1 and only then to 3. But I want it to change right from 2 to 3.

    And there seems to be no way around it except making animation clips for all the possible combinations. Like:

    1 ->2
    1->3
    1->4
    2->1
    2->3
    2->4
    3->1
    3->2
    ...
    you get the idea.

    This is the same in Unity when you try to animate position. You can't just change a position from the point where your object already is. You have to basically record animation from default position and then when you start the animation it teleports your object to the default position.
     
    Last edited: Jan 26, 2022
  9. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @Stickeyd - Do you have 6 different subtitle panels in 6 different positions? If so, then your solution for 6 animator controllers is fine.

    If you only have 2 subtitle panel positions (left and right), then you only need two subtitle panels and two animator controllers. Each character's Dialogue Actor component will assign its animator controller to the subtitle panel's portrait image. For example, if all NPCs use subtitle panel 0, you don't need to create a separate subtitle panel for each NPC. Configure every NPC's animator controller to animate subtitle panel 0's portrait image. Then assign the NPC's animator controller to its Dialogue Actor component. When that NPC speaks, it will assign its animator controller to the portrait image.

    For the different emotions, I have two suggestions:

    1. The cross-fade example scene ("Animated Change Pose Example") in one of my previous posts uses two images: Portrait Image 0 and Crossfade Image. The animation clip "Mustafa Idle To Drama" does these things:
    • Sets Portrait Image 0 to the Drama sprite
    • Sets Crossfade Image to the Idle sprite
    • Fades in Portrait Image 0 while fading out Crossfade Image
    A dialogue entry node plays this animation using this Sequence:

    AnimatorPlay(Idle To Drama, Portrait Image 0)

    You could split those into three different animation clips:
    • Animation 1 - Drama: Set Portrait Image 0 to Drama
    • Animation 2 - Crossfade Idle: Set Crossfade Image to Idle
    • Animation 3 - Crossfade: Fade in Portrait Image 0 while fading out Crossfade Image
    Then use a Sequence like this:

    AnimatorPlay(Drama, Portrait Image 0);
    AnimatorPlay(Crossfade Idle, Portrait Image 0);
    AnimatorPlay(Crossfade, Portrait Image 0)

    This way you only need animation clips to set an individual image. You don't have to make separate animation clips for all of the permutations.


    2. Alternatively, you could write a custom sequencer command to bypass all of this and manage the portrait images and cross-fades yourself.
     
  10. _eternal

    _eternal

    Joined:
    Nov 25, 2014
    Posts:
    304
    Hey, quick question. Can Dialogue System import and manage txt files?

    I've fiddled with a few different dialogue systems and text editors in the past few days. I realized that I prefer to write in a traditional text editor (I'm currently using Scrivener) rather than a node-based editor. I don't have many branches, but I do have some longer passages of text, especially during cutscenes. It's easier for me to just write linearly in another window and treat it like a novel.

    I know that Dialogue System can work with Ink and YarnSpinner, but I was wondering if it's possible to import regular txt files and use that as content for a node. Alternatively, I was wondering if you could edit Dialogue System's native files in an external text editor.

    Basically, I'd like to use Dialogue System to help with branching and calling external methods from text (instead of having to parse plain text... very error-prone). But I also don't want to give up my writing workflow outside of Unity.
     
  11. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @_eternal - Yes, it can import linear conversations in Excel format (info) and branching conversations using a simple format called JLC (info). The full list of import formats is here.

    Technically you can edit the Dialogue System's native files in a text editor, but it contains a lot of structured data so it wouldn't be practical.

    For plain text, consider formatting your text files in JLC format and importing that.

    Alternatively, you could drop your text into Celtx and import that. (info)
     
    _eternal likes this.
  12. wechat_os_Qy0z_aF7Nfhquhava38GLxUWU

    wechat_os_Qy0z_aF7Nfhquhava38GLxUWU

    Joined:
    Dec 22, 2021
    Posts:
    56
    Hi,Tony.
    I bought Easy Main Menu yesterday!
    If everything is fine without coding!
    Easy Main Menu can save Dialogue System Data.And Dialogue System can save Inventory Engine Data.
    Is that possible? Am I right?Is it feasible?:rolleyes:
     
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi - Yes, that's possible. Make sure to follow the Dialogue System - Easy Main Menu integration steps.

    Side note: For those who don't have or prefer not to use Easy Main Menu, the Dialogue System Extras page has a free Menu Framework addon.
     
  14. wechat_os_Qy0z_aF7Nfhquhava38GLxUWU

    wechat_os_Qy0z_aF7Nfhquhava38GLxUWU

    Joined:
    Dec 22, 2021
    Posts:
    56
  15. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Now We're Talking Integration

    The Dialogue System for Unity now has integration with Chatterware's Now We're Talking!



    Now We're Talking is an easy way to add lipsync animation to character models that don't have mouths, such as Synty's excellent polygon characters.

    For characters with mouths, the Dialogue System has integration with SALSA LipSync Suite, FaceFX, and more.
     
  16. MonstaManly

    MonstaManly

    Joined:
    Apr 18, 2020
    Posts:
    11
    Hey, I was wondering if I could get some help with these two problems as I am kind of a novice with this asset.

    I have added a UI key button trigger (E) to my continue button as to eliminate the possibility of accidently pressing a dialogue choice when continuing, but the select button (F) still triggers the continue button and the E button the dialogue choices... I was wondering if there was a way around this so that only the E key triggers a continue.

    I also added the scroll wheel navigation script to my response menu due to the fact that the character can move during conversations, but unfortunately the directional buttons still control the response menu navigation as well as the scroll wheel. I was wondering if there was a way to disable this from happening so that only the scroll wheel works for response menu navigation when using keyboard and mouse. ( P.S. Is there a way to do this without effecting controller input when I get around to setting that up?)
     
    Last edited: Jan 29, 2022
  17. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @MonstaManly - The Dialogue System's Standard Dialogue UI system uses plain old Unity UI EventSystem input. (The Dialogue System doesn't require you to use the Standard Dialogue UI system and Unity UI -- it's UI system independent -- but you probably want all the functionality that Unity UI provides.)

    The UI Button Key Trigger component is a supplemental component that maps a hotkey to a button. When you press the hotkey, it acts as if you clicked the button. It doesn't replace any Unity UI EventSystem functionality; it just adds the hotkey.

    By default, the Unity UI EventSystem lets you navigate UI buttons using Vertical and Horizontal inputs (e.g., WASD, arrow keys, etc.) and click buttons using the Submit input (e.g., Enter or Space -- or, it sounds like in your case, [F]).

    Here are some notes that should help your setup:
    • The Standard Dialogue UI > response menu component has a Block Input Duration value. You can set this to a non-zero value such as 0.5 seconds to prevent the player from accidentally clicking a response button if they're mashing Submit to get past subtitles. This way you don't have to use separate [E] and [F] keys.

    • If you want to navigate UIs only with the scroll wheel, you can set the EventSystem's Vertical Axis to read from the scroll wheel. If you're using Unity's built-in input manager, set Vertical Axis to Mouse ScrollWheel. If you're using the Input System package, set it to UI/Scroll Wheel. If you only want to change the EventSystem's behavior to use the scroll wheel during conversations, add a script to the Dialogue Manager that has OnConversationStart and OnConversationEnd script methods. In OnConversationStart, set the EventSystem's Vertical Axis to the scroll wheel. In OnConversationEnd, set it back to its original value. You might also want to use this script to conditionally set the Vertical Axis to the scroll wheel only if the player is using keyboard+mouse. To know if the player is using key+mouse, check PixelCrushers.InputDeviceManager.deviceUsesCursor.
     
    MonstaManly likes this.
  18. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    Hey! Can I decrease
    @{{end}} time somehow? Happens too late for me.
     
  19. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Yes. It's based on the text length and the values of the Dialogue Manager's Display Settings > Subtitle Settings > Subtitle Chars Per Second and Min Subtitle Seconds.

    For example, if the text is 120 character and Subtitle Chars Per Second is 30, then {{end}} will be (120 / 30) = 4 seconds.

    However, if Min Subtitle Seconds is higher than this value, such as 5, then {{end}} will be 5.
     
  20. SI_007

    SI_007

    Joined:
    Aug 10, 2015
    Posts:
    84
    Hi Tony,

    I have noticed that the DS Salsa integration requires that the audiosource be located on the same gameobject as Salsa. This is puzzling to me because, since Salsa is located at the root of the gameobject, this means that the source of the audio would not be coming from the mouth (or head) of a character but from the ground.

    I wonder, wouldn't it be better to used Salsa's referenced parameter for the audiosource? Or if this is not possible, to use a script which makes it possible for the developer to specify the location of the audiosource (like Salsa)?

    Thanks!
    Pascal

    reference: https://www.pixelcrushers.com/dialogue_system/manual2x/html/salsa.html
     
  21. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    That line in the manual is a little outdated. It'll be gone in version 2.2.25's manual update. The SALSA integration in 2.2.25 will also locate the SALSA audio source more robustly, but in the current version the audio source can still be on a child object.
     
  22. SI_007

    SI_007

    Joined:
    Aug 10, 2015
    Posts:
    84
    Hi Tony,

    That's great to hear! I did try to use the current version (keeping my Salsa audio source located on the mouth child object), but I believe it failed to work as expected due to the presence of the mandatory EmeraldAI audio source on the root gameobject.

    There's no rush, and once your package is updated, I will gladly test it again with the audio source located on the mouth of the child object.

    Thanks again!
    Pascal
     
  23. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Here's an advance copy to try if you want it to work right now.
     

    Attached Files:

  24. Frax228

    Frax228

    Joined:
    Jul 19, 2016
    Posts:
    48
    Hi
    how to setup this asset with my own input system
     
  25. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @Frax228 - What do you mean by your own input system? Do you mean a replacement to Unity's input manager?

    The Dialogue System has built-in support for Unity's built-in input manager, Rewired, and the Input System package.

    If you're using another input system, you can assign replacement methods to InputDeviceManager.GetButtonDown, GetButtonUp, and GetAxis. (InputDeviceManager API)
     
  26. Frax228

    Frax228

    Joined:
    Jul 19, 2016
    Posts:
    48
    yes, I misunderstood. i used Input System package. i should have uncheck Detect Mouse Control
     
  27. MonstaManly

    MonstaManly

    Joined:
    Apr 18, 2020
    Posts:
    11
    I wanted to say thank you for your help your a lifesaver!!!
     
    TonyLi likes this.
  28. SI_007

    SI_007

    Joined:
    Aug 10, 2015
    Posts:
    84

    Hi Tony,

    I have imported your updated package, but I cannot locate the correct script to be used with RT-voice's speaker script and Salsa.

    I did notice that there was TextSync support for Salsa, and actually tried it as a test. The lips were moving but since TextSync does not do TTS, it resulted in out of sync lip-sync.

    Perhaps a dedicated script is needed for the use of RT-Voice with Salsa and Dialogue System?

    Thanks!
    Pascal
     
  29. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi Pascal - Since you're using text-to-speech audio, don't use TextSync. TextSync is used to animate a character's mouth when there is no audio.

    The character should have an RTVoiceActor component. It will make RT-Voice play TTS for the dialogue text.

    DS version 2.2.25 has a slight improvement to RTVoiceActor in that it will monitor the SALSA component's audio source to know when the TTS is done. The current version uses the first audio source it finds in the character's hierarchy, which could be the wrong one if your character has multiple audio sources. If you've added an RTVoiceActor component to your character and it's still not working but suspect that's the issue, let me know and I'll send you the updated RTVoice Support package.
     
  30. SI_007

    SI_007

    Joined:
    Aug 10, 2015
    Posts:
    84
    Hi Tony,

    Thank you for the explanation. Indeed, my character has the RTVoiceActor script and the first audio source that it find is most likely that of the EmeraldAI audio source located at the root of the character, instead of the one that is used by RTVoice & Salsa (child gameobject). I would gladly test your updated version of your support package.

    Thanks!
    Pascal
     
  31. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    I just PM'ed it to you.
     
  32. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Dialogue System 2.2.25 Released

    Version 2.2.25 is now available on the Asset Store!

    Release Notes:

    Core:
    • Improved: Added Reposition Window button to dialogue database inspector.
    • Improved: Added C# hooks to add custom drawing methods to Dialgoue Editor inspector views.
    • Improved: Added DialogueManager.StopAllConversations().
    • Improved: Localization Export/Import now has improvments to Use Field option.
    • Improved: Added Wait For End Of Frame checkbox to Dialogue System Events > OnConversationEnd() event.
    • Improved: Conversation Control component now has StopSkipAll() & checkboxes to control when SkipAll() is turned off.
    • Improved: TextMeshProTypewriterEffect now calls virtual method PauseForDuration on pause codes.
    • Improved: Better handling of SequencerShortcuts registered subjects.
    • Fixed: On subsequent menus, response menu auto focus selects first button instead of most recently-selected button.
    • Fixed: Dialogue database Actor/Quest/Item/Location field names with '.' are now translated to '_' in Lua.
    • Fixed: Save data sanitizes '\ '.
    • Fixed: Visual field overlap in Timeline ContinueConversationClip.
    Third Party Support:
    • Adventure Creator:
      • RememberDialogueSystem now has Stop Conversations When Loading checkbox
      • 'Actor is player?' to Conversation action to use current player without needing a design-time reference
      • Dialogue entry picker gracefully handles internal ID conflicts in conversations.
    • Celtx: Improved importing of [COND] and [SCRIPT] objects; fixed importing of some types of decision nodes.
    • Corgi: MMSaveLoadManager event listener now uses SaveSystem if present.
    • i2 Localization: Now supports multiple text tables, term options for text tables.
    • Ink: Fixed issue when resuming a stopped conversation at a point where there are only player choices.
    • Invector: Updated bridge to pause player using new Invector methods; improved character disabling using SetLockInput.
    • Inventory Engine: MMSaveLoadManager event listener now uses SaveSystem if present.
    • RT-Voice: RTVoiceActor now allows unspecified gender and incomplete matches of voice name.
    • Twine: Fixed import of inline conditional text.
     
  33. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Ova Magica Nominated For Big-K Kickstarter Game Community Award

    ClaudiaTheDev's Ova Magica, a Pokemon-meets-Stardew Valley style game made with the Dialogue System for Unity, is up for Kickstarter's Big-K Game Community Award. If you're a follower of Ova Magica's development, consider giving the game a vote.

    upload_2022-2-8_13-41-43.png

     
  34. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Game Developer Interview with Near-Mage Devs

    Game Developer just published a great interview with Stuck In Attack about the huge Kickstarter success of their game Near-Mage, which is being made with the Dialogue System for Unity. If you're considering a crowdfunding campaign for your Dialogue System-powered game, it's a useful and interesting read.

     
  35. nichjaim

    nichjaim

    Joined:
    Apr 23, 2020
    Posts:
    46
    it's fine if there's not but was just wondering if there's some kind of conversation prefab variant type system. Many of my conversations have a very similar structure and was just wondering if I could make some template/root conversation that could be derived from. Again, it's not a big deal if there isn't just thought I'd ask.
     
  36. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi - You could create a template conversation and then duplicate it whenever you need to make a conversation with a similar structure. To duplicate a conversation, open the conversation in the Dialogue Editor, right-click on the canvas, and select Duplicate Conversation, or select Menu > Duplicate Conversation.
     
  37. wechat_os_Qy0z_aF7Nfhquhava38GLxUWU

    wechat_os_Qy0z_aF7Nfhquhava38GLxUWU

    Joined:
    Dec 22, 2021
    Posts:
    56
    Hi, Tony im stucking at a Pause state settings by using Menu Framework with Corgi Engine now.
    The problem is: two Pause functions are conflicting with each other.
    I tried a lot of ways to solve it but not clean.I removed Corgi CharacterPause compoent and set Pause.SetTimeScale to 0 when i need to pause.It works with ememy and chatacter movement. But when character had a loaded ammo gun be able to use mouse aim. The gun shoot once when i click any frist button at pause panel.It means i didnt pause all the things.Is there have a function like corgi engine s pause?
     
  38. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi - When you open the Menu Framework's PauseMenu, call:

    MoreMountains.CorgiEngine.GameManager.Instance.Pause();

    When you close the Menu Framework's Pause Menu, call GameManager.Instance.Unpause(). You can disable the line of code in the Menu Framework that sets Time.timeScale to 0.
     
  39. wechat_os_Qy0z_aF7Nfhquhava38GLxUWU

    wechat_os_Qy0z_aF7Nfhquhava38GLxUWU

    Joined:
    Dec 22, 2021
    Posts:
    56
    Thanks for mention.It means i have to put this “MoreMountains.CorgiEngine.GameManager.Instance.Pause();”to a script?
     
  40. wechat_os_Qy0z_aF7Nfhquhava38GLxUWU

    wechat_os_Qy0z_aF7Nfhquhava38GLxUWU

    Joined:
    Dec 22, 2021
    Posts:
    56
    Thanks again i will try this:)
     

    Attached Files:

    TonyLi likes this.
  41. wechat_os_Qy0z_aF7Nfhquhava38GLxUWU

    wechat_os_Qy0z_aF7Nfhquhava38GLxUWU

    Joined:
    Dec 22, 2021
    Posts:
    56
    Hi i tried and seems like Corgi Engine still control Pause function.Still have some problems when use keyboard ESC.
    1.When i press keyboard button ESC the Pause Panel come up and game paused.Press keyboard button ESC the Pause Panel closed and game unpause (So far it works good)But when i use mouse click resume button the game still paused.So it means ESC controls the pause function.
    2.When i close a 2rd ui panel at pause state (for example like load game or options)by using keyboard ESC.The game will unpause but still had a pause panel exist.If keep press ESC to close pause panel the game will pause…

    Another question is about save system.
    Save system works well with save/load inventory and character position.I read the documents but I don’t know how to save character prefabs.I know Corgi had character persistence to store the whole character.But this character persistence component is too strong. Even I restart/load game it still persistence.So how to use save system to save Corgi Engines character prefabs (like health body parts etc.)?
     
  42. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Try this instead to disable Corgi's pause:

    Code (csharp):
    1. FindObjectOfType<CharacterPause>().enabled = false;
    To only save what you want to save, write a saver component.
     
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
  44. kitsune9000

    kitsune9000

    Joined:
    Aug 15, 2015
    Posts:
    42
    I see this works with ORK. Does it automatically work with the ORK 3 framework as well? @TonyLi
     
  45. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    DS version 2.2.25's ORK Support package is for ORK 2. ORK 3 and Makinom 2 integration should be ready before the end of the week.
     
    kdgalla and kitsune9000 like this.
  46. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    ORK Framework 3 and Makinom 2 Integration

    Updated integrations for Gaming Is Love's ORK Framework 3 and Makinom 2 are now available. Details here.

    The updated integrations will also be in the upcoming Dialogue System version 2.2.26.
     
    kdgalla likes this.
  47. TheClap007

    TheClap007

    Joined:
    Jun 2, 2013
    Posts:
    3
    Hello, I'm trying to figure out how to use this with unity's visual scripting. On certain conversations I want to trigger a custom event inside my script machine and pass an int argument.
     
  48. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi - I haven't yet looked at Unity's visual scripting package apart from writing the Dialogue System integration for the original Bolt visual scripting (details), but I think you should be able to use a scene event.
     
  49. TheClap007

    TheClap007

    Joined:
    Jun 2, 2013
    Posts:
    3
    How do I pass an int with this?

    Okay so I worked around passing an int by setting it in the dialogue manager database to which my script machine can read it from there. My problem now is trying to get certain conversations to trigger an event inside my script machine. The docs said there use to be bolt lua functions that triggered bolt custom events which would be perfect for my case but it's no longer available for unity's visual scripting. And I'm not seeing how the above mentioned scene event can do that.
     
    Last edited: Mar 9, 2022
  50. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    I just added a Visual Scripting integration package to the Dialogue System Extras page. It will also be in the upcoming version 2.2.26.

    Add a Dialogue System Visual Scripting Lua component to the Dialogue Manager. In your conversation node's Script field, use a vsEventInt() function. (See the example at the bottom of the documentation below.) You can select it from the Script's "..." dropdown menu in the Custom > VS submenu so you don't have to type it.

    Documentation here:
    This page explains how to use Unity's Visual Scripting package with the Dialogue System.

    How to Set Up Visual Scripting Support
    • Import the package Third Party Support ► Visual Scripting Support. This will unpack files into the folder Assets ► Pixel Crushers ► Dialogue System ► Third Party Support ► Visual Scripting Support.
    • Then select Edit → Project Settings → Visual Scripting → Node Library → Regenerate Nodes.
    • If you want a Script Machine to react to Dialogue System event messages such as OnConversationStart, add a Dialogue System Visual Scripting Custom Events component. This will invoke Dialogue System messages as Visual Scripting Custom Events. For details, see Dialogue System Visual Scripting Custom Events below.
    • If you want to invoke Visual Scripting Custom Events from inside conversations, add a Dialogue System Visual Scripting Lua component to the Dialogue Manager. For details, see Visual Scripting Lua Functions below.

    Dialogue System Visual Scripting Custom Events
    Add a Dialogue System Visual Scripting Custom Events component to GameObject(s) that receive Dialogue System events (see Script Messages & Events) and for which you want to direct those events to Visual Scripting Custom Events. The component can redirect these events:

    Code (text):
    1. Event                        | Argument   | When It Occurs
    2. -----------------------------|------------|---------------
    3. <b>Conversation Events</b>   | ---        | <b>Conversation-related events.</b>
    4. OnConversationStart          | Transform  | When a conversation starts.
    5. OnConversationEnd            | Transform  | When a conversation ends.
    6. OnConversationCancelled      | Transform  | When a conversation is cancelled.
    7. OnConversationLine           | Subtitle   | Just before a conversation shows a line of dialogue.
    8. OnConversationLineEnd        | Subtitle   | When a conversation line ends.
    9. OnConversationLineCancelled  | Subtitle   | When a conversation line is cancelled.
    10. OnConversationResponseMenu   | Response[] | Just before a conversation response menu appears.
    11. OnConversationTimeout        | (none)     | When a conversation times out.
    12. OnLinkedConversationStart    | Transform  | When a conversation crosses a cross-conversation link.
    13. <b>Bark Events</b>           | ---        | <b>Bark start, end, and line events.</b>
    14. OnBarkStart                  | Transform  | When a bark starts.
    15. OnBarkEnd                    | Transform  | When a bark ends.
    16. OnBarkLine                   | Subtitle   | Invoked just before showing a bark.
    17. <b>Sequence Events</b>       | ---        | <b>Sequence start and end events.</b>
    18. OnSequenceStart              | Transform  | When a sequence starts (except conversation sequences).
    19. OnSequenceEnd                | Transform  | When a sequence ends.
    20. <b>Quest Events</b>          | ---        | <b>Quest state change events.</b>
    21. OnQuestStateChange           | string     | When a quest or quest entry state has changed. (Argument is quest name.)
    22. OnQuestTrackingEnabled       | string     | When the player has toggled tracking on for a quest.
    23. OnQuestTrackingDisabled      | string     | When the player has toggled tracking off for a quest.
    24. UpdateTracker                | (none)     | When the Dialogue System needs to update the quest tracker HUD.
    25. <b>Pause Events</b>          | ---        | <b>Events related to pausing and unpausing Dialogue Time.</b>
    26. OnDialogueSystemPause        | (none)     | When Dialogue Time is paused.
    27. OnDialogueSystemUnpause      | (none)     | When Dialogue Time is unpaused.



    Visual Scripting Lua Functions

    If you want to invoke a Visual Scripting Custom Event from a dialogue entry node's Script field, add a Dialogue System Visual Scripting Lua component to the Dialogue Manager. This will add the following Lua functions:


    Code (text):
    1. Lua Function                                                   | Description
    2. ---------------------------------------------------------------|------------
    3. vsEvent(objectName:string, eventName:string)                   | Invokes a custom event on a GameObject.
    4. vsEventString(objectName:string, eventName:string, arg:string) | Invokes a custom event on a GameObject with a string argument.
    5. vsEventBool(objectName:string, eventName:string, arg:bool)     | Invokes a custom event on a GameObject with a Boolean (true/false) argument.
    6. vsEventFloat(objectName:string, eventName:string, arg:float)   | Invokes a custom event on a GameObject with a floating point number argument.
    7. vsEventInt(objectName:string, eventName:string, arg:int)       | Invokes a custom event on a GameObject with an integer argument.


    These Lua functions invoke a Visual Scripting Custom Event on a GameObject named *objectName*.

    - If objectName is blank, it will send the event to the GameObject that has the Dialogue System Visual Scripting Lua component (i.e., the Dialogue Manager).
    - If objectName is "speaker", it will send the event to the current dialogue entry node's speaker, or the Dialogue Manager if no conversation is active.
    - If objectName is "listener", it will send the event to the current dialogue entry node's listener, or the Dialogue Manager if no conversation is active.
    - Otherwise it will send it to the named GameObject.