Search Unity

Dialoguer - A Dialogue Creator Tool For Unity

Discussion in 'Assets and Asset Store' started by tonycoculuzzi, Mar 22, 2013.

  1. Harsiel

    Harsiel

    Joined:
    Dec 19, 2013
    Posts:
    3
    Hi, Tonzie, I'm trying to use the events system, specifically onEnded. I'm pretty new to using events and delegates though, so I'm having a little trouble.
    I have "DialoguerEvents.EndedHandler onEndHandler;" at the start of the script, and set the delegate to the method I want. But it doesn't activate on dialogue end. I'm obviously missing something, could someone help?
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class InteractWithStaff : Activation {
    5.  
    6.     public bool leftSide;
    7.  
    8.     Direction direc;
    9.  
    10.     public DialoguerEvents.EndedHandler onEndHandler;
    11.  
    12.     // Use this for initialization
    13.     void Start () {
    14.         onEndHandler = resetDir;
    15.         Dialoguer.Initialize ();
    16.         direc = this.transform.GetComponent<Direction> ();
    17.     }
    18.  
    19.     // Update is called once per frame
    20.     void Update () {
    21.  
    22.     }
    23.  
    24.     public override void Go() {
    25.  
    26.         if (leftSide) {
    27.             direc.RL = true;
    28.             direc.dirChanged = true;
    29.         } else {
    30.             direc.facingForward = true;
    31.             direc.RL = true;
    32.             direc.dirChanged = true;
    33.         }
    34.  
    35.         Dialoguer.StartDialogue (DialoguerDialogues.StaffDialogue);
    36.     }
    37.  
    38.     void resetDir(){
    39.  
    40.         direc.RL = false;
    41.         direc.facingForward = false;
    42.         direc.dirChanged = true;
    43.     }
    44.  
    45.  
    46. }

    EDIT: I managed to figure out how to use the events! Just needed DialoguerCore.DialoguerEventManager.onEnded += resetDir; and nothing else!
     
    Last edited: Jun 27, 2015
  2. Ericks89

    Ericks89

    Joined:
    Nov 3, 2012
    Posts:
    39
    I got a simple question, are you able to color a single word, character, or line in Dialoguer? If not, should be simple enough to add in.

    Character 1:
    Hello, my name is Guy!

    The standard color is white, but you can change any line, word, or character to any color in the rainbow.

    This was pretty common in RPGs, Zelda, and adventure games back in the day.
     
  3. kenlem

    kenlem

    Joined:
    Oct 16, 2008
    Posts:
    1,630
    Dialoguer doesn't deal with display of the text. That's up to you. If you want to include color information in your text, you can do that.

     
    Ericks89 likes this.
  4. EdFear

    EdFear

    Joined:
    Jun 5, 2009
    Posts:
    4
    Hey Tonzie,

    Any rough idea when some of the promised features (new UI, Unity 5 sample etc.) might be released? I know you're busy with Cuphead but I see that's not due to be released until 2016 - so is it unlikely we're going to get it this year?

    Cheers!
     
  5. tonycoculuzzi

    tonycoculuzzi

    Joined:
    Jun 2, 2011
    Posts:
    301
    This is all based on how you implement your own Dialogue GUI system. You can take advantage of Unity's Rich Text stuff, and just add <color="red">tags</color> to your text, and it should work. Again, all depends on how you implement it in your GUI. Currently, none of the examples use Rich Text.


    Thanks kenlem! Couldn't have said it better myself hahaha.



    I'm not completely sure, to be honest. I've been slowly working on it when I have free time, but it still has a long way to go. The Unity 5 samples will be ready before the UI revamp, but I can't say when. :(
     
  6. iScream8

    iScream8

    Joined:
    Feb 16, 2015
    Posts:
    10
    I just tried this package and it was really awesome but I've been thinking of using NGUI buttons for this. How can I use NGUI buttons for the choices? I read that this is compatible with NGUI and I've been looking for a thread on how to use NGUI with this but can't find any tutorial regarding it. :/
     
  7. tonycoculuzzi

    tonycoculuzzi

    Joined:
    Jun 2, 2011
    Posts:
    301
    There are no NGUI examples included, because that would require me to include NGUI in the Asset Store package, which I can't do.

    It's simple. Set up your NGUI GUI, and have a script that controls are your NGUI elements (references in the script) with the Dialoguer events. It's the exact same as using the Legacy Unity GUI, except referencing NGUI elements instead of GUI.Labels, etc. Same goes for the new Unity GUI system.
     
  8. iScream8

    iScream8

    Joined:
    Feb 16, 2015
    Posts:
    10
    Ah i see. Would you mind if I ask for an example script of the Legacy Unity GUI? Sorry I'm really new in this field. >_<
     
  9. tonycoculuzzi

    tonycoculuzzi

    Joined:
    Jun 2, 2011
    Posts:
    301
    There are three examples included in the AssetStore package, in the DialoguerExamples folder :)
     
  10. iScream8

    iScream8

    Joined:
    Feb 16, 2015
    Posts:
    10
    Last question if you dont mind :), How can I return back to the previous dialogue?
     
  11. tonycoculuzzi

    tonycoculuzzi

    Joined:
    Jun 2, 2011
    Posts:
    301
    There's no way to do this yet, but it's a feature a lot of people have been asking for, so it'll be in the next big update once I have some time! :)
     
  12. fingersbleeding

    fingersbleeding

    Joined:
    Jun 10, 2013
    Posts:
    24
    Soooo good. Thank you for this.

    Couple requests, in order of need. I have not read all 6 pages of this thread, so apologies if these are duplicates.

    1. Ability to rearrange the order of the rows in the Dialogue Selector.
    2. In Dialog Canvas, when you select Advanced on a panel, update the Z-Index to the top-most panel.
    3. A zoomed out view of the Dialogue Canvas.

    I'm using Message Event to move between Dialogues, works great, but would be nice to have this as a unique panel type.

    For anyone considering this asset, super solid so far.

    Good luck on Cuphead, can't wait to play!
     
  13. ilezhnin

    ilezhnin

    Joined:
    Jul 17, 2013
    Posts:
    17
    Good afternoon. A great asset, it seems that fully suits me. I would like to clarify one question. You have implemented a system of dynamic dialogues? For example let's say if I need a merchant who has random collection of items. I can't use for that pre-filled node, I need to fill the node names of the items from code and continue the dialogue after selecting one of them. Thanks in advance for your reply. For my game this functionality is important.
     
  14. SingularitySystems

    SingularitySystems

    Joined:
    Feb 10, 2014
    Posts:
    48
    Would it be possible to get some Rich Text Support added?
    I would like to do the following for example: "I <color=red>cannot</color> fail."
    Unity's display supports it, but if you have it set to scroll words across (like the old school RPG's), it actually types out the rich text tags before they take effect.

    EDIT: I spent a few hours and managed to get Dialoguer to do this. With more time and effort it could easily be added to the Addon.

     
    Last edited: Feb 21, 2016
  15. tonycoculuzzi

    tonycoculuzzi

    Joined:
    Jun 2, 2011
    Posts:
    301
    This won't be added to Dialoguer, because this is all up to you, the user. Technically, Dialoguer already supports this, and it's up to you to add rich text support to your skin, for your game.
     
  16. neon8100

    neon8100

    Joined:
    Mar 25, 2015
    Posts:
    6
    Thought I'd chime in here regarding the Wait (Complete) issue that occurs in a situation like this where calling "Dialoguer.ContinueDialogue()" just returns to the branch or fails to work.

    Assume you have your nodes set up such as this one, where I want to wait for a player to input some information before continuing the dialogue. I issue a wait statement. Before the workaround, it would just return to the question/branched text section or restart entirely, rather than continuing to the next line of text.



    Here's my workaround.

    Head to WaitPhase.cs and add a few lines of code to the top of the class and inside the declaration.

    Code (CSharp):
    1. public static WaitPhase currentWaitPhase;
    2.  
    3.         public WaitPhase(DialogueEditorWaitTypes type, float duration, List<int> outs) : base(outs){
    4.             this.type = type;
    5.             this.duration = duration;
    6.             currentWaitPhase = this;
    7.         }
    Secondly in Dialoguer.cs add a function such as this:
    Code (CSharp):
    1. public static void WaitComplete()
    2.     {
    3.         WaitPhase.currentWaitPhase.waitComplete();
    4.     }
    From there you can just call:
    Code (CSharp):
    1. Dialoguer.WaitComplete()
    and the dialogue will continue to iterate any further nodes.

    Hope this helps some of you, been tearing my brain out trying to find/work a solution and this seems to be functional for me.
     
  17. UnityJakob

    UnityJakob

    Joined:
    Mar 9, 2016
    Posts:
    1
    I'm trying to figure out how to access the global variables in a useful way from script and was wondering if anybody else has run into the same problem or has any ideas.

    I've seen Tonzie's description on how to hide dialog branches based on conditons, and he mentions as an example how one could include metadata (such as 1:lockpick:20). Fair enough, but without accessing a global variable by name, how would I ever know what the character's lockpick skill is?

    Dialoguer.GetGlobalFloat(int) takes an integer parameter (I assume this is the index of the variable in order as listed in the variable editor?), but I want to access the variable by its name "lockpick" instead.
    GetGlobalVariablesState() gives an xml element containing all global variable values, but it does not include their keys. This makes me question if the key is even stored as a string and if the information is even accessible.
     
  18. Modron

    Modron

    Joined:
    Dec 4, 2014
    Posts:
    1
    Hey, I don't know if anyone had this issue yet, but I've been looking for a way to navigate the nodes backward. Much like a Dialoguer.Continue(), but like some sort of Dialoguer.GoBack();
    I was thinking about making my own version of it, but I thought about asking first
     
  19. diegoadrada

    diegoadrada

    Joined:
    Nov 27, 2014
    Posts:
    59
    Hi, anyone kwows if this plugin is compatible with I2 Localization from Asset Store? Thanks!
     
  20. tonycoculuzzi

    tonycoculuzzi

    Joined:
    Jun 2, 2011
    Posts:
    301
    Hey Diego,

    It should be! You just have to enter the localization keys into the dialoguer text fields. Then, in your Dialogue GUI script, instead of displaying the "text" field of the dialogue, you find the associated term field in the I2 Localization data (associated with the value returned by the "text" field) and display that instead.