Search Unity

[Released] uNode - Visual Scripting [Support C# Import/Export]

Discussion in 'Assets and Asset Store' started by wahid_rachmawan, Oct 18, 2017.

  1. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Sure, i still improving the theme for more options.

    Great suggestion, added to scheduled plan thanks.

    Ah this will be fixed in next update.

    Okay, I'm waiting for that.
     
  2. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    Meanwhile, still 2018.2.18...
    I create the OnEnable function --->
    2019-01-16_17-00-35.png
    I compile the C # script and everything works fine...
    But after restarting the Unity and uNode editor - "start" changes itself --->
    2019-01-16_17-01-16.png
     
  3. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    @wahid_rachmawan
    in Unity 2018.3.1...
    Attempt to preview --->
    2019-01-16_16-55-35.png
    no preview and errors --->
    2019-01-16_16-56-27.png
    the second way --->
    2019-01-16_16-57-23.png
    no preview and errors --->
    2019-01-16_16-58-07.png
    and attempt to compile --->
    errors_003.png
     
  4. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    It wierd, i will investigate and fix it ASAP.

    It look like error on a Set node maybe it unassigned or somethink else would you like send the graph screenshot?
     
  5. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    Sorry but I do not understand. What to send? o_O
     
  6. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Send me the prefab or screenshot for that graph.
     
  7. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403

    Attached Files:

  8. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    @wahid_rachmawan
    I have extracted one simple script in which attempts to preview and compile in Unity 2018.3.1(2 too) cause errors
    sz_camera.7z
     

    Attached Files:

    Last edited: Jan 17, 2019
  9. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    @Szaruga

    The bugs has been found and fixed.

    Thanks for report it.
     
    Szaruga likes this.
  10. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    It sounds great :)
    I wanted to suggest a "reparse" feature, but this is even better (I assume it will be still possible to reparse after making changes to the code outside of the uNode editor).
     
  11. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Yes it allow us to reparse after making changes to the code and it automatic modify nodes based on changed script.

    I have improved theme which allow making theme like this:
    Capture.PNG
     
    Last edited: Jan 18, 2019
  12. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    Fine :)

    small issue:
    Sometimes instead of function parameter names, P0, P1, P2 etc. are displayed ... this does not affect the correct operation, but looks ugly and less legibly on the graph
     
  13. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    I was downloading v1.74 and expirienced something strange. I am on U5.6. When i drag an GameObject into the unode canvas and when i want to set / get values, it didn´t work. No window pops up, where i can select my functions. Also No errors shown by doing this. Did i miss something ... ? It worked with previous versions.
     
  14. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    Hi!

    First of all, I am very happy with uNode!! (I am a beginner in unity)

    Just little feature suggestions:

    1. C# Preview window
    It would be fine to be able to mark and copy text passages out of the c# preview window. Like in the unity console, where you can mark and copy for posting error codes on the internet for example.
    In some cases it would be helpful for beginners of programming to just copy little phrases out of the c# preview window.

    A nice extra feature for learning would be a search window with highlighting search terms in the script

    2. Generated C# format in preview and compiled scripts
    It would be fine to change the format of the curly braces to make the code more readable for beginners.
    Like so
    for(..)
    {
    }

    instead of

    for(..){
    }


    3. Import of bolt and bolt2 graphs (but I guess this is unrealistic ;) )

    THANKS!
     
    Last edited: Jan 20, 2019
  15. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    When select some uNode files as well as when edit them - three errors appear in the console --->
    error_004.png
    Despite these errors, everything seems to work well, but... an errors is an errors.

    P.S.
    Regarding the error from post 402 - the error kept repeating - it was only the removal of the nodes and the placement of new ones that helped.
     
  16. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    First of all, sorry for the late reply because I had an exam at my university.

    Ah this is planned on earlier version but i forgotten to add it to roadmap. This improvement will be available soon.

    Its a bugs, this will be fixed in next update.

    Its a good idea, added to planned features;).

    Can you explain me more about this features?
    How it work and what its should be.

    This features still in planned and will be added in some of major update.
    Originally was requested by @Szaruga

    Hmm i am not sure i can do it since bolt have some different system such as State Machine, and Variable System.
    I guess this will never be available.

    This error from the real time c# preview because of generating script in background, mostly unity API is not supported multithreading.
    This will be fixed in next update.

    The error from post 402 i couldn't produce, it look like when assigning 'Start' the uNode not serialize it. I tested on U2018.3, to save the graph i do hit the 'Save' button, maybe because of this i couldn't produce it, i will test it from another version of unity soon.

    Thank you for all your bug reports, suggestions and feedback.
     
    Last edited: Jan 20, 2019
    AthrunVLokiz likes this.
  17. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    Hi!

    Thanks for fast response


    A nice extra feature for learning would be a search window with highlighting search terms in the script

    Can you explain me more about this features?
    How it work and what its should be.

    ..This simply means that on top of the c# preview window could be a search box, like in the unity project window or the unity hierarchy window or the unity scene window. Just for quick searching variables for example in the c# preview window.
     
  18. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    Hi again

    I am playing around with the survival shooter demo (player health script) to study uNode (I am an beginner of coding and uNode)

    How can I recreate the Component.GetComponent Box for Animation for example. When I delete it, I am not able to find it again.
    What do I have to enter in the add node search box to find it? GetComponent.png

    ..and the second question:

    For studying purposes I deleted "PlayerHealth" in the box of the Component.GetComponent and I was not able to bring it back. How can I bring it back?

    GetComponent box.png


    Thanks
     
  19. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    This simple but it's complicated for build it, and i think this is unnecessary for now.

    Follow this video below to make that nodes:

    Or by pressing space key on the graph


    You can display the full node name in preferences if you want to know what the component to get:
    Screenshot (265).png

    For now you need to drag & drop the Game Object to assign it like this video below:

    Next update i'll creating an menu to fast assign it.
     
    AthrunVLokiz likes this.
  20. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    Thank you so much..hours of searching have an end!

    Could you please make some tutorials for making a little game from scratch, not only parse a game?
    Because as I mentioned before, I am not a programmer and for me it is hard to learn every single step by myself. I have little experience with bolt 2, but uNode is more difficult but better (I need standalone generated c# code) and I want to make good progress with uNode.

    I successfully managed the "hello world" tutorial ..but where do I go from there? ;)
     
  21. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    Yes, I think that's it...though, I also had a case of continuous disconnections - and it also helped remove and insert new nodes.
    ....
    No parameter names occur when the function is placed inside the script --->
    2019-01-20_11-36-13.png

    When I have a lot of variables, propertions and functions - it's hard for me to find what I'm looking for, I do not know according to which scheme is the order ---> 2019-01-20_11-43-25.png

    I think that it would be useful to be able to quickly access frequently used nodes (saved as favorites or something like that).
    2019-01-20_11-54-52.png

    P.S.
    When you pass the exams and find a job in a corporation, You will abandon uNode? :(
     
    Last edited: Jan 20, 2019
  22. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    Can you make the green button another color in the settings?

    I would like to have the interface more natural without this green color, just a standard grey one.
    For people who don't like it green you can make it optional please.

    Thank you


    Screen Shot 2019-01-20 at 13.09.33.png

    The same for this blue line


    Screen Shot 2019-01-20 at 13.12.25.png
     

    Attached Files:

  23. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Sure, do you have any suggestion of what kind of tutorials?
    I was thinking a simple tutorial that expose some of feature which is only used by few people but powerful such as Action & Condition, and State Machine.

    Hmm i think after trying 'hello world' tutorial you can try to make a simple character controller from : http://maxygames.com/docs/unode-tutorial/other/simple-character-controller/
    or trying an example project or maybe try to parse simple script.

    This still in planned and will be available soon.

    Do you have suggestion for make it more easier to find anything in that window?
    Alternatively If you want to add node you can use quick search by hitting 'Space' key on the graph canvas and type the name of variable, function, or property like:


    Its a good feature, i will add it but it will not happen in short time.

    Sure i will add it in next update.
     
    Szaruga and Lars-Steenhoff like this.
  24. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    You're right, it's ok
     
  25. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    Maybe at least alphabetically or by type?
     
  26. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Its has shorted by alphabetically accordingly to names, now i still find a way to make it more good maybe be hiding the types or at least change it with icon.
     
    Szaruga likes this.
  27. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    @wahid_rachmawan
    When it adds a getter to the property - an error occurs in the console --->
    property issue.png
    Of course it disappears when it adds what you need in the getter, but the error message can scare you - especially beginners.
    ...............................
    I do something like this --->
    2019-01-21_17-19-45.png
    compilation ends with an error --->
    2019-01-21_17-25-06.png
    because there are missing parentheses in the C # code --->
    2019-01-21_17-28-08.png
     
  28. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    If I do not want to manually correct it in C # --->
    Code (CSharp):
    1.  return ((S_item_data)sz_zasoby._DT_item_data.Get_Row(ID)).image;
    In uNode I need to add a local variable and make a bypass --->
    2019-01-21_18-09-02.png
     
  29. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    That's true, but i don't any idea of what i should inform an user to understand that the property don't have getter so do you have any suggestion for this?


    To fix it replace 'ASNode.cs' code with this :
    Code (CSharp):
    1. namespace MaxyGames.uNode.Nodes {
    2.     [NodeMenu("Data", "AS-Convert")]
    3.     public class ASNode : ValueNode {
    4.         [Hide, FieldDrawer("Type"), Filter(OnlyGetType = true, ArrayManipulator = true)]
    5.         public MemberData type = new MemberData(typeof(object), MemberData.TargetType.Type);
    6.         [Hide, FieldConnection("Target")]
    7.         public MemberData target;
    8.         public bool useASWhenPossible = true;
    9.  
    10.         public override System.Type ReturnType() {
    11.             if(type.isAssigned) {
    12.                 try {
    13.                     System.Type t = type.Get<System.Type>();
    14.                     if(!object.ReferenceEquals(t, null)) {
    15.                         return t;
    16.                     }
    17.                 }
    18.                 catch { }
    19.             }
    20.             return typeof(object);
    21.         }
    22.  
    23.         protected override object Value() {
    24.             System.Type t = type.Get<System.Type>();
    25.             if(!useASWhenPossible || t.IsValueType) {
    26.                 return Operator.Convert(target.Get(), t);
    27.             }
    28.             return Operator.TypeAs(target.Get(), t);
    29.         }
    30.  
    31.         public override string GenerateValueCode() {
    32.             if(target.isAssigned && type.isAssigned) {
    33.                 System.Type t = type.Get<System.Type>();
    34.                 if(!useASWhenPossible || t.IsValueType) {
    35.                     return "((" + CSharpGenerator.ParseType(type) + ")" + CSharpGenerator.ParseValue(target) + ")";
    36.                 }
    37.                 return "(" + CSharpGenerator.ParseValue(target) + " as " + CSharpGenerator.ParseType(type) + ")";
    38.             }
    39.             throw new System.Exception();
    40.         }
    41.  
    42.         public override string GetNodeName() {
    43.             if(useASWhenPossible && type.isAssigned && type.startType != null && !type.startType.IsValueType) {
    44.                 return "AS";
    45.             }
    46.             return "Convert";
    47.         }
    48.  
    49.         public override float DefaultWidth {
    50.             get {
    51.                 return base.DefaultWidth + 20;
    52.             }
    53.         }
    54.     }
    55. }


    I have improved item selector window like :
    Screenshot (266).png
    i think its more clear than old window.
     
    Last edited: Jan 21, 2019
    Mark_01, Szaruga and MasterSubby like this.
  30. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    it does not bother me especially. Can not make a error appear only when trying to compile?

    P.S.
    Good selector window. :)
     
    Mark_01 likes this.
  31. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Ah sorry for misunderstanding, you post because error always show in console.
    This error comes from Realtime C# Preview, i'll make an handler which take the error to only show in c# preview window ASAP.

    And thanks for report it.
     
    Mark_01 and Szaruga like this.
  32. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    Hi!

    How can I use the foreach statement?

    I need the x-Position of the current game object.

    need xposition foreach.png

    thanks!
     
  33. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Its simple, follow this video to make it :
     
  34. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    Ok thank you!

    And how can I set this game object (enemy) to a new position?
    This does not work (it does not change position)
    new position not working.png
     
  35. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Use Set node like this :
    Screenshot (270).png
    You graph not work because the Vector3 is immutable, to update need to set the position dirrectly.
     
  36. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    one more question, Is it possible to disable the background grid? or to set the color ( with possibility to set alpha )
     
  37. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Sure it can be disable, just uncheck the 'show grid' in the preference, and modify the 'grid color' to change the grid color.
     
  38. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    Thanks I did not check it yet, and the blue main button? is that also possible to change to color from?
    It looking really good now

    I'm using playmaker now and I will still use playmaker but I also want to have a tool that can read c# scripts.

    I still have to buy the asset, because I was not yet sure if I could make it fit my needs.
    Now I see it will and I will buy it. :)
     
  39. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    I have added options to change it;).
     
    Lars-Steenhoff and Mark_01 like this.
  40. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    Thank you..you are the best!!
     
  41. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    Actually makes me wonder, is there a way to trigger actions in playmaker from unode and the otherway around?
     
  42. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Hmm i not familiar with Playmaker but as uNode uses reflection system its will easily to trigger playmaker action with uNode you just need to find correct method from playmaker to call it in uNode.
    And from the playmaker sides i don't know much but i guest you need an action to invoke uNode method :
    'ActivateCustomEvent(String name)' from an uNodeRuntime component , this will call event/function in uNode but that only for uNode runtime.
    For the generated script, do like regular script ex : if you want to call an method > use action to invoke method, want to get property > use action to get property and so on.
     
    Mark_01 likes this.
  43. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    uNode v1.7.5 has been submitted for review!

    changelog v1.7.5:
    -Added inspect context menu for variable, property, function, and nodes.
    -Added 'Show Pin Icon' preference for theme.
    -Improved C# Preview
    -Improved Editor
    -Improved ErrorChecker
    -Improved ItemSelector
    -Improved Editor Preferences
    -Improved compatibility for Unity 2018.3+
    -Fixed bugs on dragging object to canvas the menu doesn't show.
    -Fixed bugs need to save generated script manually for asset and prefab.
    -Fixed error on realtime preview c# script that's contains property.
    -Fixed bugs editor not refreshed on adding node using context menu.
    -Fixed bugs editor not refreshed on adding node by drag & drop functions.
    -Fixed bugs editor not refreshed on splitting nodes.
    -Fixed bugs native theme doesn't show region box correctly.
    -Fixed bugs value output has incorrect target on duplicating node.

    Download here : http://maxygames.com/download/

    This update comes with some workflow improvement to more easy and fast creating.
    Below are some workflow improvements :

    New context menu for quickly creating constructor nodes.
    1.gif

    Improved filtering gives us easier to find suitable items such as 'GetComponent<T>'.
    2.gif


    With new 'Add Node (Set)' menu its now more easy to set variable and property its automatic find a item which can be set.
    3.gif
    And some of GUI i make it more simple.
     
  44. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    Screen Shot 2019-01-22 at 23.36.04.png Screen Shot 2019-01-22 at 23.33.02.png


    Hi I'm trying it for the first time and I have few things I see when I opened it:

    1. When there are no errors, make the error icon hidden, only show the red icon when there are errors.

    2. How can I make the nodes bigger horizontally? some of the imported scripts I used have long class or variable names and they don't fit inside a node.

    3. How can I make the inspector so that it can fit the node contents?
     
    Last edited: Jan 22, 2019
  45. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    I found one setting show full node names, but it still shows only part of " message contents"

    Screen Shot 2019-01-22 at 23.38.48.png
     
  46. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    1. I will change it in next update.

    2. Toggle the 'Full Node Name' in the preferences.

    3. Did you mean an inspector for change nodes size?

    So what you need, a full names including full type name?
     
  47. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Hi,

    The script you're trying to parse cause stack overflow due to bug of c# parser, i will try investigate to fix it soon.

    Thanks for report.
     
  48. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    Hi!

    I just made a c# script using uNode (for endless level)
    It works in unity (0 Errors 0 Warnings) but when parsing it with uNode, Unity crashes.

    unity 2018.3.0f2
    tested with uNode 1.7.4 and 1.7.5
     

    Attached Files:

    Last edited: Jan 23, 2019
  49. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    Yes to change node size and also to that the eareas inside the node fill more to the node edges. for example in my screenshot after message and after instance, and inside the "add" node
     
  50. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Do you mean the field of an node need more closer or the value need to fit to node edges?
     
    Last edited: Jan 23, 2019