You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would really like to make a plugin that changes mob behavior, but to do that i need a few Lua hooks and functions.
These hooks and functions would be useful for all types of monster AI.
These are the hooks that i have in mind:
HOOK_MONSTER_SEES_PAWN
Monster gets in range of a pawn, useful for attacking and fleeing.
HOOK_MONSTER_CAN_ATTACK_PAWN
Monster gets in attack range of a pawn, for skeletons this means that the skeleton is able to shoot the pawn.
HOOK_MONSTER_UPDATE
Called every second or so for all active monsters and is meant for things like player following or group tactics. Return value may indicate if default behavior should be used.
I don't know what a reasonable interval is for the HOOK_MONSTER_UPDATE, also maybe it should be called only once with a list of all active monsters. Monster deactivation may be useful for those monsters that have not yet seen the Players so that not all monsters need to be processed.
Some cMonster functions that i have in mind:
Attack( Pawn )
Attack has different effects for different monster types: spiders jump, zombies hit, skeletons shoot etc.
SetTarget( Vector3d )
Set the target position of the path-finding algorithm. Floating point target, because Monsters can move between blocks.
SetUseDefaultAI( Boolean )
Enable or disable the default AI, enabling would remove this monster from the HOOK_MONSTER_UPDATE.
Hopefully some of these functions can be implemented or exposed,
Thank you
The text was updated successfully, but these errors were encountered:
I would really like to make a plugin that changes mob behavior, but to do that i need a few Lua hooks and functions.
These hooks and functions would be useful for all types of monster AI.
These are the hooks that i have in mind:
Monster gets in range of a pawn, useful for attacking and fleeing.
Monster gets in attack range of a pawn, for skeletons this means that the skeleton is able to shoot the pawn.
Called every second or so for all active monsters and is meant for things like player following or group tactics. Return value may indicate if default behavior should be used.
I don't know what a reasonable interval is for the HOOK_MONSTER_UPDATE, also maybe it should be called only once with a list of all active monsters. Monster deactivation may be useful for those monsters that have not yet seen the Players so that not all monsters need to be processed.
Some cMonster functions that i have in mind:
Attack has different effects for different monster types: spiders jump, zombies hit, skeletons shoot etc.
Set the target position of the path-finding algorithm. Floating point target, because Monsters can move between blocks.
Enable or disable the default AI, enabling would remove this monster from the HOOK_MONSTER_UPDATE.
Hopefully some of these functions can be implemented or exposed,
Thank you
The text was updated successfully, but these errors were encountered: