What is revscriptsys?
Revscriptsys is a new way to register your scripts in an easy drag and drop way without the need to register it with xml.
Basically you just place your .lua file into
data/scripts/
or any subfolder according to your taste, except for monster files, they go into
data/monster/
.
The files in
data/scripts, are loaded automatically on startup (Unless the filename starts with a # symbol, which means the file is disabled).
Revscriptsys supports multiple different interface methods to be used in one file (Actions, Moveevents, GlobalEvents, ...) which comes in hand if you do prolonged quests and such which usually would need to be done in different files.
You might have heard of the TFS 0.4 mods system? This is similar to that, but in pure Lua, no XML!
With Revscriptsys you should design your script in a header and footer way.
Action onUse example:
Lua:
local testAction = Action() -- this would be the "header" first thing we have to write (unless configuration tables and such)
function testAction.onUse(player, item, fromPosition, itemEx, toPosition, isHotkey) -- now we can design the action itself
return print("We used this item: .." item.itemid)
end
testAction.id(2550) -- the item is a scythe
testAction.register() -- this is our "footer" it has to be the last function executed.