News Forums RAIN General Discussion and Troubleshooting Wander Follow and Attack Behavior

This topic contains 15 replies, has 2 voices, and was last updated by  prime 1 month, 4 weeks ago.

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #37677

    jbarrett98121
    Participant

    Hi there I have been working on a behavior, modifying the wander and flee behavior to follow, and then attack when close instead of flee.

    I have gotten the follow working correctly, but not yet the attack. Anyone able to take a look and see why my behavior isn’t attacking? Much appreciated!

    screenshot

    Link to the behavior

    http://www.filedropper.com/wanderandattack

    • This topic was modified 2 months, 2 weeks ago by  jbarrett98121.
    #37695

    prime
    Keymaster

    What is the constraint condition for Near?

    #37700

    jbarrett98121
    Participant

    isNear declared at the top

    #37702

    prime
    Keymaster

    Do you mean to have a parallel in that constraint? You are triggering two mecanim params simultaneously while moving?

    #37760

    jbarrett98121
    Participant

    Is that my issue? I’m trying to take an attack from an example and combine it with a wander behavior. It’s still a little confusing.

    I’m trying to move the ai to the player (which works), but when it is within range of the player, play an attack animation (set a mechanim state) and apply some damage, which i have not put in yet.

    #37769

    prime
    Keymaster

    Those are things you probably want to do in sequence, not in parallel.

    SEQ
    — Move
    — MecParam (trigger attack animation)
    — Custom Action (apply damage)

    #37780

    jbarrett98121
    Participant

    get rid of the parallel?

    #37792

    jbarrett98121
    Participant

    ok so I got the ai attacking the character. Almost there, but it attacks in an infinite loop…. and then once it attacks it never goes back to wandering or following if the player is out of range. How can I go about fixing that. I did set the attack parameter to false after attacking and waiting.25 seconds… but it still seems to infinitely attack. Here’s a shot :

    #37793

    jbarrett98121
    Participant

    ok so I had the constant chasing set to loop forever. I set it to once, and he does only attack once and will continue following after he has attacked.

    It acts very strange though, the ai will run right up to the player and keep running at him, and not attack, but will attack once after the player has moved away (and also runs in odd circles)

    I’m not sure where the strange behavior is coming from

    #37795

    jbarrett98121
    Participant

    Thanks all for the help btw. Just about have this working the way it should. Boar (ai) doesn’t stop and attack though, he keeps chasing the player, and every once in a while randomly attacks (while spinning in a circle oddly)

    #37819

    jbarrett98121
    Participant

    anyone?

    #37832

    prime
    Keymaster

    Unclear what the problem is, but the BT doesn’t make sense to me. Once the Follow sequencer hits you should eventually get into the (chasing == false) constraint that loops forever. Once you are in there, you will never get back out again. The (evilperson == null) constraint that comes after it will never occur.

    Does the “face for attack” node have a move target? Or just a facing target?

    #37880

    jbarrett98121
    Participant

    (chasing == false) only loops until it is successful . Should it never loop?

    I am really unsure about how to do this behavior, and am really just looking for some pointers on how to get there. Complete rain noob.

    The face for attack node is actually just setting a mechanim parameter of attack to true.

    I just took the wander and flee exaple and wanted to add following instea dof fleeing, which works.. and attacking a target and stopping following if the ai is in range of his target…… if the target is lost or out of range go back to wandering.

    That’s what I am trying to achieve, any pointers in the right direction of that would be much appreciated. :)

    #37907

    prime
    Keymaster

    The screenshot shows a yellow loop, which indicates loop forever (green is until success and red is until failure.)

    There’s an example of exactly what you want to do inside the Starter Kit:
    http://rivaltheory.com/community/tutorials/

    #37917

    jbarrett98121
    Participant

    well almost, max follows waypoints and the ai behavior i’m using doesn’t. It’s a little different, so I do not know where to grab the attack behavior and where to place it in my own.

Viewing 15 posts - 1 through 15 (of 16 total)

You must be logged in to reply to this topic.