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

Predator dynamic interaction events and AI fixes + Option for mid-animation eating #259

Conversation

Blixibon
Copy link
Collaborator

@Blixibon Blixibon commented Mar 8, 2024

This PR adds new animation events and tweaks some of the predator AI to make predators able to perform certain dynamic interactions. Due to the changes being intertwined, this PR also adds support for eating to occur mid-animation via new animation events.


Overall, this PR includes five new animation events:

  • AE_PREDATOR_EAT — Triggers an eat attack and feeds the predator. (equivalent to what happens at the end of an eating animation)
  • AE_PREDATOR_EAT_NOATTACK — Instantly feeds the predator without performing an eat attack.
  • AE_PREDATOR_GIB_INTERACTION_PARTNER — Gibs the predator's dynamic interaction partner and feeds the predator.
  • AE_PREDATOR_SWALLOW_INTERACTION_PARTNER — Removes the predator's dynamic interaction partner and feeds the predator.
  • AE_BULLSQUID_EAT_HEADCRAB_OFF_ZOMBIE — A bullsquid-only event which kills and removes the headcrab from a dynamic interaction partner derived from CNPC_BaseZombie, also feeding the predator.

When one of the eating events is used during an eating animation, it will override the "eat attack" normally used at the end of it. Currently, I've only set up this animation event on the gonome, so all other predators will retain the default behavior.


The "AI fixes" mainly entail fixing issues with predators running scripted_sequences in general (or attacking other NPCs running them), as certain parts of their code overrode or interfered with the scripted state. There is, however, one liberty taken to encourage their use.

Normally, predators pull NPCs towards them after melee attacks. With this PR, they check if there's any dynamic interactions they can perform on the enemy. If there is one, they will push the enemy towards the dynamic interaction's ideal position instead. For predators attacking other predators, this will also work in reverse: If the attacked predator has their own dynamic interactions on the attacker, then the attacked predator will be pushed to where they can perform it on the attacker.

@Blixibon Blixibon requested a review from 1upD March 8, 2024 01:33
Copy link

@1upD 1upD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@1upD 1upD merged commit 610123e into entropy-zero:ez2/mapbase Mar 8, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants