News Forums RAIN General Discussion and Troubleshooting Problem with basic detect and custom action

This topic contains 7 replies, has 3 voices, and was last updated by  blockcipher 2 months, 3 weeks ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #40367

    rogerdv
    Participant

    Im trying to implement a basic Detect and execute custo action routine to get familiar with sensors, but cant make my behaviour tree work correctly. Here you can see my tree:

    View post on imgur.com

    View post on imgur.com

    View post on imgur.com

    View post on imgur.com

    If I pause the game, I can see that the detect branch is highlighted in green and shows Success as result. But both constraints are marked in red and report Failure. What Im doing wrong here?

    • This topic was modified 3 months ago by  rogerdv.
    • This topic was modified 3 months ago by  rogerdv.
    #40378

    blockcipher
    Participant

    What Repeat / Fail / Succeed conditions does your Parallel node have? It may be that your “not in sight” node is failing thus not allowing the tree to ever get to check “in sight”.

    • This reply was modified 3 months ago by  blockcipher.
    #40380

    rogerdv
    Participant

    I left the default: Repeat Never, Fail Any, Succeed Fault.

    #40383

    blockcipher
    Participant

    I must admit that I am not very good with debugging the behavior trees visually, but try setting your Parallel to Repeat Forever and your Detect node to the same. It’s normal that both conditions will return failure until your action returns Success and the In Sight will turn green and restart the tree. Does your action return ActionResult.SUCCESS?

    #40384

    rogerdv
    Participant

    Indeed, that was the mistake. I set both to forever and now it works. Why isnt it set to forever by default?

    #40386

    blockcipher
    Participant

    Probably because the repeats are node specific and a normal flow would be what default should be. But when I have a problem with a Parallel I always make sure repeating isn’t causing the problem because it normally is that I just forgot to set it to Forever.

    #40409

    VarunVP
    Participant

    I noticed one more thing, you have put the form variable in between quotes, but it should not be so…

    #40413

    blockcipher
    Participant

    Ahh good spot Varun. I didn’t even see that.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.