-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Revscriptsys v2 #4629
base: master
Are you sure you want to change the base?
Revscriptsys v2 #4629
Conversation
- unification of both `lib` folders, making them auto load the files instead of manual linking - moved global.lua into `lib` folder - removed the `lib` folder inside `scripts` since it has no use anymore revscriptsys relevant: - re worked the `Game::reload()` function since it's kinda redundant for the new version of revscriptsys as we can re load specific events by their function / file name instead of reloading an entire interface - basic ground work to work on the interfaces now - re named `RELOAD_TYPE_GLOBAL` to `RELOAD_TYPE_LIBRARY` as the name is far more descriptive
- removed xml related stuff - raw action pointers are now converted into shared pointers - added basic debugging that server owner gets notified if he uses an outdated script version of revscriptsys - added `Game.getAction(id, eventType) to be able to hook back into an already created function and be able to edit/copy it
- print in console which revscriptsys version we are using - removing all not necessary xml handling code
- introducing shared_ptr for Spell/InstantSpell/RuneSpell - we keep monster xml spell handling as we still use monster xml files -
- removed all xml related stuff - converted everything to shared_ptr - notification if we use an outdated revscriptsys version
It's more of a stability factor than a mere feature implementation.
It's not entirely eliminated, we just don't have to manualy use it anymore.
I'm steadily working on that but we all know good things take time and writing a npc system from scratch needs a lot of testing first.
In this case it's necessary because it doesn't work with the way we are registering the uniquely named functions anymore. |
This implementation of revscriptsystem of version 2 is a more robust and error forgiving update to the old system.
Now to list a few key features version 2 comes with:
raw pointers
toshared_ptr
from the interfaces (Action, GlobalEvents, etc.)scripts
folder.register()
anymore.Features version 2 wont include:
Let's get into some details and examples on how version 2 works.
Script Examples
Action:
revscriptsys v1:
revscriptsys v2:
Reload System
Since we are using uniquely named function names (ex: onUseNewTest1) we can finaly revamp our
reloading
system.Currently we can only reload an entire interface (ex:
/reload actions
) or reload the entirescripts
folder which sometimes gives bad outcome, since it can reload tables or other stuff you don't want to be cleared at this point.Now you are able to reload easily a single interface function or an entire file by doing either
/reload onUseTest1
or/reload rope.lua
there is no need to give it a path, it'll find it without problems without providing that.This PR is still a draft and there are more examples comming soon.
Feel free to ask questions or suggest improvements!