[DiscordArchive] So I'm looking at this page:
[DiscordArchive] So I'm looking at this page:
Archived author: ritzmenardi • Posted: 2023-06-09T20:50:45.907000+00:00
Original source
So I'm looking at this page:
https://www.azerothcore.org/wiki/create-a-module
and it shows you how to create a new script module. But in this case I'm trying to *edit* a script - how would I do that? Should I just copy the script I want to edit from the core, change it, and then... will it update the base script with my changes? Or should I only include the functions I want to change?
Archived author: Honey • Posted: 2023-06-09T20:51:51.644000+00:00
Original source
To change a script, you need to use a hook inside the script.
Hooks pass the execution to a module and once the module is done the core takes back control.
Archived author: Honey • Posted: 2023-06-09T20:52:06.293000+00:00
Original source
If there's no hook in the spot you need, you can add one.
Archived author: ritzmenardi • Posted: 2023-06-09T20:53:15.501000+00:00
Original source
Hmmmm, I see. My understanding was that we shouldn't edit files in the core because they'll be overwritten when updates are released. I'll look into creating hooks, maybe they answer that (implicit) question.
Archived author: Honey • Posted: 2023-06-09T20:53:58.498000+00:00
Original source
That's exactly what modules are for
Archived author: ritzmenardi • Posted: 2023-06-09T20:54:40.613000+00:00
Original source
That makes sense to me! Also this page is much more informative than the one I was looking at before:
https://www.azerothcore.org/wiki/hooks-script
Archived author: Revision • Posted: 2023-06-09T21:06:49.179000+00:00
Original source
Hooks are just code added to the core to allow modules to perform actions without actually modifying the core. Frankly there's nothing wrong with modifying the core. There may be conflicts later down the road but those can be resolved. Your code wouldn't be overwritten though.
Archived author: Revision • Posted: 2023-06-09T21:07:13.430000+00:00
Original source
Obviously hooks added to the core tends to be the better option, most of the time at least.
Archived author: ritzmenardi • Posted: 2023-06-09T21:14:34.286000+00:00
Original source
This looks too complicated for me right now. I'm going to try and accomplish as much as I can with Eluna before I dive into the C++
Archived author: Honey • Posted: 2023-06-09T21:16:50.480000+00:00
Original source
You'll try C++ when you bump your head into something Eluna can't do. Then add it to Eluna.
Trust me, i've been there.