[QUESTION] Reset Filter Node

NodeCanvas Forums Support [QUESTION] Reset Filter Node

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #15294
    johnny star
    Participant

    How do I go about resetting a Filter Node’s internal privateย <i>executedCount</i>?

    #15305
    Gavalakis
    Keymaster

    Hello there,

    The “executedCount” is automatically reset to 0, whenever the graph is stopped (OnGraphStopped called).
    Do you need to reset it manually for some reason?
    Please let me know.
    Thanks ๐Ÿ™‚

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

    #15307
    johnny star
    Participant

    Hey! Thanks for getting back!

    Ok, so I have attached a small portion of my graph.

    So if you look at it, when my bot dies, the navmeshagent is stopped but I assume this is not a one time call but rather called for as long as my bot is dead.

    So since it’s not a one time call, I added a Filter node for when my bot is respawned. So when my bot died again, I’d like to restart my filter “executedCount” back to 0.

    But I’m not that great in behaviour trees. If there is another way to achieve this, please advice.

    Stay strong and healthy,
    Johnny Star

    Attachments:
    You must be logged in to view attached files.
    #15315
    Gavalakis
    Keymaster

    Hello again Johny ๐Ÿ™‚

    Do you actually disable the bot gameobject when it dies?
    If you do disable the gameobject, then the graph would also stop (and re-start when the bot gameobject is re-enabled again) and will thus also make it so that the tree is not continuously running even though the bot is dead. Also, Stoping and re-starting the graph (which can be a result of disabling/enabling the gameobject) will also reset any node “flags”, like “executedCount” is automatically.

    For example, you can add the action “GameObject/Set Active” on the action node on the right (the node that is called when isAlive == false).
    Please let me know what you think and if that helps (or not ๐Ÿ™‚ )

    Thank you!

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

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