Mobs attacking Players
#1
Is there anyway (in Lua) to make a mob attack a player besides having a player take damage from the mob?

I'd like to be able to make skeletons attack players and miss on occasion, or zombies strike players and not do any damage too. Part of the fun is the animation. Wink

Any direction on this?
Reply
Thanks given by:
#2
I'm afraid this is not possible yet. It would require some form of collaboration with the AI (set the target player to attack / follow), which is missing at this point.
Missing the attack on occasion should be doable - simply have the OnTakeDamage hook lower the damage, or for skeletons, when an arrow is spawned, modify its speed a bit.
Reply
Thanks given by:
#3
(02-09-2015, 08:36 AM)xoft Wrote: I'm afraid this is not possible yet. It would require some form of collaboration with the AI (set the target player to attack / follow), which is missing at this point.
Missing the attack on occasion should be doable - simply have the OnTakeDamage hook lower the damage, or for skeletons, when an arrow is spawned, modify its speed a bit.

How would you propose doing this?

The AI could easily send a cMonster:FollowPlayer(cPlayer) to have it move towards the player.

Depending on ranged/melee attacks a cMonster:AttackPlayer(cPlayer, int) where the int would be the percentage of success (0-100) or something like that.
Reply
Thanks given by:
#4
Is this still unsupported by the API? I couldn't readily find reference to it in the API doc.
Reply
Thanks given by:
#5
It is still unsupported, but a major AI rewrite is in progress, and that may change.
Reply
Thanks given by:




Users browsing this thread: 2 Guest(s)