Cooldown for ennemies attacks (request)

Piccolo

Well-known member
Salutations,

It would be interesting to be able to prevent an entity from using an attack twice in a row. For exemple, if you give a charge move that can be triggered from a great (x and z) distance  to an enemy, maybe you don't want him to always use it when he's far from you.

I can't figure a way to do this via script, and I don't know if it is actually doable in a proper way (maybe with thinkscript, which I don't know how to use).
 
Set a variable when it attack first time. The use a script to lower that var value like a countdown.
Make the entity always check that value - if is higher than 0, make the entity revert to idle
 
Yes I thought about doing that, I should have detailed my exemple a bit more then. Because if I do this, the entity will still consider to do that move and try to do it. In other words, the entity will loop trying to do it and reverting to idle (and thus will not do anything).

So the main idea is to prevent the entity from trying to do a move ; that is blocking the move before it actually happens, not after.
 
You could simulate an walk animation or something like that. So, if enemy are not allowed to do an specific attack at this point, he will walk and this can change all range parameters. You could set that walk by random.
 
you are setting a move range to execute the move, right? Do the opposite.
on the walk/idle, use a script to detected nearby enemies (its here on the forum) and add that countdown I said to you.

Doing this way, he will just try the move if he really can, otherwise he will keep walking.
 
lagarto said:
You could simulate an walk animation or something like that. So, if enemy are not allowed to do an specific attack at this point, he will walk and this can change all range parameters. You could set that walk by random.

Yeah I thought about using a fake "wandering" but that seemed a bad way to fix this issue.

O Ilusionista said:
you are setting a move range to execute the move, right? Do the opposite.
on the walk/idle, use a script to detected nearby enemies (its here on the forum) and add that countdown I said to you.

Doing this way, he will just try the move if he really can, otherwise he will keep walking.

Ah yes indeed, I didn't think of taking the problem the other way around. Sounds like a good idea.

Thank you both ;D
 
Back
Top Bottom