Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monster AI hooks and functions request #4187

Open
LHolten opened this issue Feb 14, 2018 · 0 comments
Open

Monster AI hooks and functions request #4187

LHolten opened this issue Feb 14, 2018 · 0 comments

Comments

@LHolten
Copy link

LHolten commented Feb 14, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants