As of beta 35 the t-engine has support for addons. Addons are way for third parties to modify existing modules.
Capabilities
Addons are capable of three things to modify their parent module- Overloading: Overloading is a way to //add new// or //overwrite// files to the parent module. This the way graphics such as talent icons are added. Overloading can also add .lua but will replace those with the same name. So typically adding new trees, or overwriting trees. Or adding music and graphics.
- Superloading: Superloading allows you to add completely replace, or add code to the beginning or end of an arbitrary class function.
- Data: Make new data like talents, NPCs, etc accessible to the game. This data will still need to be loaded (see hooks below).
- Hooks: Certain functions are capable of supporting hooks. When that function is called they will also call whatever is in the hook. Example module shows how the "Actor:takeHit" function is hooked to make the tourist take no damage. You can also use hooks to load add-on data in to the module, eg. new talents.
An example addon can be found here: http://te4.org/dl/tmp/tome-example.teaa
A .teaa file is simply a renamed zip that contains the whole addon, this way the players do not even have to unzip it!
The example addon illustrate how to add a new class, new talents, new timed effects and how to hook onto a few useful locations in the code.
Grammar and Syntax
- The addon folder must be in the format [ModuleName]-[AddonName].
- The short_name in init.lua must be the same as the module folder's name (excluding the module name).