Access the parent node from a task?

NodeCanvas Forums Custom Nodes & Tasks Access the parent node from a task?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #12546
    mcarriere
    Participant

    I’m creating a set of tasks for my team and would like to be able to print out some useful information if those tasks try to run and end up being null. Is there a way to get the containing FSMState from an ActionTask?

    It’d be useful to print something along the lines of “Clip is null in NODE_NAME” to help designers catch/fix their mistakes.

    #12550
    Gavalakis
    Keymaster

    Hello,
    Unfortunately right now and by design, Tasks know nothing about the parent node in which they are assigned to, but they do know about the parent system they belong to, meaning for example, the FSM itself, which can be fetched like this var fsm = (FSM)ownerSystem;.
    With that said, I am already looking at refactoring the code, so that Tasks also have a reference to the parent node as well.

    Thanks!

    Join us on Discord: https://discord.gg/97q2Rjh

    #12551
    mcarriere
    Participant

    Thanks, this would be really useful for providing tasks for my designers.

    Since you’re considering a refactor, I would throw in a few more suggestions/request:

    * Default the color picker to have an alpha of 1 (if possible) for Nodes
    * Allow conditionals to know the two nodes they’re connecting.
    * Give more tools for designers to put “notes” in their canvas.
    * Allow zooming on canvas during playback
    * Improve performance on canvas when panning around. (I realize this may be a limitation of Unity and not your own work.)

    #12559
    Gavalakis
    Keymaster

    Hey,

    Thanks for your input and suggestions!

    * Default the color picker to have an alpha of 1 (if possible) for Nodes
    The reason why the default alpha value is 0 right now, is because the default(Color) value is one that has alpha = 0. I could change this to 1, but keeping it to 0 as it is right now, saves up serializing/deserializing the color when not required, since serializing default values is skipped. I know though that it can be a bit counter intuitive, thus I will take another look at this possibility.

    * Allow conditionals to know the two nodes they’re connecting.
    Can you please explain what you mean with this a bit more?

    * Give more tools for designers to put “notes” in their canvas.
    Hmm. One thing I was considering regarding this, was to make possible to add text within a [Canvas Group], instead of only title. As such, it could be used for creating notes around the canvas as well, instead of only for grouping nodes. What do you think?

    * Allow zooming on canvas during playback
    Yes, this is indeed something I have to “fix”. 🙂

    * Improve performance on canvas when panning around. (I realize this may be a limitation of Unity and not your own work.)
    There are already a lot of heavy optimizations made for the editor performance, especially in the last few version 2.6.x+, but -as you said- the editor performance is now starting to get limited by how Unity editor works. I will though do another code review of the editor to see if further nit-picking improvements can be made.

    Thanks again for your suggestions!

    Join us on Discord: https://discord.gg/97q2Rjh

    #12564
    mcarriere
    Participant

    * Allow conditionals to know the two nodes they’re connecting.
    Can you please explain what you mean with this a bit more?

    The benefit of this is similar to the request for a task being able to know the node that holds it — if a designer screws up the input on a conditional, it would be useful to print out the node name of the “from” and “to” nodes that a conditional connects.

    * Give more tools for designers to put “notes” in their canvas.
    Hmm. One thing I was considering regarding this, was to make possible to add text within a [Canvas Group], instead of only title. As such, it could be used for creating notes around the canvas as well, instead of only for grouping nodes. What do you think?

    Sounds great!

    #12568
    Gavalakis
    Keymaster

    Thank you for the follow up and for the further info 🙂

    Join us on Discord: https://discord.gg/97q2Rjh

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.