[solved] enemy attackback

Gurtag

Active member
hey there, how could be setup an enemy with facing  1 to attack behind? i use range -100 -10 on the desired animation, an it seems to work to some extent, exept it trigers anotter attack anim with oposite range values and that is what i dont understand yet, any ideas of what could i be doing wrong?
 
Hum, have you set it right?
Because I use it on my game and it works:

Right attack:
anim attack1
loop 0
range 40 100
(....)

Left attack:
anim attack2
loop 0
range -100 -40

See it in action - 5:04 and beyond.
https://www.youtube.com/watch?v=Iz9rKB8N97s

Things to remember:
- pay attention if the ranges aren't overlapping
- Remember that smaller attack numbers have preference over bigger ones. So if ATTACK1, ATTACK2 and ATTACK3 have the same range, the engine will trigger the ATTACK1 more than ATTACK2 and so on...
 
By default AI entities instantly turn around, you can't really get behind them so what's happening is basically a conflict of AI routines. The AI wants to turn around, while at the same time it has an attack in range, but as it turns around (remember this is all instant, far faster than what you see on screen) its other animations are brought into range. I'm surprised it doesn't sometimes get stuck doing nothing at all for a few seconds.

The solution is to add a turn animation and turn delay so the AI has to react and turn around like you do. This should give it enough time to trigger the back attack.

HTH,
DC

 
Back
Top Bottom