Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[RELEASED] Nottorus - Unlimited Visual programming plugin

Discussion in 'Assets and Asset Store' started by Stridemann, Apr 4, 2016.

  1. Stridemann

    Stridemann

    Joined:
    Oct 12, 2013
    Posts:
    251
    I had an idea to make something like "Time machine" which allow not only revert the time back and see all variables values, but also see the values on each step of code of some frame.
    That is really interesting thing and I think I will release it in future.
     
    MrMetwurst2 and code-blep like this.
  2. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    Yep, this would be killer!
     
  3. MrMetwurst2

    MrMetwurst2

    Joined:
    Jul 16, 2009
    Posts:
    253
    OK guys, please be nice. This is my first tutorial ever on how to use iTween in Nottorus.
    It also shows basic Hashtable creation in Nottorus.
    Please correct me if I made any mistakes and I'll fix it up.
    Hope it helps...


    and the resulting code....

    Code (CSharp):
    1. //MD5Hash:526bd276d23c1d0eb5d516ab2fb31499;
    2. using UnityEngine;
    3. using System.Collections;
    4. using System;
    5.  
    6.  
    7. public class SpinCube : UnityEngine.MonoBehaviour
    8. {
    9.     public System.Collections.Hashtable tweenHashtable = new System.Collections.Hashtable();
    10.     public float tweenTime = 5f;
    11.  
    12.  
    13.     void OnMouseOver()
    14.     {
    15.         tweenHashtable.Clear();
    16.         tweenHashtable.Add("x", UnityEngine.Input.GetAxis("Mouse Y"));
    17.         tweenHashtable.Add("y", -(UnityEngine.Input.GetAxis("Mouse X")));
    18.         tweenHashtable.Add("time", tweenTime);
    19.         tweenHashtable.Add("space", "world");
    20.         iTween.RotateBy(gameObject, tweenHashtable);
    21.     }
    22. }
    23.  
     
    Last edited: May 16, 2016
    koblavi, daville, Stridemann and 2 others like this.
  4. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    Another great tutorial!
     
  5. daville

    daville

    Joined:
    Aug 5, 2012
    Posts:
    303
    @Stridemann

    I'm having this issue.... I'm testing compatibility with Easy Touch and it's having a weird behaviour.

    I need to make this code.

    Code (csharp):
    1.  
    2. using UnityEngine;
    3.  
    4. using HedgehogTeam.EasyTouch;
    5.  
    6. public class SimpleEasyTouch : UnityEngine.MonoBehaviour
    7. {
    8.     void OnEnable()
    9.     {
    10.         EasyTouch.On_DoubleTap += On_DoubleTap;
    11.         EasyTouch.On_SimpleTap += On_SimpleTap;
    12.     }
    13.     void OnDisable()
    14.     {
    15.         EasyTouch.On_DoubleTap -= On_DoubleTap;
    16.         EasyTouch.On_SimpleTap -= On_SimpleTap;
    17.     }
    18.     void OnDestroy()
    19.     {
    20.         EasyTouch.On_DoubleTap -= On_DoubleTap;
    21.         EasyTouch.On_SimpleTap -= On_SimpleTap;
    22.     }
    23.     public void On_SimpleTap(Gesture gesture)
    24.     {
    25.         Debug.Log("Some Tap");
    26.     }
    27.     public void On_DoubleTap(Gesture gesture)
    28.     {
    29.         Debug.Log("Some Double Tap");
    30.     }  
    31. }
    32.  
    if I parse it... it will, kinda make it, but it will break on line 10 when trying to subscribe to the function.

    it will get to this point and Not connect to the increment, not parse anything else.

    upload_2016-5-16_14-32-1.png

    If I connect it, it will work... and generate this code

    Code (csharp):
    1.  
    2. //MD5Hash:29dc2921a4fcc1d27a11e376698112c3;
    3. using UnityEngine;
    4.  
    5.  
    6. public class SimpleEasyTouch : UnityEngine.MonoBehaviour
    7. {
    8.  
    9.  
    10.     void OnEnable()
    11.     {
    12.         HedgehogTeam.EasyTouch.EasyTouch.On_DoubleTap += On_DoubleTap;
    13.     }
    14.     void OnDisable()
    15.     {
    16.     }
    17.     void OnDestroy()
    18.     {
    19.     }
    20.     public void On_SimpleTap(HedgehogTeam.EasyTouch.Gesture gesture)
    21.     {
    22.     }
    23.     public void On_DoubleTap(HedgehogTeam.EasyTouch.Gesture gesture)
    24.     {
    25.     }
    26. }
    27.  
    Now here comes the big problem

    If I try to make that 100% with nodes, I can't find the Node I need for the function

    EasyTouch.On_DoubleTap

    if I make a search, it doesn't show up.

    upload_2016-5-16_14-37-47.png

    All I can get are this Nodes...

    I don't know if I should be looking somewhere else.

    or if its a problem with the reflection, not finding something.
     
  6. Stridemann

    Stridemann

    Joined:
    Oct 12, 2013
    Posts:
    251
    @daville I think you use the old version of plugin v1.04 without events) The events was added in v1.05.

    I just make a test and "simulate" the EasyTouch code, works fine for me:


    Code (CSharp):
    1. //MD5Hash:12196a6c91b8d517aecedd2f2e9b87be;
    2. using UnityEngine;
    3.  
    4.  
    5. public class SimpleEasyTouch : UnityEngine.MonoBehaviour
    6. {
    7.  
    8.  
    9.     void OnEnable()
    10.     {
    11.         HedgehogTeam.EasyTouch.EasyTouch.On_SimpleTap += On_SimpleTap;
    12.         HedgehogTeam.EasyTouch.EasyTouch.On_DoubleTap += On_DoubleTap;
    13.     }
    14.     public void On_SimpleTap(HedgehogTeam.EasyTouch.Gesture gesture)
    15.     {
    16.     }
    17.     public void On_DoubleTap(HedgehogTeam.EasyTouch.Gesture gesture)
    18.     {
    19.     }
    20. }

    And the test code (coz I don't have that asset):
    Code (CSharp):
    1. namespace HedgehogTeam.EasyTouch
    2. {
    3.     public class EasyTouch
    4.     {
    5.         public static event HedgehogTeam.EasyTouch.GestEventDeleg On_DoubleTap = null;
    6.         public static event HedgehogTeam.EasyTouch.GestEventDeleg On_SimpleTap = null;
    7.     }
    8.     public class Gesture
    9.     {
    10.     }
    11.  
    12.     public delegate void GestEventDeleg(HedgehogTeam.EasyTouch.Gesture NewArgument);
    13.  
    14. }

    UPD. I add (fix) the prefix name for the static event nodes:
     
    daville likes this.
  7. daville

    daville

    Joined:
    Aug 5, 2012
    Posts:
    303
    Yes :D That works thanks.
     
  8. Stridemann

    Stridemann

    Joined:
    Oct 12, 2013
    Posts:
    251
    One more undocumented debug feature in the plugin: realtime changing the values of variables in the custom class variable. I think you should know about it)

    UPD. This feature was broken after I made some script saving "improvements") (for .nts files), but I fix it.
     
    daville and SteveB like this.
  9. Stridemann

    Stridemann

    Joined:
    Oct 12, 2013
    Posts:
    251
    The debug time machine! :D
    We can turn the time back and find the source of problem :)

    PS. This is a preview. I'm still working on..
     
    Last edited: May 17, 2016
  10. jeffyansu

    jeffyansu

    Joined:
    May 16, 2016
    Posts:
    2
    The vidio is quite easy to understand. Many thanks to you.
     
  11. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    Killer feature!!!
     
  12. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,500
    I agree with you, But...
    I did not understand your simple line c# code until I look into the visual scripting tool and I found "X" and "Z" on top of the windows. :p
    If you draw better the visual code helps. For example encapsulating the for loop in windows "Z" inside "X as the code do and using the same font size or zoom! Also is simple to Collapse the boxes and have only the title and explanation liked to the other elements making a big tree. So for looking fast the big picture is better a visual scripting. In shaders, visual scripting works very well and helps a lot.

    Don't make a Blender interface. The icons on top are too big and if they are reduce there is much more space for more icons. Look Photoshop, Rhino3D, Maya standard Icons.
     
    Last edited: May 21, 2016
    code-blep and zenGarden like this.
  13. daville

    daville

    Joined:
    Aug 5, 2012
    Posts:
    303
    That feature alone is a good Selling Point for Nottorus.

    I used to have an Asset that got deprecated, for Visual Debugging, that kinda did something similar, storing the values and then let you inspect them, but this is awesome.
     
  14. daville

    daville

    Joined:
    Aug 5, 2012
    Posts:
    303
    1.05 Now Available :D all this new features, make the workflow really smooth and fun to code with nodes :D

    @Stridemann
    I'm still testing compatibility with other Assets, and now I'm testing PoolManager for it to Work I need to do this:

    upload_2016-5-17_15-8-36.png

    It's kinda a Replacement for Unity's Instantiate, same parameters, but I need to call the specific Pool by name.

    I can't figure out how to type that with nodes.

    The parser tries to make that, by using a String Builder node
    but later it will complain that I can't put a string between [" "]
     
    SteveB likes this.
  15. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Can we see the accompanying graph?

    EDIT: One the of big selling points for me isn't being able to work with other assets (this is inevitable I suspect for any Unity dev) in Nottorus.
     
    Last edited: May 17, 2016
  16. Stridemann

    Stridemann

    Joined:
    Oct 12, 2013
    Posts:
    251
    @daville I suppose the "Pools" its a Dictionary<string, ???> static variable.
    1) Find the field "Pools" in the PoolManager class.
    2) Use the "get/set array element" node and connect it to Pools. Write "Particles" string and find the Spawn method from out pin:
     
  17. daville

    daville

    Joined:
    Aug 5, 2012
    Posts:
    303
    @Stridemann

    This is the normal C# code

    upload_2016-5-17_15-59-43.png

    After parsing it, it generates this

    upload_2016-5-17_16-0-32.png

    If I try to search for PoolManager or Pools I get nothing, but the parser generated that PoolManager.Pools Node.. so I'll try to do what you said

    and the Get Set Array node doesn't show the options for a Dictionary

    upload_2016-5-17_16-4-7.png

    it seems that Pools is a dictionary

    upload_2016-5-17_16-6-40.png


    upload_2016-5-17_16-8-3.png
     
  18. Stridemann

    Stridemann

    Joined:
    Oct 12, 2013
    Posts:
    251
    @daville Okay, I fix that. Reflection don't see the generic type in it, so I check the interfaces too and for now it works. I will send you the fix.

    You should enable the Assembly-CSharp-firstpass assemblies list (new nodes window) because its a Plugin.
     
    Last edited: May 17, 2016
    daville and SteveB like this.
  19. Stridemann

    Stridemann

    Joined:
    Oct 12, 2013
    Posts:
    251
    Good news.
    I made a preset for building the exe applications (console) in Nottorus) :cool:
    It will build the .exe file after script compilation.




    Code (CSharp):
    1.  
    2. using System;
    3. public class FirstConsoleApp
    4. {
    5.     public static string readLine = "";
    6.  
    7.     public static void Main()
    8.     {
    9.         System.Console.WriteLine("TestExe");
    10.         readLine = System.Console.ReadLine();
    11.         System.Console.WriteLine("Your string is: " + readLine);
    12.         while (true)
    13.         {
    14.         }
    15.     }
    16. }
     
    Last edited: May 18, 2016
    daville and SteveB like this.
  20. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    The hell is this thing?! I'm not sure I'm even fully appreciating what this beast is!! :D

    Wow...
     
  21. daville

    daville

    Joined:
    Aug 5, 2012
    Posts:
    303
    Yes :D

    It works perfect now :D

    upload_2016-5-17_18-57-54.png

    This is now, Nottorus Working perfectly with PoolManager , I'm also have it now running perfectly with EasyTouch and with Chronos, and also iTween with no problems in the same project... and using Inheritance, delegates, a lot of things.

    This is trully great, and the update speed if something is missing is amazing.

    You should not be afraid of compatibility problems with Nottorus and other Asset, Most cases will work out of the box, and the few isolated cases, will be quickly fixed, and solving that for one case, solves it for many future cases, so the tool will only get better.
     
    Yukichu, MrMetwurst2 and SteveB like this.
  22. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    I'm seeing this now! Yea no reason not to pull the trigger... :D
     
  23. MrMetwurst2

    MrMetwurst2

    Joined:
    Jul 16, 2009
    Posts:
    253
    Awesome! That will be so useful!

    So it is! I didn't even know it was released yet! That was a nice surprise.
    Did I miss the change log somewhere?
     
  24. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Okay to begin my noob questions, I did a quick parse test and came across two instances that work in the script, but not in node form...

    ..the first one:

    Code (CSharp):
    1.  
    2. public GameObject characterBody;
    3.  
    4. if (characterBody) targetCharacterDirection = characterBody.transform.localRotation.eulerAngles;
    ...so of course if characterBody is true, do all that S*** after. Thing is in node form we get:

    CharacterBodyBool.JPG

    My next issue is why this works in script:

    Code (CSharp):
    1. public Vector2 targetDirection;
    2.  
    3. targetDirection = transform.localRotation.eulerAngles;
    4.  
    5. ...
    6.  
    7. var targetOrientation = Quaternion.Euler(targetDirection);
    8.  
    ...but in node form it doesn't work:

    TargetEulerVector2.JPG

    ...being that the targetDirection is a Vector2 and the euler input on Quaternion.Euler wants a Vector3.

    I understand I can convert from Vec2 to Vec3, but why does it work in code?

    Either way forgive me if this is basic, but I'm going to finish watching the Cubs game and go to bed! The real important takeaway here is now I'm officially apart of the inner circle lol!

    Cheers guys

    -Steven
     
    Rixtter likes this.
  25. daville

    daville

    Joined:
    Aug 5, 2012
    Posts:
    303
    I would do that like this

    upload_2016-5-17_21-34-33.png

    and this is the output code

    Code (csharp):
    1.  
    2. //MD5Hash:34d3ebd7a8b36a4cd6dc629e0f3f0347;
    3. using UnityEngine;
    4.  
    5.  
    6. public class TestingStuff : UnityEngine.MonoBehaviour
    7. {
    8.     public UnityEngine.GameObject characterBody = null;
    9.     public UnityEngine.Vector3 targetCharacterDirection;
    10.     public UnityEngine.Vector2 targetDirection;
    11.     public UnityEngine.Quaternion targetOrientation;
    12.  
    13.  
    14.     void Start()
    15.     {
    16.     }
    17.     void Update()
    18.     {
    19.         ///if (characterBody) targetCharacterDirection = characterBody.transform.localRotation.eulerAngles;
    20.         if ((characterBody != null))
    21.         {
    22.             ///if (characterBody) targetCharacterDirection = characterBody.transform.localRotation.eulerAngles;
    23.             targetCharacterDirection = characterBody.transform.localRotation.eulerAngles;
    24.         }
    25.  
    26.         ///public Vector2 targetDirection; targetDirection = transform.localRotation.eulerAngles;
    27.         targetDirection = (UnityEngine.Vector2)transform.localRotation.eulerAngles;
    28.         ///var targetOrientation = Quaternion.Euler(targetDirection);
    29.         targetOrientation = UnityEngine.Quaternion.Euler((UnityEngine.Vector3)targetDirection);
    30.     }
    31. }
    32.  
    33.  
    34.  
     
    SteveB likes this.
  26. Stridemann

    Stridemann

    Joined:
    Oct 12, 2013
    Posts:
    251
    From a point of view of reflection the "GameObject" can't be connected to the "bool" type. Yes, I know, it works in code. I will think how to fix this.. In Nottorus it can be released with "IsNull" and "NOT" (inverter) nodes.
    Its a "public static implicit operator bool(Object exists);" so it can be converted to a bool. I shoud make a check for this thing.

    The same. I fix this, but I also want to have some logical explaning fo this implicit conversions (why the vector2 can be set to a vecor3 variable), and I need to learn the Nottorus to do this things.
    Okay, I found it: "public static implicit operator Vector2(Vector3 v);".
     
    Last edited: May 18, 2016
    SteveB likes this.
  27. Stridemann

    Stridemann

    Joined:
    Oct 12, 2013
    Posts:
    251


    ...and I try to make a window forms application. Its a test and just for fun.
    So I copy few dll's (System.Windows.Forms.dll, System.Drawing.dll, etc.)(from C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client) to my project. It's really hard to make unity works with this dlls. But anyway I did this:

    :p
     
    unitywlp, SteveB, MrMetwurst2 and 2 others like this.
  28. daville

    daville

    Joined:
    Aug 5, 2012
    Posts:
    303
    LOL that's nice
     
  29. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736

    Genius!!!
     
  30. koblavi

    koblavi

    Joined:
    Oct 1, 2010
    Posts:
    52
    You my friend, are a Genius!! Please build this tool as an add-on for visual studio or Xamarin already! What is such powerful tool doing sitting inside just Unity?
     
    AlanMattano likes this.
  31. rahuxx

    rahuxx

    Joined:
    May 8, 2009
    Posts:
    537
    Something like this makes nottorus worth 250$.

    Still I am far from it.
     
  32. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Awesome Daville, thank you for going the extra length to show the solution. My concern was moreso that during the Parsing, these common means of coding were not getting parsed correctly.

    Might not be a bad idea to have a page either in the docs or on the nottorus forums that showcase situations like this as mini tips and tricks and pitfalls to avoid yadda yadda, even though ulimately Stridemann already fixed the issue lol

    Cheers

    -Steven
     
  33. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Lol that was quick!

    Yup this is exactly what I was looking for when I posted my question. Originally, I never even noticed that I had a Vec2 parameter in what typically asks for a Vec3 in the script.

    These quick solutions and updates are what gives me confidence in this asset. Awesome man thank you

    -Steven
     
  34. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,500
    My friend I think Unity and this tool need a editor add-on as for example Visual Studio for plug in.
     
  35. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Daville, in your image, what is that node between targetDirection and Quaternion.Euler, which is converting Vec2 to Vec3?

    One problem I am finding in Nottorus is finding what it is I want to do, hmmm...


    EDIT: Found it.../Data/ 'as' (T) ...and this is where I'm going to further show my noob-ness. What is that exactly? (I understand it's a conversion, just why is it named as such)
     
    Last edited: May 18, 2016
    daville likes this.
  36. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Okay so this didn't work so I'm wondering if I could get more experienced eyes on this.

    Here's the actual ForRealz.tm script (for no real reason, I was just creating MouseLook's in each of the various visual scripting assets) also (not my code):

    Code (CSharp):
    1.  
    2. using UnityEngine;
    3.  
    4. [AddComponentMenu("Camera/Simple Smooth Mouse Look ")]
    5. public class SimpleSmoothMouseLook : MonoBehaviour
    6. {
    7.     Vector2 _mouseAbsolute;
    8.     Vector2 _smoothMouse;
    9.  
    10.         // Assign this if there's a parent object controlling motion, such as a Character Controller.
    11.         // Yaw rotation will affect this object instead of the camera if set.
    12.     public GameObject characterBody;
    13.  
    14.     public Vector2 clampInDegrees = new Vector2(360, 180);
    15.     public bool lockCursor;
    16.     public Vector2 sensitivity = new Vector2(2, 2);
    17.     public Vector2 smoothing = new Vector2(3, 3);
    18.     public Vector2 targetDirection;
    19.     public Vector2 targetCharacterDirection;
    20.  
    21.  
    22.     void Start()
    23.     {
    24.             // Set target direction to the camera's initial orientation.
    25.         targetDirection = transform.localRotation.eulerAngles;
    26.  
    27.             // Set target direction for the character body to its inital state.
    28.         if (characterBody) targetCharacterDirection = characterBody.transform.localRotation.eulerAngles;
    29.     }
    30.  
    31.     void Update()
    32.     {
    33.             // Ensure the cursor is always locked when set
    34.         Screen.lockCursor = lockCursor;
    35.  
    36.             // Allow the script to clamp based on a desired target value.
    37.         var targetOrientation = Quaternion.Euler(targetDirection);
    38.         var targetCharacterOrientation = Quaternion.Euler(targetCharacterDirection);
    39.  
    40.             // Get raw mouse input for a cleaner reading on more sensitive mice.
    41.         var mouseDelta = new Vector2(Input.GetAxisRaw("Mouse X"), Input.GetAxisRaw("Mouse Y"));
    42.  
    43.             // Scale input against the sensitivity setting and multiply that against the smoothing value.
    44.         mouseDelta = Vector2.Scale(mouseDelta, new Vector2(sensitivity.x * smoothing.x, sensitivity.y * smoothing.y));
    45.  
    46.             // Interpolate mouse movement over time to apply smoothing delta.
    47.         _smoothMouse.x = Mathf.Lerp(_smoothMouse.x, mouseDelta.x, 1f / smoothing.x);
    48.         _smoothMouse.y = Mathf.Lerp(_smoothMouse.y, mouseDelta.y, 1f / smoothing.y);
    49.  
    50.             // Find the absolute mouse movement value from point zero.
    51.         _mouseAbsolute += _smoothMouse;
    52.  
    53.             // Clamp and apply the local x value first, so as not to be affected by world transforms.
    54.         if (clampInDegrees.x < 360)
    55.             _mouseAbsolute.x = Mathf.Clamp(_mouseAbsolute.x, -clampInDegrees.x * 0.5f, clampInDegrees.x * 0.5f);
    56.  
    57.         var xRotation = Quaternion.AngleAxis(-_mouseAbsolute.y, targetOrientation * Vector3.right);
    58.         transform.localRotation = xRotation;
    59.  
    60.             // Then clamp and apply the global y value.
    61.         if (clampInDegrees.y < 360)
    62.             _mouseAbsolute.y = Mathf.Clamp(_mouseAbsolute.y, -clampInDegrees.y * 0.5f, clampInDegrees.y * 0.5f);
    63.  
    64.         transform.localRotation *= targetOrientation;
    65.  
    66.             // If there's a character body that acts as a parent to the camera
    67.         if (characterBody)
    68.         {
    69.             var yRotation = Quaternion.AngleAxis(_mouseAbsolute.x, characterBody.transform.up);
    70.             characterBody.transform.localRotation = yRotation;
    71.             characterBody.transform.localRotation *= targetCharacterOrientation;
    72.         }
    73.         else
    74.         {
    75.             var yRotation = Quaternion.AngleAxis(_mouseAbsolute.x, transform.InverseTransformDirection(Vector3.up));
    76.             transform.localRotation *= yRotation;
    77.         }
    78.     }
    79. }
    80.  
    Nottorus created a wall of nodes, and thankfully I only had the two aforementioned issues with the GO to bool and Vec2 to Vec3. After these easy fixes the code Nottorus spit back out was:

    Code (CSharp):
    1. //MD5Hash:47df2e9aea7d761ba3fe23ddedc42570;
    2. using UnityEngine;
    3. using System;
    4.  
    5.  
    6. [AddComponentMenu("")]
    7. public class SimpleSmoothMouseLookNottorus : UnityEngine.MonoBehaviour
    8. {
    9.     public UnityEngine.Vector2 _mouseAbsolute;
    10.     public UnityEngine.Vector2 _smoothMouse;
    11.     public UnityEngine.GameObject characterBody = null;
    12.     public UnityEngine.Vector2 clampInDegrees = new UnityEngine.Vector2(360f, 180f);
    13.     public bool lockCursor = false;
    14.     public UnityEngine.Vector2 sensitivity = new UnityEngine.Vector2(2f, 2f);
    15.     public UnityEngine.Vector2 smoothing = new UnityEngine.Vector2(3f, 3f);
    16.     public UnityEngine.Vector2 targetDirection;
    17.     public UnityEngine.Vector2 targetCharacterDirection;
    18.  
    19.  
    20.     void Start()
    21.     {
    22.         targetDirection = (UnityEngine.Vector2)transform.localRotation.eulerAngles;
    23.         if ((characterBody != null))
    24.         {
    25.             targetCharacterDirection = (UnityEngine.Vector2)characterBody.transform.localRotation.eulerAngles;
    26.         }
    27.  
    28.     }
    29.     void Update()
    30.     {
    31.         UnityEngine.Screen.lockCursor = lockCursor;
    32.         var targetOrientation = UnityEngine.Quaternion.Euler((UnityEngine.Vector3)targetDirection);
    33.         var targetCharacterOrientation = UnityEngine.Quaternion.Euler((UnityEngine.Vector3)targetCharacterDirection);
    34.         var mouseDelta = new UnityEngine.Vector2(UnityEngine.Input.GetAxisRaw("Mouse X"), UnityEngine.Input.GetAxisRaw("Mouse Y"));
    35.         UnityEngine.Vector2.Scale(mouseDelta, new UnityEngine.Vector2((sensitivity.x * smoothing.x), (sensitivity.y * smoothing.y)));
    36.     }
    37. }
    38.  
    39.  
    As you can see that appears quite incomplete. Thoughts?

    Also on a slightly related note, is renaming the .NTS file in the Project window the only way to get it to match the classname (upon renaming the class)?

    Thanks guys!

    -Steven
     
  37. rahuxx

    rahuxx

    Joined:
    May 8, 2009
    Posts:
    537
    OOOH!
    I just have one question to all users why exactly we parse the script to nodes? The VS tool is made for Script to Node, why the path is reversed. Tweaking a code is much more easy than understanding complex VS graph and than tweaking it. Little our of my understanding range.
    :eek:
     
  38. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Oh well I'm not a pro-coder, but I do code (more in JS than C#) and I understand code very well, but I have have a much harder time with doing anything with someone elses code, especially if it isn't commented. At that point it's easier to just burp out the nodes and parse that, granted that it works correctly (see my last post).
     
  39. koblavi

    koblavi

    Joined:
    Oct 1, 2010
    Posts:
    52
    Just to add onto that, you can do visual debugging on parsed scripts which now even allows you to time travel through execution.
     
    daville, rahuxx and SteveB like this.
  40. rahuxx

    rahuxx

    Joined:
    May 8, 2009
    Posts:
    537
    I still feel it is harder to understand VS graph parsed from other programmers code if you can not understand the actual flow of the script written by him. Time travel is different thing I feel
     
  41. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    If it works correctly, I should be able to locate/isolate functions and events, and subsequently more easily parse (mental parsing) the incoming parameters and such. Don't get me wrong there's no easy path, but I do well with Visual Scripting.

    Perhaps experience from the Virtools and Quest3D days? :D
     
    rahuxx likes this.
  42. jimmy_doodle

    jimmy_doodle

    Joined:
    Nov 8, 2015
    Posts:
    22
    Congrats! It's looking damn great! :)
     
  43. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Another couple things while playing around:

    • Changing colors in Options does nothing
    • How do I create my own Templates
    • I have another script I parsed into nodes, fixed one small error with an errant pin and hit Compile...I get a red exclamation mark but no errors listed in the console. None of the Class Functions have any issues that I can see
    Thanks!

    -Steven
     
    Last edited: May 19, 2016
  44. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Oh and I get this error in Unity Console

     
  45. daville

    daville

    Joined:
    Aug 5, 2012
    Posts:
    303

    As I see it.

    The parser is Nice, but I won't be actually using it a lot on a real workflow.... My main uses for the Nottorus Parser are:

    - Teaching tool

    I've been using it a lot while learning, I code a little bit, and parsed just that couple lines of code to nodes to understand how Nottorus works.

    But as I get more experienced on this I won't be needing that anymore.

    - Bulk setup things to save time

    if I know in advance I have to make a lot of variables and the types and names I'm going to use, or similar stugg, I would start my new script as a C#, set up my basic stuff there like 10 variables with proper names and types and access... then parse that script and keep working from there with nodes... just to save some time.

    - Not having to switch between VisualStudio or MonoDevelop, to Nottorus, when working with C# scripts and Nottorus Scritps.

    This is a bit tricky, since it's not really needed.
    you can have mixed scripts in your project and they will work fine.
    You can have your Player coded with C# and your Enemies with Nottorus, and they can call eachother with no problem.
    And also you don't need to Parse to Codes every script, from plug ins and that, so, this is reall not needed.

    I don't think I'll ever want to do that, but in the case I'm constantly changing between Code and Nodes, I think I could do that just to not having to switch windows... but honestly I don't think I'll ever do that... I will just leave them as they are.

    - Debugging Already existing C# code

    To take good advantage of those features, I may do that, but I really don't think I will.

    - If someone learns to program just with Nodes, and want to follow a tutorial or something

    In that case, I think it could come handy for some people, but again I don't think I'll ever do that or need it.

    - To find what is not currently implemented in Nottorus

    I've been using it a lot to test the Tool and report some cases wich Nottorus can't handle, but all of the cases I've found get fixed in a couple hours XD, Stridemann is really fast... and eventually there will be less and less things Nottorus can't handle.

    -------------------------

    Those are the main uses I see for the Parse, it is really nice... but eventually I don't think I'll be using it much.

    I've been working on a Freelance Game for a couple months now, and last week I had to rewrite most of the player controller and the AI because some changes from my client and some weird behaviour.

    So I said "Why not?" and last week I started ReCoding Everything with Nottorus :D

    I already know most of the logic, so is not that painful... simple scripts I'm parsing them and then just re arranging the nodes.

    Big Scripts I'm not doing that, since the parser sometimes throws some Nodes that could be placed better, because they're are all over the place.... or sometimes makes reduntant things that make sense but could use other nodes to do the same.

    So far in about 4 days nonstop I already have like 80% of my previous work ReMade Totally in Nottorus :D plus I fixed the things and making the new changes from the client.

    I'm planning to finish the game in another 2 months or so... So after I finish it... I will post about it, and will proudly be saying "Coded 100% with Nottorus (except for plugins)"
     
  46. Stridemann

    Stridemann

    Joined:
    Oct 12, 2013
    Posts:
    251
    I saw few serious problems in Nottorus and I made a new update.
    The "NOT"(inverter) node was compiling without brackets and it cause the problems (and errors) like:
    if( !gameobject == null)
    , should be:
    if(!(gameobject == null))
    .
    In some cases the Nottorus reflection (searching nodes) don't want to starts automatically and the nodes list was empty.


    v1.06
    :
    Fixes:
    - Fixed the bug when the classes with generic interfaces (IDictionary<,>) was not correctly recognised by the Get/Set array element node.
    - Fixed bug when nodes list window in some cases don't want to start searching the nodes in reflection (for example after the creating a new script).
    - Type select window was broken if use the filter before reflection finish searching types.
    - Fixed the incorrect compilation of "NOT" node.
    - Clicking on pin value constructor box does not select the node.
    - Copy/paste operations while editing text can cause the node was copied too.

    Features:
    - Debug time machine (recording the debug timeline of debug values).

    Improvements:
    - Added the "Console application" preset in the "New script" window.
    - Added implicit convertion check for linking pin types (GameObject -> bool, Vector2 -> Vector3).
    - System: Nodes graph optimisations ("allow to connect pin Type to other Type" check).

    Parser fixes:
    - Fixed bug when nodes list window don't want to start searching the nodes after parsing/reparsing.
    - Fixed the "yield return" parsing.

    Nodes:
    - "yield return value" - removed from the list of nodes (deprecated).
    - "yield return" - for now can return a custom value (i make it universal and you can chose the type of return value).
     
    Last edited: May 19, 2016
  47. RD

    RD

    Joined:
    Jan 3, 2013
    Posts:
    65
    "recording the debug timeline of debug values" lets me eliminate tons of probe code needed to watch objects interacting over time! The debug timelines built into Nottorus really sets Nottorus apart from other tools for coding, integrating, debugging, studying, training, code reviews, etc...

    This is a stunningly good update! Thanks, Stridemann.
     
    Last edited: May 19, 2016
  48. daville

    daville

    Joined:
    Aug 5, 2012
    Posts:
    303
    v1.06 in less than 2 months this tool has grown a lot.

    Everything is going really good :)
     
    TechnicalArtist and rahuxx like this.
  49. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
  50. Stridemann

    Stridemann

    Joined:
    Oct 12, 2013
    Posts:
    251
    Sorry, I forgot to answer..
    I got no errors while parsing, but I got few serious problems after parsing in Math nodes (not correct pin types, double instead of float, and it cause an errors while compiling), quaternion * vector (the vector3 should be a result, but not quaternion) and with var node. I already fix them all and now it works fine in v1.06.

    v1.06 added:
    Fixes:
    - Fixed incorrect out pin in "math node" (in case multiplying Quaternion and Vector3).

    Parser fixes:
    - Fixed incorrect pin types in math node after parsing.
    - Fixed incorrect initialisation the "Unary" node after parsing.
    - Fixed problems with parsing some static methods from unity engine asseblies (for example UnityEngine.Quaternion.Euler(Vector3 euler)).

    @SteveB send me a PM if you want to get this update faster.
     
    Last edited: May 20, 2016