OnExecute() and OnUpdate() for Running Action

NodeCanvas Forums Support OnExecute() and OnUpdate() for Running Action

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #12781
    year1984
    Participant

    Both OnExecute() and OnUpdate() of ImplementedAction_Multiplatform are to invoke Forward() that is doing some action.
    So, the action can be invoked twice at 1 Tick() sometimes,
    because ActionTask’s ExecuteAction() has both OnExecute() and OnUpdate() together for Status.Running.

    I am using nodeCanvas for turn-based ai. For each turn, i call Tick() to do something such as moving 1 tile.
    But, when that action changes not-running to running, the AI can move twice.

    How can I solve this status? Of course, I can solve from my side of the program.
    Before that, I want to know whether this is the implementation intention.
    I think it is a kind of bug or mis-implementation.

    Thanks

    #12797
    Gavalakis
    Keymaster

    Hello,

    This is actually a bug that was introduced due to a code refactoring. Thanks for pointing this to me.
    To fix this, please simply delete the OnExecute method override completely, so that only OnUpdate is calling Forward().

    Thank you!

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

    #12802
    year1984
    Participant

    Thanks for the reply.
    I will try that.

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