Skip to content

Follow module #354

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

Merged
merged 4 commits into from
Apr 29, 2025
Merged

Follow module #354

merged 4 commits into from
Apr 29, 2025

Conversation

Volte6
Copy link
Member

@Volte6 Volte6 commented Apr 28, 2025

Description

This removes the old follow command and creates a new module called follow with extended functionality.

It also adds a MobIdle{} event that can be handled for when mobs are idle.

Mobs out of alignment with players won't let players follow them.

Changes

  • Added mob and user follow commands
    • Includes unfollow/follow stop, and lose/follow lose
  • Players can now follow mobs, not just other players.
  • Mobs can now follow players/mobs, a behavior that did not exist previously.
  • Added helpfile, keywords, etc. into module
  • Removed character followers slice and functions that use it.
  • Adjusted listener adding logic for default "add to end" behavior
  • mob commands now look for any keyword aliases that are defined to use.
  • Fixed up some bugginess with keyword aliases that was appending a space to the end, causing things to break.
  • Added MobIdle{} event and handlers. Moved some of the existing mob idle calculation to a new handler function.
  • follow module abort MobIdle{} event if mob is in the middle of a follow behavior.

Links

#348

@Jasrags Jasrags requested a review from Copilot April 29, 2025 00:54
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the follow functionality by removing the legacy follow command and introducing a new follow module with extended support for mobs and users, including new event-driven idle behavior. Key changes include:

  • Removal of the old follow command and associated follower tracking.
  • Introduction of extended follow commands supporting mobs and additional keyword alias handling.
  • Implementation of MobIdle event and its dedicated handler to centralize mob idle behavior.

Reviewed Changes

Copilot reviewed 12 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
modules/follow/files/data-overlays/keywords.yaml Added help commands and command aliases for follow actions.
internal/usercommands/usercommands.go Removed legacy follow command and updated alias processing.
internal/usercommands/follow.go Removed the deprecated follow command implementation.
internal/mobcommands/mobcommands.go Updated alias handling for mob commands.
internal/hooks/hooks.go Registered MobIdle event with its handler.
internal/hooks/NewRound_IdleMobs.go Modified idle processing to queue MobIdle events.
internal/hooks/MobIdle_HandleIdleMobs.go Introduced new handler for mob idle behavior.
internal/events/listeners.go Adjusted listener insertion order for non-final listeners.
internal/events/eventtypes.go Added MobIdle event type and Party event type function.
internal/characters/character.go Removed obsolete follower functions and data.
_datafiles/world/empty/keywords.yaml Updated keywords by removing legacy follow aliases from parties.
Files not reviewed (3)
  • _datafiles/world/default/keywords.yaml: Language not supported
  • _datafiles/world/empty/templates/help/follow.template: Language not supported
  • modules/follow/files/datafiles/templates/help/follow.template: Language not supported

@Volte6 Volte6 merged commit d7fc8ec into master Apr 29, 2025
2 checks passed
@Volte6 Volte6 deleted the 348-follow-updates branch April 29, 2025 05:05
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.

2 participants