Skip to content
Xandaros edited this page Sep 11, 2013 · 4 revisions

To create a plugin, you need to call evolve:registerPlugin(plugin), while plugin is a table containing the plugin information.
The table contains the following values:
id:string - Unique identifier for the plugin. Make sure that no other plugin uses it or is likely to use
title:string - The title of the plugin visible to the user
description:string - A description of the plugin that explains to the user the purpose of the plugin
author:string - The original author of the plugin. Subsequent maintainers may not change this unless they redesign most of the plugin or get permission from the original author
dependencies:table - An array-like table with a list of plugins this plugin depends on. Entries are strings containing the IDs of the plugins
status:integer - Status of this plugin. You may not change this value. It is used internally to store whether the plugin is uninstalled(0), installed and disabled(1), installed and enabled(2) or has unmet dependencies(3).

Finally plugins contain the following "methods". Note that any function can be nil:
init - This is called as the very first function. This will even be executed if the plugin is not installed. Be careful what you put in here. Use of this function is discouraged, if you can, use a different function.
onInstall - This is called when the plugin gets installed. Usually only used to create the database
onUninstall - Basically undoes whatever onInstall did. Usually deletes the tables from the database
onEnable - This is called when the plugin gets enabled. Setup hooks and the like in here.
onDisable - Undo what onEnable did. Remove hooks, etc.

Note that other plugins may call additional functions. Make sure to set your dependencies correctly if you intent to use those.

Clone this wiki locally