Reply To: Flow Canvas API Documentation Needed

FlowCanvas Forums Support Flow Canvas API Documentation Needed Reply To: Flow Canvas API Documentation Needed

#1873
Gavalakis
Keymaster

    Hello Louis (I presume that is your name 🙂 )

    You got me before having the chance to reply! Thanks a lot for getting FlowCanvas 🙂
    Indeed, a FlowCanvas graph (flowScript), can run as a standalone graph without the need of a FlowScriptController pretty much in the exact way you’ve done it as well!

    I will need to add this in the documentation as well since I have omitted doing so (only have done so for the [NodeCanvas Documentation] which is pretty much similar)

    As you’ve already seen, after instantiating, the StartGraph method takes two important parameters those being the agent (Component) and the blackboard (IBlackboard).

    — You can pass any component reference to act as the agent (“Self”) for the graph (if required).
    — For the blackboard, you can either do what you did, or if you also want to have the variables serialized and inspectable in the editor, you could also create a Blackboard component (either editor or runtime) and pass that Blackboard component reference instead.

    A blackboard is though not required if you don’t want to pass a reference. If you pass “null”, the local blackboard of the graph will be used instead, within which you can get/set variables normally as you would with any blackboard, through the graph.blackboard (or graph.localBlackboard) property.

    Another thing you can do if you want to have the blackboard variables part of the graph asset as well, would be to do a little code change so that the graphs use their local blackboard by default (this will be an option in a future update). To do so, simply open up FlowScript.cs and add this line of code:

    Doing so, when you open your graph asset, you will now see a blackboard being part of the graph, rather than empty 🙂

    I hope that helps and please let me know if you have any questions!

    By the way, the UI seems a bit weird in your screenshot (white halos and pixel artifacts). What version of Unity and what OS are you using?

    Thanks!