Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

FlowCanvas - Visual Scripting Similar to Unreal Blueprints

Discussion in 'Assets and Asset Store' started by nuverian, Apr 14, 2015.

  1. SONB

    SONB

    Joined:
    Jul 24, 2009
    Posts:
    89
    Oh yesss!
    Gonna buy it as soon as it's accepted. Thank you!

    One more question: What's the purpose of the Identity node? I've seen one in the Space Invader Example (Identity<Game Object>) and can't wrap my head around what it does.
     
  2. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    I already asked in the nodecanvas thread but i think it would be intrresting for both sides:
    Is there a discount for node canvas/lite for happy flow canvas customers? :)
     
    SONB likes this.
  3. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    Oh, hey! I just relized something.... Bad.
    So i did this game only using flowcanvas:


    Was fun to do and worked great!
    But i just wanted to check if i have to take care of something when i make a build of an flowcanvas game for ios. And then i saw that ios is not supported :-O
    So, will it just not work or will just special things not work?
    Cheers!
     
  4. SONB

    SONB

    Joined:
    Jul 24, 2009
    Posts:
    89
    After a couple of minutes of working in FlowCanvas I notice a lot of lag when dragging around and connecting nodes. After a short start and stop of the game everything is smooth again. A couple of minutes later the lag is back, a short Ctrl+P and it's gone. Is this a known issue or is there something on my end?
     
  5. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Thanks !
    The Identity node is simply for organization purposes. It simply outputs/returns the value that is given in the input. Nothing more going on there :)

    Cheers!

    Hey again,
    Glad to know you enjoy FlowCanvas. I will add a discount from one to the other in the next couple of days, once the new updates are live! :)

    FlowCanvas doesn't yet support AOT-only platforms, which inlcude iOS, but this is about to change very soon, right after holidays! The game looks cool by the way! Very glad to see that :)

    The new version that is still pending review by the asset store team, has a significantely faster editor improvement.
    Regarding play/stop and editor smoothness, this is something that certainly don't happen on my end. I will take a better look tomorrow to see if I can find anything that relates to this, even though I think that you won't encounter this in the new version.

    Cheers!
     
    Der_Kevin likes this.
  6. SONB

    SONB

    Joined:
    Jul 24, 2009
    Posts:
    89
    Thank you @nuverian!
    Just bought NodeCanvas full version... A-MA-ZING piece of software!

    Your website says that I can integrate FlowCanvas inside NodeCanvas, but the documentation doesn't mention how to do it. I looked through all the nodes and options but couldn't find anything related to FlowCanvas. Are there any requirements or limitations which prevent me to integrate a FlowCanvas?

    PS: Regarding the performance of FlowCanvas. I forgot to mention that I added a LOT of nodes (80 - 90) in one canvas.
     
  7. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    Have you tried thos already:
    http://flowcanvas.paradoxnotion.com/downloads/

    There is a nc fc bridge file. Havent test it yet
     
  8. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    Thanks a lot! And thanks for your kind words, I am glad you like! :)
    Yes, you need to download the extension packages from the website like @Der_Kevin mentioned.

    Once you donwload and import BehaviourTree bridge for example, you will be able to add a Nested FlowScript node within the Behaviour Trees. I will write up a new section in the documentation regarding integration of the two assets soon. Indeed that's something needed.
    Let me know if you have any problem with these.

    The new version (still pending review) has much faster editor even for a lot of nodes :)

    Thanks again!

    Thanks!
     
  9. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    also, some sidenotes from a mac (macbook) user
    deleting a Node(?) doesent work with backspace since we dont have a DEL button ;)
    the tilde button for the beta - searchfield still doesent work :( //oh, its space now :D

    would it also be possible to somehow use the trackpad scrolling(with 2 fingers mostly) to scroll around in the flowcanvas? 2 fingers are for zooming right now, i know. but i would prefer to use this for scrolling. also, dragging the scrollbar seams not to work at the moment?
     
    Last edited: Dec 31, 2015
  10. SONB

    SONB

    Joined:
    Jul 24, 2009
    Posts:
    89
    Thank you guys!
    I don't know why I ignored the Extension packages all the time...
     
    Der_Kevin likes this.
  11. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    I have another question/suggestion ;)

    what would be the best way to replace a Node?
    for example: i have a AddTorque (Vector3,Force Mode) Node but later i decide i need a AddTorque (Float,Float,Float,Force Mode) or AddTorque (Float,Float,Float) Node
    at the moment, the only way to do this is to erase one node and search for the other. great would be something like right click>replacer> a list of all same nodes.
    because sometimes i am not really sure which node i need. so i pick one, and realize its the wrong. and have to search again, you know?
     
  12. SONB

    SONB

    Joined:
    Jul 24, 2009
    Posts:
    89
    Hey @nuverian, here is just a cosmetic issue:

    cast_icon.PNG

    There is no cast icon inbetween. Can I fix it on my own? Where should I look?
    Thanks!
     
  13. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Best of wishes for a Hapy New Year!!

    Hey!
    Sure, I will add Backspace for delete alternative, and will take a look at how 2-finger scrolling could be implemeted if somehow.
    The scrollbars, well.. aren't really ment to be scrollbars, but more like indicators of the nodes whereabours relative to the canvas, since scrolling/pan can easily be done with middle mouse button, unless of course you don't have a middle mouse button in which case is a bit more tedious like ALT+Click and Drag.
    Thus, your 2-finger scrolling suggestion suddently just got more gravity :)

    I've just added your suggestion and will be in the next update. It's now possible to right click a node and there will be a new menu item for replacing the node with other overloaded methods.
    Thanks !

    Hey!
    Thats very weird :/
    Do you see the cast icon in any link at all, or only at specific links?

    Thanks!
     
    Der_Kevin likes this.
  14. SONB

    SONB

    Joined:
    Jul 24, 2009
    Posts:
    89
    Thanks, best wishes to you too!

    Not at all, actually, I'v never seen this icon in my Editor yet. If I haven't seen it on your product screenshots I would think it's how it should look :)
     
  15. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Thanks!
    I see :) It seems to be a problem with font icons like this (it's not an actual image, it's rather a font character there). I will have to take a closer look at this, since I can't really think of a reason that this is happening right now. I will post back as soon as I have a lead on this.
    Are you on Unity 5.3.1p1 and/or Windows 10 by any chance?

    Thanks for letting me know!
     
  16. SONB

    SONB

    Joined:
    Jul 24, 2009
    Posts:
    89
    Oh, I guess that's why I don't see those arrows in front of event titles as well?

    no_arrow_icon.PNG

    And yes to both, Unity 5.3.1p1 and Windows 10.
     
  17. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    I am still looking at the cause of the issue, but yeah. That's thea reson you also don't see the Event nodes icon.
    Will get back to you as soon as I find the cause.
    Thanks!
     
  18. TheSignal

    TheSignal

    Joined:
    Jun 1, 2014
    Posts:
    2
    Hi nuverian,

    Just picked up flowCanvas yesterday, really liking it so far.

    However, is there a better way to pass variables like integers between gameobjects other than the Send Event way?

    Worded another way, if I have one variable called Health on a game object, and another game object with a variable called Damage, both using different FS, what would be the best way to do something like, OnCollision reduce Health by Damage?
     
  19. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,

    Thanks for getting FlowCanvas! I am glad you like it :)
    I have attached for you here a new node with which it's possible to set a variable on another blackboard directly.
    SetOtherVariable.png
    This node can be found under "Variable/Set Blackboard Variable/Set Other Of Type<T>" and will be included in the next version.

    Let me know if this works for you :)
    Cheers!
     

    Attached Files:

    GamerPET likes this.
  20. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    370
    Hello guys,

    I'm trying to learn how to use FlowCanvas. I'm still pretty confused even after watching the SpaceInviders game.

    I want to start super simple. I have an object in my scene. In my case is a light. I want to make the light to move left/right - up/down when I press the arrow keys.

    I would know how to do this with PlayMaker but with FlowCanvas is pretty different.

    So all I have now is something like this:


    Yea nothing much :p At least I was able to add the Flow Script Controller to the object... and I managed to create an event that when the "INPUT AXIS (PRESET)" is ... pressed... I sent a text to the console. YAY!

    So my question is, how would you do this with FlowCanvas? As I have said, I want to move the light to left/right - top/bottom when I press the arrow keys. The light will only move on the X & Y axis. No need for Z yet.

    Also, I want to keep moving the light as long as I keep the button pressed.

    Thank You <3
     
  21. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,

    FlowCanvas is very different from playmaker in many ways :)
    Here is the simple way of how you can do what you are after:
    1.png

    And here is the "extended" way, that takes delta time into consideration as well as a speed parameter (in this case 1):
    2.png

    Let me know if you have any questions :)
    Cheers!
     
    GamerPET likes this.
  22. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    370
    Who this was so easy. One small problem... is that when I press the left arrow my "light" moves right. So I need the control the other way around.

    EDIT:
    What I did is something like this:



    Is there a more efficient way?

    EDIT2:

    As usual I like to take something and improve upon it. I was thinking on making the "light" to on the Z axis if I press A / Z on keyboard. I created a INPUT Keyboard and I wanted to connect it to a new DELTA Timed ... however it says that it can't be connected. Any ideas?
     
    Last edited: Jan 8, 2016
  23. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,

    The best way would be to invert the variable instead of creating 2 variables. To save you from the trouble, here is a node to invert a float, which will be included in the next version. Please open up Math.cs file and paste this code in there.
    Code (CSharp):
    1.     [Category("Functions/Math/Floats")]
    2.     [Name("Invert")]
    3.     public class FloatInvert : PureFunctionNode<float, float>{
    4.         public override float Invoke(float value){
    5.             return value * -1;
    6.         }
    7.     }
    Then you can simply do this:
    invert.png

    Regarding your question about using A / Z, the way to do this would be to use Unity's Input Manager to create your custom A/Z input and then in flowcanvas use InputAxis(custom) instead of InputAxis(preset), which will give you this:
    InputCustom.png

    By the way, the reason you can't connect the outputs of the Keyboard event is because you generaly can't connect what is called 'Flow Ports' (the bold ones with the triangle next to them) to 'Value Ports'. Please take a look at this doc section if you are unsure what I mean by that.

    Cheers!
     
  24. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    370
    Final Version:


    It wasn't even hard. Never worked with Unity Input Axis. So basically I created a new axis called Depth and I made it to the keyboard buttons Q and E.

    Then I attached that Axis (Depth) to the Z axis.

    MAGIC!
     
  25. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    Awesome guys! I want to see more of these small things!
    this "Invert" Node idea is great! 7 lines but super effective
     
  26. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    370
    Just for future reference for other people who are still learning how to use this.

    I asked a programmer, colleague of mine to do what I asked on top. Basically I wanted to also move the object on the Z axis.

    He didn't knew how to use the tool since he never used it so I only gave him minimum info. After 20 minutes he came up with this:



    Basically what he did ... he created a variable that was defaulting to 0... and he told Z to be on 0.
    Then he created 2 keyboard inputs J & I. So what he did was... that when you press J or I ... he was changing the value of the variable to 1 or -1 ... and since that variable was tied up to Z axis... the object was starting to move!

    Of course, I told him about the INPUT AXIS (CUSTOM) and we did it the right way.

    I thought this was a good example on how something like this works.
     
  27. Alexarah

    Alexarah

    Joined:
    May 1, 2014
    Posts:
    110
    What's up Nuverian I've had Flow Canvas for a while now and Node Canvas a lot longer and I must both are marvelous! Oh by the way Nuverian are you planning to add more detail to the documentation on your website because I find it's not informative enough. But anyway Flow Canvas has become my favorite visual tool next to Playmaker while Node Canvas has become my favorite AI solution!:)
     
  28. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Sorry for the late replies everyone :)

    Hey,
    Thinking of this, you could also use the following delta timed node, that works with a Vector3, thus saving up a couple of nodes and making this work with Vectors directly.
    Code (CSharp):
    1.     [Category("Functions/Utility")]
    2.     public class DeltaTimedVector3 : PureFunctionNode<Vector3, Vector3, float>{
    3.         public override Vector3 Invoke(Vector3 value, float multiplier){
    4.             return value * multiplier * Time.deltaTime;
    5.         }
    6.     }
    DeltaTimeVector.png

    Cheers!

    Hey,
    This back and forth elaboration really helps in such things and I really enjoy this :)

    Hey,
    Thanks a lot! I really appreciate that :)
    Do you have any specific field/section on which you would like to see the documentation expanded towards?
    Thanks again!
     
  29. Rixtter

    Rixtter

    Joined:
    Mar 31, 2014
    Posts:
    244
    Hey all,

    I've bought Blox2, Playmaker, BehaviourMachine, iCanScript, GameFlow & probably more I can't think of... but still haven't found a home. I've just downloaded uScript PE and have bought tutorials to get started.

    I search Visual Scripting most days on the store, and have kept an eye on FC. Honestly didn't have it as a contender because I want iOS support. Now I see Nuverian has it on his radar, so FC is back on mine.

    I am an old coder who can work with C# if I need to, I just prefer to play with the visual end as a hobby.

    So... the other tools have flaws I won't go into. My thoughts now are FlowCanvas or uScript.

    I also own Behavior Designer, so I'm leaning toward uScript... saves me buying NodeCanvas equivalent... then I seen an earlier post with someone moving across from uScript. Can anyone spare time for some thoughts? I know the C# argument, but doesn't matter for my hobby.

    Sorry Nuverian, I know you will have a Personal Edition at some point... but I'll make the decision on opinion if I can get some discussion going...

    Rix
     
  30. Rixtter

    Rixtter

    Joined:
    Mar 31, 2014
    Posts:
    244
    Sod it, never mind... I'm going to buy it... Nuverian looks like you are the man !!
     
  31. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    @Rixly239
    Hey,
    Thanks for your interest in FC. I won't go about saying my own opinion about FC over uScript since, well... it's obviously a biased opinion :) Of course I don't mind if others want to share theirs here, so there is no apology needed at all.
    iOS support is indeed comming soon by the way.

    If you have any question I can help with, by all means don't hesitate to ask away :)
    Thanks again!
     
  32. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello everyone.

    I have uploaded the first 3rd party asset integration that being with DOTween :)
    You can download the extension here.

    DOTween.png

    Cheers!
     
  33. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    Nice!
    By the way, any news about the nodecanvas discount ;)
     
  34. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    The discount is already available from FC to NC. I forgot to post about it :)
    Thanks!
     
  35. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello everyone. The new version 1.0.2 is now live on the asset store :) Here are the changes:
    • Added CharacterController event node.
    • Added "Replace Method" in reflected nodes to replace it with an overloaded method if some are available.
    • Added "Set Other Blackboard Variable" node.
    • Blackboard Variables can now also be bound to fields.
    • Added new connection style preference "Straight Lines".
    • Fixed deserialization recovery from missing nodes.
    The next update will have iOS support, along with some new nifty features in the works!
    Also a series of 3rd party asset integrations will follow. Post your suggestions if you wish here :)

    Cheers!
     
  36. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    370
    Thanks for the updates Vaggelis (not sure which one is your first name :p )

    I'm still trying to get my head around on how to do some things with FlowCanvas... so I decided to just come here to get some tips.

    How would you do this with FlowCanvas:

    I have an empty GameObject... let's call it "Deck".
    Under Deck I have a number of other GameObjects ("Cards").

    1. When I press a button I want to start a function in FlowCanvas. How can I call a function in FlowCanvas when I press a UI button?

    2. With this function I want to Randomly pick a child GameObject from "Deck" and move it as a child of another GameObject. So basically I want to pick a Card from my Deck and move it on the "Board".

    Another thing that I would like to do is:
    The object that I'm randomly picking is going to come into the scene. I want to get the POSITION of the last "card" that is on the board. Then I want to place this new card right next to the card already existing on the board.

    Does this make sense?

    Thanks
     
  37. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    My first name is Vaggelis indeed :)

    Here is how the first part could be done:
    When UI button is clicked, we set the variable named "Card" (for late use) by getting it at random from the transforms of Deck1, then set it's parent to Deck2.
    SetParent.png

    Then for setting the Card's position, I set it by taking the total length of the transforms under Deck2 and multiply it by a "spacing" variable, so for example if the card added was 5th, it's local position x in ralation to it's Deck2 parent, would be 5 * spacing.
    SetPosition.png


    Notice, that the GetRandomListItem is a new node I created for this and will include in the next version along with some other list revant ones. Here is the code for it. You can open up Lists.cs and add it somewhere within the script:
    Code (CSharp):
    1.     [Category("Functions/Lists")]
    2.     public class GetRandomListItem<T> : PureFunctionNode<T, IList<T>>{
    3.         public override T Invoke(IList<T> list){
    4.             return list.Count > 0? list[ UnityEngine.Random.Range(0, list.Count-1) ] : default(T);
    5.         }
    6.     }
    I hope this works for you. Let me know if you have any more questions.
    Cheers!
     
  38. brandc

    brandc

    Joined:
    Feb 23, 2015
    Posts:
    16
    Hi, does this support events/delegates and coroutines etc?
     
  39. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,
    It depends on what you are after, but yes. There exists an event node that let's you bind it to an Action or Action<T> event/delegate on a monobehaviour on the gameobject (or a static class), and be called when that event is raised.
    Regarding coroutines, you can create what is called LatentActionNode. Here is an example of the Wait node:
    Code (CSharp):
    1.     public class Wait : LatentActionNode<float>{
    2.         public override IEnumerator Invoke(float time){
    3.             var timer = time;
    4.             while (timer > 0){
    5.                 timer -= Time.deltaTime;
    6.                 yield return null;
    7.             }
    8.         }
    9.     }
    Let me know if I can clarify better.
    Thanks and cheers!
     
  40. brandc

    brandc

    Joined:
    Feb 23, 2015
    Posts:
    16
    I just wanted to see what a script like this would look like in this system before I made the purchase but I've been going through the docs and it looks pretty cool!

    Code (CSharp):
    1.    
    2.     //
    3.     // Fields.
    4.     //
    5.  
    6.     public int initialHealth = 5;
    7.     public int health { get; private set; }
    8.     public bool dead { get; private set; }
    9.  
    10.     //
    11.     // Events.
    12.     //
    13.  
    14.     public delegate void OnDeathEvent ();
    15.     public event OnDeathEvent OnDeath = delegate {};
    16.     public delegate void OnReviveEvent ();
    17.     public event OnReviveEvent OnRevive = delegate {};
    18.     public delegate void OnHealthDownEvent ();
    19.     public event OnHealthDownEvent OnHealthDown = delegate {};
    20.  
    21.     //
    22.     // Unity methods.
    23.     //
    24.  
    25.     void Awake ()
    26.     {
    27.         Revive ();
    28.     }
    29.  
    30.     //
    31.     // Methods.
    32.     //
    33.  
    34.     public void Revive ()
    35.     {
    36.         health = initialHealth;
    37.         dead = (health <= 0);
    38.         OnRevive ();
    39.     }
    40.  
    41.     public void DecrementHealth (int amount)
    42.     {
    43.         health -= amount;
    44.         OnHealthDown ();
    45.  
    46.         if (health <= 0 && !dead)
    47.         {
    48.             dead = true;
    49.             OnDeath ();
    50.         }
    51.     }
     
  41. frekiidoochmanz

    frekiidoochmanz

    Joined:
    Feb 7, 2016
    Posts:
    158
    hey im a struggling artist and while unity may fit my needs for attempting game dev, im still tight when it comes to money
    Im interested in both your products: NodeCanvas + FlowCanvas and ive even seen you have a AI pathfinding prebuilt system ehre?
    https://www.assetstore.unity3d.com/en/#!/content/14718

    my question is this tho, how robust is this design tool? I want to create a moderately large game, maybe smaller, but what I want to do is implement A* pathfinding. I understand a little of how to make it work, assigning nodes on a grid and testing each nodes walkable and not walkable state, and then using scripts to run through each one in a for each loop and other scripts to pass values between each one using GetCompare functions.
    im not a very good programmer so I was lookin at this tool.

    Any idea how someone could implement pathfinding with this? i read that your tool handles instantiation fine aswell? or should I jsut focus my efforts soley on C# scripting in unity to get what I want? I tried playmaker and its just too rigid and slow. it cant even handle 800+ objects sadly. and uScript has been a giant pain to work with, i cant even find tutorials that make any sense or use up to date nodes.

    basically im used to easy dev tools which allow instantiation of game object classes (usually some sprite class) which can arbitrarily load in lots of variables and be destroyed/manipulated just as easily with built in draw methods and such. (such as game maker / construct classic/ etc) but id like to give unity a shot for serious development however C# is daunting , altho I can read it well enough.. which is strange, must be my lack of familiarity with its more rigid code forms/logic than the e-z dev stuff im used.

    Anyway if you let me know how its possible to even attempt to control entities via que/list A* algorithim ill definately buy this. just wondering what its intended for or whom. Im sure its a great product either way, like i cant stand playmaker but its still not a bad product.
     
  42. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello and sorry for the late reply.
    Not all these code features can be turned exactly into a flowscript. For example there is no notion of private get or set accessors and the flowscript can declare actual c# events, even though it can of course subscribe to existing ones on other classes, either static or on a monobehaviour. Methods can be described as flowscript events (which is entirely different than delegate events). Here is a partial example of what you might be looking for:
    Example.png
    As you see, the part where you raise the events is missing above. In place of that, you could either call another flowscript event. Thinking of this, declaring flowscript events that others can somehow subscribe to, would be a nice part to look for in the next versions. Nice call! :)

    Let me know if I can help you further or you have any question.
    Thanks!

    Hello,
    FlowCanvas is very design friendly and flexible, but honestly, creating a whole A* pathfinding system within, is a longshot. FlowCanvas best works by controlling existing systems at a higher level, instead of going deep into creating algorithms with it. Yes it's possible, but honestly it's not worth it. It's better if you get an existing pathfinding system (I'm not trying to promote my own. Just get any one that fill your needs), and use FlowCanvas to control it by calling it's exposed methods, or checking/setting it's properties for example, amongst the rest of the funtionality it offers.

    The bottom line of how I tent to see and use visual scripting tools, is: Use c# to create the core systems or get existing systems, then use visual scripting tools like FlowCanvas on top to control those systems at a higher level.

    I hope my answer was helpful to you as much as it was honest :)
    Cheers!
     
  43. frekiidoochmanz

    frekiidoochmanz

    Joined:
    Feb 7, 2016
    Posts:
    158
    Is it possible to add FlowCanvas scripts to objects via some component give function/method? could you instantiate say <Object.1> and pass it the FlowScript component and then with that component as a child through the object, pass it maybe a template like <Object.1>.<FlowScript>.Add("Prefab_Script") or something?

    one more thing, lets say I bothered to get all threee of your products, is it possible to have FlowScript interact with PolyNav aswell? would it make life easier for a struggling dev?

    any help is appreciated, I might get this but I am trying to see how I could use it to make life easier over scripting. I'm guessing it can handle alot of script management or variable management for baseline functions? such as prefabs with built in FlowScript components that handle their own reactionary or triggered states via flow scripts ?

    Edit: Oh my bad, you said it CAN interact with any prescripted system at a higher level, so it has full reflection? Hmmm.. I guess it would work just fine using polynav. Maybe ill get it and see
     
    Last edited: Feb 7, 2016
  44. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    370
    I'm having some small problems with this.

    Right now I have something like this:



    I created a Vabiable by clickin the top right thingie:

    I think the variable is a String. Didn't knew exactly what type of Variable to create and how. That's not the issue so far.

    My issue is this:

    In order to create the "Deck" that has the white color I drag & dropped the Parent into the FlowCanvas.
    This was also another thing I didn't knew exactly how to do :D

    From that dropdown that appears I selected this:


    Graph Variable (GameObject)

    Was this correct?

    Then I didn't really knew where to find the Get Child Transforms & Get Random List Item<Transform>

    So I pressed the ` key and in that box I typed:


    The Get Random List Item<Transform> I can find:


    My main problem is that I can't connect the Get Child Transforms to the Get Random List Item<Transforms> and I don't know what I did wrong.

    Any idea? Was my process of creating those stuff correctly?


    Thank You
     
  45. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello again,

    FlowCanvas scripts (called FlowScripts) can be created as an asset/template. For them to work on a game object they must be assigned to the FlowScriptController component that is responsible for executing the FlowScript. That FlowScriptController is a component that needs to be assigned on your gameobject first.
    This is similar say to how Unity has the Animator Component and the Animator Controller, or the AudioSource Component and the AudioClip, only in our case, the respective AudioSource is the FlowScriptController and the respective AudioClip is the FlowScript.
    So, to put this in practise, in it's simplest form, it would look like this:
    Code (CSharp):
    1. public class Example : MonoBehaviour{
    2.  
    3.     public FlowScript myTemplate;
    4.  
    5.     void Start(){
    6.         var controller = gameObject.AddComponent<FlowScriptController>();
    7.         controller.SwitchBehaviour(myTemplate);
    8.     }
    9. }
    Regarding interacting with PolyNav or any other system, yes it can be done through reflection. For example, PolyNav has a function SetDestination(Vector2 targetPosition). This can be called from within FlowCanvas.
    SetDestination.png

    Let me know if I can help you further.
    Thanks!


    Hey,
    Ah, sorry about this. Please open up the file "FlowCanvas/Module/Nodes/Simples/Functions/Utility.cs" and at the end of the file, change the node GetChildTransforms to look like this:
    Code (CSharp):
    1.     [Category("Functions/Utility")]
    2.     public class GetChildTransforms : PureFunctionNode<Transform[], Transform>{
    3.         public override Transform[] Invoke(Transform parent){
    4.             return parent.transform.Cast<Transform>().ToArray();
    5.         }
    6.     }
    You will then be able to connect those 2. It's a change I did recently and forgot to mention in the previous post.
    The rest of the process looks correct. All 3 ways of adding nodes (drag and drop, through the context menu, or through the browser) are correct :)

    Let me know if this works for you.
    Cheers!
     
  46. frekiidoochmanz

    frekiidoochmanz

    Joined:
    Feb 7, 2016
    Posts:
    158
    Thanks for the help, I think this might be waht im looking for then.

    edit: well i went ahead and got it so I could get used to it.

    but im having some difficulty understanding the flowCanvas graph. How do I compare simple boolean operators?
    Or, what is the equivilent of the if ( ) operator found in normal C#?
     
    Last edited: Feb 9, 2016
  47. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    370
    Thanks. I managed to do this:


    And it works! :D I get a random text in a text ui. Now I can move to the next step :D

    Out of curiosity.

    I had to add Get Child Transforms by pressing the ` key. If I drag the point from SegmentsDeck I can't find the Get Child Transforms in that drop down. Shoudn't you get all your options when you do a drag from a node to create a new node?

    Thanks

    ------------
    EDIT:

    This is the final version:


    I press the button, then a new segment get's randomly picked and then I set the parent to that new object to "Board" ... then I log this just for fun.

    Now I'm trying to do that second part... but I'm not even sure how to start.


    I'm not sure how this thing will even execute.. and when. Where should I put it? Right now it's in teh same game object where I keep my "GameManager".

    Another problem is ith my SegmentToMove variable which is of type = Object.

    If I do this:


    The variable looks like this:


    Did I do something wrong?

    Thanks again :*
     
    Last edited: Feb 9, 2016
  48. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    370
    Nevermind. I had some help from our programmer :D



    I created my Variable as SYSTEM so... I have been told that I have to create it as Unity > Game Object.

    Basically this does exactly what I want. I still have to thinker with it a bit but it's there :D

    Thank You again for the help :D
     
  49. NyanPixel

    NyanPixel

    Joined:
    Feb 9, 2016
    Posts:
    1
    Flow canvas is rocking my world and brought me back to Unity! To try and get more out of it, I am trying to create my own node. The aim is to get the position of a transform, and then output the current position and a next position (by adding another vector 3). This is just a learning exercise that I have tried to keep simple, the aim being to 2 x Vector 3 results. I feel like I am close but I can't seem to apply vector 3 to values, I have been trying for days and. Hope someone can help:

    Code (CSharp):
    1.  [Name("Test 1")]
    2.     [Category("Actions/Tests")]
    3.     [Description("A simple to test ouput 2 different vector 3 results (Current position and next position)")]
    4.     public class Test1 : FlowControlNode
    5.     {
    6.         public ValueHandler<Vector3> currentPosition;              
    7.         public ValueHandler<Vector3> nextPosition;              
    8.  
    9.         protected override void RegisterPorts()
    10.         {
    11.             var target = AddValueInput<Transform>("Target");
    12.  
    13.             var _current = AddValueOutput<Vector3>("Current", currentPosition);
    14.             var _next = AddValueOutput<Vector3>("Next", nextPosition);
    15.  
    16.             AddFlowInput("In", (f) =>
    17.             {
    18.                 var t = target.getter();
    19.  
    20.                 currentPosition = t.position;    // Error: Cannot implicitly convert type 'UnityEngine.Vector3' to 'FlowCanvas.ValueHandler<UnityEngine.Vector3>'
    21.  
    22.                 nextPosition = currentPosition + new Vector3(0,0,1); // Error: Operator '+' cannot be applied to operands of type 'ValueHandler<Vector3>' and 'Vector3'
    23.  
    24.             });
    25.         }
    26.     }
     
  50. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    Can work with Webgl?