Search Unity

Node editor, with working dialogue editor

Discussion in 'Assets and Asset Store' started by jeijei, Jul 16, 2016.

  1. jeijei

    jeijei

    Joined:
    Aug 31, 2014
    Posts:
    30
    it's a generic framework for Node editors, similar to unreal engine's blueprints
    also has a working dialogue system using said framework
    i haven't bothered writing documentation yet, since i don't plan on putting it on the asset store, but mostly everything is commented and explained
    for the most part, here's what you need to know to use it
    open the Editor window from Window/Node Editor
    or Window/Dialogue Node Editor, if you want to use the dialogue one
    right click somewhere in the giant grey rectangle
    a text field should show up, where you can enter the name of whatever node you want to make.
    the actual buttons for the nodes show up once you've typed something in

    after that, each node has an Attach button. Pressing Attach the first time selects a node to be the attached node, pressing Attach on another node will connect both nodes. To cancel the Attach, press the button on the first node again

    if you're connecting a switch node, or a string append one, you have two extra buttons that allow you to reorder their connections
    after you're done working on your script/canvas/whatever, type a name in the first text field on the right side of the editor window, enter a number in the other one (the script starts from that number's ID) and press Save
    to load, type the name of the script and press Load
    here's a list of the nodes currently in the editor
    generic ones:
    Float/String/Bool - basic data types that have a variable of their type
    Addition (Float) - returns the sum of all the connected nodes (you connect nodes TO this one, not the other way around)
    And (Bool) - similar to sum, it's the "&&" for Bool nodes
    Append (String) - combines the values in the connected string nodes
    Branch - used in the dialogue, and wherever else, when you need to proceed with steps. Basically, if we're in the dialogue, all the nodes that don't return a float/bool/string value will instead return another node that's considered as the next correct step in a branching tree. For If the next one gets calculated from a Bool node's result, for Switch you select it ingame with a button, and for everything else, you only connect the nodes to the next steps
    EqualTo (Bool) - compares two Bool/String/Float node values
    GreaterThan (Bool) - ">" for two Bool nodes. i'd make GreaterThanOrEquals but it's not worth the time
    LessThan (Bool) - "<"
    If (Branch) - you connect some Branch node to the If node, and the next node will be the result of the If. That depends on what you have in the Bool condition (you connect it to the If node as well). the If node is then connected to the result ones
    Multiply (Float) - the product of all the connected floats
    Not (Bool) - the opposite of a bool's value
    Or (Bool) - the "||" of the connected bools
    ToString (String) - returns the connected node's value as a string. only connect Bool/Float/String nodes to it, and then connect it to whatever needs a string
    ExecuteFunction (Branch) - supposed to call a function and then proceed to the next node. The actual function is stored in any other class than inherits this class
    Dialogue nodes:
    OutPut (Branch) - used as the player's input in dialogue. you connect a Switch node to output nodes, and then in the game the OutPut nodes appear as buttons that the player can press.
    Switch (OutPut) - the dialogue for the NPC you're talking to. It either connects to an OutPut, or to an If that eventually connects to an OutPut
    for both Switch and OutPut you can connect a String node to them to replace their text (i do this if i need to construct a string ingame)
    then we have StoryBool/Float/String nodes that return the value from a stored object that has the appropriate value, and SetBool/Float/String that sets the value for said nodes

    In case this was too much, here's a quick tutorial on the dialogue
    1. WIndow/Dialogue Node Editor
    2. right click on the window
    3. type "Switch" and then press the only possible button that will show up under the text field
    4. type something into the node's text field
    5. create two OutPut nodes, type something into them as well
    6. Press Attach on the Switch node
    7. Press Attach on the OutPut node
    8. repeat 6 and 7 for the other OutPut node
    9. Name and save your script
    10. open the demo scene that's in the NodeEditor folder
    11. click the cube in the hierarchy
    12. in the inspector, find the "ScriptStorage" component for the cube and assign the script you just made
    13. go to Edit/Project Settings/Tags and Layers and create a new layer
    14. find the canvas gameobject in the hierarchy
    15. in it's "DialogueReader" component assign the layer from step 13.
    16. set the cube to also be that layer
    17. Start the game
    now you should be able to press F while looking at the cube. a dialogue window will show up. The top text will be what's in the Switch, the two buttons below will be whatever was in the OutPuts
     
    DrMaeiX likes this.
  2. jeijei

    jeijei

    Joined:
    Aug 31, 2014
    Posts:
    30
    oh lol i forgot to include the actual package
     

    Attached Files:

    moure likes this.
  3. lewisallanreed

    lewisallanreed

    Joined:
    Apr 26, 2015
    Posts:
    2
    @jeijei , thank you!!!!!
    just wanted to say that this tool is incredible, it's just what I needed for my project, and I can't but praise your generosity for sharing such a complete asset with everyone who just cares to look for it.
    here comes the bothersome part though: I really wanted to submit a sort of question, just to make the integration of the tool in my (and hopefully future users') project much easier==>
    If I wanted to create my own node, how would I go about it?
    To give you a bit of context: my question arises from the fact that I'm well into my project, having already created a custom class for the quests, I now have my own little quest database in the form of a customclass list attached to my player, so it would be a lot of extra work to actually integrate your storyvariable system, where I could just create a node to which I could feed my player object and search and check the quest data there.

    So, to recap, a lot of extra work, I know... but I'd be extremely grateful if you could write a very short tutorial/guide just on how to create a custom node! Who knows, maybe there's others who'd be interested in something similar (regardless of my VERY specific need). I think this is so great that many people already have similar questions. I know I'd pay for an answer :)

    Thank you even just for reading,
    Frances!!
     
    Last edited: Oct 30, 2016