I have also developed a system to embed scriptable stuff into mods, if you have
DeScript installed you can use it like that:
put a line in the mod file (e.g: "mymod.tbm") that reads:
# MODADDON MyModAddon
then create a file called "moa_MyModAddon.lua"
the file will be executed every time you load mymod.tbm
Advanced usage:
It is also possible to place some variables and/or functions directly into the mod file, to do so just place them under the MODADDON line into the file in a notation you would use to declare a table (but without the outer brackets). e.g:
# MODADDON MyModAddon
# a = "I'm A",
# alert = function()
# echo('Hi there!')
# end
then you can access the declared values from within "moa_MyModAddon.lua" like that:
-- run the alert function declared in the mod file
ModAddOn.alert() -- prints "Hi there!" to the console
-- access the declared variable 'a'
echo(ModAddOn.a) -- prints "I'm A" to the console
But as Melmoth pointed out a lot of stuff is disabled in Multiplayer Games, also remember that the script is executed on your local computer, not on the server.
Last edited by DeFransen; Jan 19, 2011 at 10:36 PM.