-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(talkactions): add Lua-based loader for XML talkactions, convert existing scripts #5046
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 pull request migrates the talkactions system from XML-based configuration to a Lua-based registration system using the TalkAction interface. This modernizes the talkaction loading mechanism and provides better code organization and type safety.
- Converts all existing talkaction scripts to use the new
TalkActionLua interface with explicit registration - Adds a backward-compatibility XML loader for legacy configurations
- Introduces a new library for talkaction utilities (command logging)
Reviewed Changes
Copilot reviewed 43 out of 44 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| data/talkactions/talkactions.xml | Removes all XML talkaction entries, leaving only a deprecation notice |
| data/scripts/xml/talkactions.lua | Adds XML loader for backward compatibility with legacy talkaction configurations |
| data/scripts/lib/talkactions.lua | Adds utility library with command logging functionality |
| data/scripts/talkactions/test/*.lua | Converts test talkactions (magic_effect, animation_effect, looktype) to use TalkAction interface |
| data/scripts/talkactions/player/*.lua | Converts player talkactions (uptime, server_info, online, kills, death_list, change_sex, buy_premium) to use TalkAction interface |
| data/scripts/talkactions/house/*.lua | Converts house-related talkactions (sell_house, leave_house, buy_house) to use TalkAction interface |
| data/scripts/talkactions/commands/*.lua | Converts all admin/GM command talkactions to use TalkAction interface with proper registration and separator configuration |
Comments suppressed due to low confidence (1)
data/scripts/talkactions/house/buy_house.lua:4
- [nitpick] The
configvariable should be moved after thetalkactiondeclaration for consistency with the pattern used in other converted scripts (e.g.,buy_premium.lua,change_sex.lua). This maintains a consistent structure across all talkaction files where the TalkAction object is declared first, followed by any local variables or helper functions, and finally theonSayimplementation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7a1984c to
2155770
Compare
|
Last time I checked, commit 79138e8 completely broke ability to reload actions because so it fails here https://github.com/otland/forgottenserver/blob/master/src/baseevents.cpp#L45 Looks like its not case here but you can check this. |
|
@kygov correct, I see a few calls to There is no way of reloading a subset of scripts (so for example only reloading |
0f33d1f to
c8ae1ff
Compare
Pull Request Prelude
Changes Proposed
Migrates talkactions to use the
TalkActionLua interfaceConverted talkactions with this Python script and a few manual adjustments: