Search Unity

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

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

  1. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    value can be longer, because there is enough space, to make it fit closer to the node edge
     
  2. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Okay, i'll implement it ASAP.

    Thanks.
     
    Lars-Steenhoff likes this.
  3. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    Can confirm, that v1.75 works again inside U5.6.6 !
    Also great to have new pictos / icons ! ("I have improved item selector window like")
     
  4. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Glad to hear that:).
     
  5. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    @wahid_rachmawan
    I moved the project to Unity 2018.3.2

    After closing the Unity Editor with uNode Editor open, and then relaunching the Unity Editor, I get errors.
    error_01.7z
    Closing and reopening the uNode Editor eliminates these errors.
     

    Attached Files:

  6. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    It seem the bug due to serialization issue, when closing unity with uNode Editor open its save the current editor data and when unity open again the uNode tries to access object that doesn't exist and this why error comes (i've try fix it with null check but without success, it likely because object exist in .net and not in unity).
    This bug comes only on launching unity after closing unity with uNode open.
    I'll find a way to fix this issue, this is not big deal for now and i still improving uNode with cool feature (it will be major update) and if there is no many bug with the current version next update will be version 1.8 but this takes more times to be done.
     
  7. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    Yes, I agree that this is not a big problem, but I try to report everything.
    Major Update? :rolleyes: Cool :cool::):cool: (version 1.7.5 is great)
     
    Last edited: Jan 24, 2019
  8. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Yes.
    The upcoming feature is remaining secret (sorry) but its for non programmer (high level), i just started develop it and i will share some pic/video when the feature almost ready:).
     
  9. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    Ok ;)

    Meanwhile...
    My friend, which is better than me at C#, made some scripts that don't parse properly, we created a small working project with only these files, I can send it to you if you're interested.
     
    Mark_01 likes this.
  10. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Sure, you can PM me to send it and i'll improve c# parse to support it;).
     
    Mark_01 likes this.
  11. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    @wahid_rachmawan
    I have a strong impression that the uNode editor is now working very slowly - I have problems with moving nodes. Perhaps the fault lies on my side, but the only thing I changed after installing uNode 1.7.5 - it's a change to Unity 2018.3 from 2018.2.18

    edit//
    I have checked and in Unity 2018.2.x I have this problem too :(
     
    Last edited: Jan 25, 2019
  12. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Hmm i think i has made some mistake in editor to became more slow, i will investigate to fix it ASAP.

    Thanks for report it.
     
    Mark_01 and Szaruga like this.
  13. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    In my very simple scene, i have a gameObjectList with 3x gameObjects. They doing a simple rotaion on update. When hitting compile / preview to do a C# script, it says:
    NullReferenceException: Object reference not set to an instance of an object

    I thought it is now possible to generate C# with Array / multiple objects ? Am i doing something wrong ? The way i am doing it: Update -> foreachloop-group -> transform.rotate (instance). I remeber, i had that request few versions ago...
     
  14. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    These are some of the simplest and most common mistakes - they still happen to me and most often the fault lies on my side in the form of oversight. Unfortunately, their elimination often requires insight into the entire project.
     
  15. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Can you send me the full error (stack trace) from the console?
    this let me know what the error comes from.

    Also you can know the error comes from using uNode Console, open it in menu > 'Tools' > 'uNode' > 'Show Console'
    an tutorial for how to find error nodes :
    -Try to generate/preview c# (make sure the error comes)
    Screenshot (273).png
    -Double click or Right click on the error and click on HighlightNode (this will open uNode Editor and jump into error node).
    -Finally try to find the error and fix it.

    You can quickly jump into error nodes using uNode Console like above.
     
    Last edited: Jan 27, 2019
    Mark_01 likes this.
  16. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    Hi!
    How can I completely delete uNode from a project?
    When I delete uNode from the project- Asset Folder it re- installs itself automatically.
     
  17. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Try deleting uNode again if can't try delete from exploler.
    Its impossible for uNode to automatically reinstall it maybe somethink wrong with unity.
     
  18. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    Okay.

    Here is the unity-console log:
    Error from node:ForeachLoop 1 |Type:MaxyGames.uNode.Nodes.ForeachLoopGroup
    UnityEngine.Debug:LogError(Object, Object)
    MaxyGames.CSharpGenerator:GenerateNode(Node, Boolean) (at D:/My Project/uNode/Assets/SourceCode/CodeGenerator/CSharpGenerator.cs:2693)
    MaxyGames.<>c__DisplayClass72_1:<GenerateFunctions>b__0() (at D:/My Project/uNode/Assets/SourceCode/CodeGenerator/CSharpGenerator.cs:2731)
    MaxyGames.ThreadingUtil:Queue(Action) (at D:/My Project/uNode/Assets/SourceCode/CodeGenerator/CSharpGenerator.cs:1574)
    MaxyGames.CSharpGenerator:GenerateFunctions(Action`2) (at D:/My Project/uNode/Assets/SourceCode/CodeGenerator/CSharpGenerator.cs:2727)
    MaxyGames.CSharpGenerator:Generate(GeneratorSetting) (at D:/My Project/uNode/Assets/SourceCode/CodeGenerator/CSharpGenerator.cs:1631)
    MaxyGames.uNode.Editors.uNodeEditor:previewSource() (at D:/My Project/uNode/Assets/SourceCode/Editor/Graphs/uNodeEditor.cs:3468)
    MaxyGames.uNode.Editors.uNodeEditor:DrawToolbar() (at D:/My Project/uNode/Assets/SourceCode/Editor/Graphs/uNodeEditor.cs:3254)
    MaxyGames.uNode.Editors.uNodeEditor:OnGUI() (at D:/My Project/uNode/Assets/SourceCode/Editor/Graphs/uNodeEditor.cs:439)
    UnityEditor.DockArea:OnGUI()


    Aborting Generating C# Script because have error.
    UnityEngine.Debug:LogError(Object)
    MaxyGames.uNode.Editors.uNodeEditor:previewSource() (at D:/My Project/uNode/Assets/SourceCode/Editor/Graphs/uNodeEditor.cs:3506)
    MaxyGames.uNode.Editors.uNodeEditor:DrawToolbar() (at D:/My Project/uNode/Assets/SourceCode/Editor/Graphs/uNodeEditor.cs:3254)
    MaxyGames.uNode.Editors.uNodeEditor:OnGUI() (at D:/My Project/uNode/Assets/SourceCode/Editor/Graphs/uNodeEditor.cs:439)
    UnityEditor.DockArea:OnGUI()



    NullReferenceException: Object reference not set to an instance of an object
    MaxyGames.uNode.VariableData.get_Type () (at D:/My Project/uNode/Assets/SourceCode/Core/VariableData.cs:23)
    MaxyGames.CSharpGenerator+VData..ctor (MaxyGames.uNode.VariableData var, Boolean autoCorrectVariable, IList`1 attribute) (at D:/My Project/uNode/Assets/SourceCode/CodeGenerator/CSharpGenerator.cs:621)
    MaxyGames.CSharpGenerator.AddVariable (MaxyGames.uNode.VariableData variable, Boolean isInstance, Boolean autoCorrection) (at D:/My Project/uNode/Assets/SourceCode/CodeGenerator/CSharpGenerator.cs:7275)
    MaxyGames.uNode.Nodes.ForeachLoopGroup.GenerateCode () (at Assets/uNode/Node/Group/ForeachLoopGroup.cs:119)
    MaxyGames.CSharpGenerator.GenerateNode (MaxyGames.uNode.Node target, Boolean isValue) (at D:/My Project/uNode/Assets/SourceCode/CodeGenerator/CSharpGenerator.cs:2673)

    And here the uNode-console log:
    upload_2019-1-27_19-54-44.png
    (was not able to select and to do a copy n paste)

    I tried it with highlighting, but i have no idea why the error pops up. I am sure you know more. Please fix this. Thx.
     
  19. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    It seem error on source nodes, try replace with this one below
     

    Attached Files:

    Mark_01 likes this.
  20. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    @wahid_rachmawan
    Previously, here was the name of the script and now there is always "Temp_Graph", why? --->
    2019-01-28_21-21-44.png
     
  21. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    This because in Unity 2018.3 we can't edit prefab directly so i create a temporary graph to edit it, but the names look weird i'll change it soon to script name.
     
    Szaruga likes this.
  22. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    @wahid_rachmawan
    There is a problem with the serialization of uNode files which was not there before. Yesterday I changed some things, I compiled and everything was OK. Today I turn on the project and the C # script is OK, but the uNode file has been not serialized.
    Before 1.7.5 I did not have to worry about saving changes and now there is a problem. :(

    I know there is a button "SAVE", but I do not always remember to use it. Automatic serialization was better
     
    Last edited: Jan 29, 2019
  23. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    I know automatic serialization is always better but we can't use it for the new prefab system cause its can't dirrectly edit in the project. So i make it can editable by instancing prefab to scene and referencing it to uNode editor which is work fine but needed to serialize by hitting save button because if we implement automatic serialize the editor will slow so i make some of automatic serialization only for some condition such as on play the game, change/open scene, and save scene but i forgotton to save it on hit compile and editor quit this will be available on next update. For now you can hit ctrl/cmd + s to save the scene and graph.
     
  24. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    I understand, and maybe ... And if the editor noticed that changes were made, but they were not saved and inform about it with the red color of the tab? --->
    2019-01-30_04-19-28a.png
    One small change would be enough to highlight (alarm) - save would cancel the alarm
     
  25. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Ah that's good idea but i think its more better to add * just like in VS after graph name that mean its not been saved.
     
  26. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
  27. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    @wahid_rachmawan
    Structure and list of structures - no initialization --->
    2019-01-30_21-47-40.png

    Classes and others - ok --->

    2019-01-30_21-45-49.png

    2019-01-30_21-42-52.png

    I mainly want to initiate an empty list of structures
     
    Last edited: Jan 31, 2019
  28. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    Somehow it was a lil bit better. Now i don´t get any uNode-Console error. And i can Preview-Code ! But ... i can´t compile and write it / save it ! I got only an error inside the unity-console :
    ------------------------------------------------------------------------------------------------------------------------------------------------------------
    Exception: Error (CS0236): A field initializer cannot reference the nonstatic field, method, or property `PROGRAM.objectVariable'
    in line: 6Error (CS1950): The best overloaded collection initalizer method `System.Collections.Generic.List<UnityEngine.GameObject>.Add(UnityEngine.GameObject)' has some invalid arguments
    in line: 6Error (): D:\Games\_Unity3D\Data\Mono\lib\mono\2.0\mscorlib.dll (Location of the symbol related to previous error)
    in line: 0Error (CS1503): Argument `#1' cannot convert `object' expression to type `UnityEngine.GameObject'
    in line: 6Error (CS0236): A field initializer cannot reference the nonstatic field, method, or property `PROGRAM.objectVariable1'
    in line: 6Error (CS1950): The best overloaded collection initalizer method `System.Collections.Generic.List<UnityEngine.GameObject>.Add(UnityEngine.GameObject)' has some invalid arguments
    in line: 6Error (): D:\Games\_Unity3D\Data\Mono\lib\mono\2.0\mscorlib.dll (Location of the symbol related to previous error)
    in line: 0Error (CS1503): Argument `#1' cannot convert `object' expression to type `UnityEngine.GameObject'
    in line: 6
    MaxyGames.uNode.Editors.uNodeEditor.Compile (System.String[] source) (at D:/My Project/uNode/Assets/SourceCode/Editor/Graphs/uNodeEditor.cs:3404)
    MaxyGames.uNode.Editors.uNodeEditor.GenerateSource () (at D:/My Project/uNode/Assets/SourceCode/Editor/Graphs/uNodeEditor.cs:3574)
    ------------------------------------------------------------------------------------------------------------------------------------------------------------
    Thats strange. Preview works, but saving it / compiling it don´t work. Also i recognized i can´t select the "code" inside the Preview-window. Will this be accessable soon, in further versions ? And can you please take a look again, with this "ForEachLoopGroup"-error. Thanks.
     
  29. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Thanks i'll improve it soon.

    Next update will support initialization for structures and list of structures.

    It look like the error because of compilation check the script, the output script have something wrong.
    Please send me the prefab and output script.
    The output script can be found in : Assets > TempScript > "Your script name".
     
  30. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    OKay. Here we go ... You will found the "TempScript" and my "Scene". I used:

    - Win 8.1 x64
    - U5.64f1
    - uNode v1.75

    ("PROGRAM.cs" is from the TempScript-folder. "simple_test.unitypackage" includes the Scene, excludes uNode-package). I sended all to you via PM. Check it out. Filename is: "uNode_Debugging_v1.7z"
     
  31. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Thanks for send and report it.
    To fix it, you'll need to make null element value of My_objects because the code generator detect that the variable value is same with the event in StateFlow the generator will create a new variable to handle it (since Unity.Object can't be reference inside script) and My_objects value will reference its value to generated variable.
    Screenshot (274).png
    You'll need to make value null of above variable, you can assign it later in the generated script since the variable is public.
    Screenshot (275).png
    This is categorized as a bug because i want code generator work on any condition such as like that and it will be fixed soon.

    Edit: fixed in next update;).
     
    Last edited: Feb 1, 2019
    Mark_01 and Lars-Steenhoff like this.
  32. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    Your so fast in making fixes! If only unity was so fast :cool:
     
  33. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    @wahid_rachmawan
    I know that you have a lot of work, you repair the errors and add new things, but ... Regarding my dream reroutings - is there a chance for something like this? --->
    2019-01-28_14-21-49.png
     
  34. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    @wahid_rachmawan
    Thanks for fixing it ! I can wait until the new version comes out, to play again with it ... ;)
     
  35. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Sure, and rerouting have been done, it will available in next update;).
    Screenshot (276).png

    You welcome.
     
  36. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    Looks really good the way the nodes connected in the UI ! Good idea from @Szaruga. This helps a lot to get a better overview in a more complex project !
     
    wahid_rachmawan and Mark_01 like this.
  37. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    In the last two months - uNode from a good tool has become a great tool. Where is the limits of perfection?
    :eek: :cool:;):cool: :confused:
     
    wahid_rachmawan and Mark_01 like this.
  38. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    Yeah....so true. It grows better & better ! :cool:
     
  39. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    @wahid_rachmawan
    Will you also add an option - that the data connection curves like a flow connections?
    like this way --->
    2019-02-02_21-03-44.png

    instead of this --->
    2019-02-02_21-04-54.png
     
  40. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    Hi!

    I am still a beginner in unity and uNode..
    Just a quick question:

    I want to make a game similar to the williams defender arcade game (for the action part).
    The enemy behaviour of this game is the best I have ever seen in a 2D video game (and it is very fast)

    Is it possible to realize this with uNode?
    ..and if so, how would the approach look like?



    Thanks!
     
  41. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    From my pov (point of view) it is doable with unity. And so it is with uNode. I would start simple. You can take dummy-objects instead of final graphics, if you want. First mechanics: steering the ship and than the scrolling (maybe with parallax). When you achieved this goal, you can go one step further: particle generation, etc. Third could be: enemies. Fours: highscore. Last one, the mini-map above. I think you can find some tutorials on the maxyGames website. Not exactly this game, but others with similar game mechanics...
     
    wahid_rachmawan likes this.
  42. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    Thanks for reply.
    Sorry for not pointing out that I already have the game environment and the endless scrolling ready.

    The only part that is missing is the enemy AI.

    This is the hardest part I guess..

    I ask in this forum because a) I have already bought uNode and b) I think that using an engine like playmaker or bolt in combination with for example behaviour designer would slow down the gameplay to an unusable point, especially on an older android mobile device.

    It has to be scripts, but since I am not so good at coding such complex mechanisms, maybe it is somehow possible with generated scripts from uNode.
    ..but unfortunately I don´t know where to start.

    The defender gameplay is ultra fast and I want my game also to be ultra fast.
     
  43. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    I recognized too, that f.e. PlayMaker was fun prototyping. But when it comes to mobile & webGL, it performed bad. Especially HTML5. It was a too big Code from PM that had to be compiled. And the mess was: "out of memory" :(.

    I didn´t looked into all the example files, but maybe you can find something special for enemy-AI:
    http://maxygames.com/docs/unode-tutorial/examples/ (some uNode Game-Examples you can dive in)
    http://maxygames.com/docs/ (well documented manual / use cases)

    Hope you find something you can use for your game. Take a look at that stuff & the uNode-Configs.
     
    wahid_rachmawan likes this.
  44. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    516
    Sorry for late answer.

    Yes, thank you @Szaruga for request that feature.

    This because of help the community who has requested new feature, submit the bug, and something that makes uNode better.

    Sure, i'll change it soon.

    Yes any type of game can be made with uNode, its just like a tool to archive your idea basically like an script or text editor where its a tools to write your logic, but instead to deal with syntax uNode realize in a visual way with more simple and fun.

    Thanks @sledgeman he have a good answer for this.

    Yes the enemy from the game looking very good, you can start by creating some of simple enemy and then improve it from time to time and if you don't know where to start you can take a look in our example project with have an enemy but if you don't find what you need you can also find it on the internet (a c# script) and convert it to uNode with c# parser.

    Hopefully you find what you need for your game.
     
    Last edited: Feb 4, 2019
    Mark_01 likes this.
  45. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    Thanks..will definitely take a look at your suggestions!

    Just for the record:
    There even is a book out there describing the unique enemy behavior of defender.
    http://mahugh.com/defender-the-last-word/

    Compared to this complexity of enemy behavior from a 1980 arcade game ..every single 2D space ship enemy behavior nowadays is a complete joke (Just my humble opinion ;) ).
     
    Last edited: Feb 4, 2019
  46. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    @captnhanky
    Cool resource to the old-school Link ! I am a big fan of Retro Games. As a Kid i was playing SNES and the 16-bit games. Do you know if there is any link to these old days games, like mario kart, sonic etc. Some kind of making of´s ... ?
     
  47. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    @sledgeman

    I am sure there is, but unfortunately my focus is mainly on the early stuff, like asteroids, defender, choplifter..
     
  48. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    The silence before the storm... My cats are waiting for spring. We are waiting for a new version of uNode. ;)
     
  49. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    Something is in the oven ... :)
     
  50. AthrunVLokiz

    AthrunVLokiz

    Joined:
    Jun 7, 2017
    Posts:
    32
    The reason I didn't ask about the new version is that I didn't want to pressure you but me too. :oops: