User Tools

Site Tools


addons

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

addons [2017/04/21 15:09]
atom0s created
addons [2017/04/21 15:14] (current)
atom0s
Line 3: Line 3:
 ==== What are addons? ==== ==== What are addons? ====
  
-Addons are Lua scripts that get loaded into the game via the Addons.dll plugin. These scripts have acces to the Ashita core interfaces that plugins can make use of, allowing scripts to essentially be, compileless ​plugins. (With limitations of course.)+Addons are Lua scripts that get loaded into the game via the Addons.dll plugin. These scripts have access ​to the Ashita core interfaces that plugins can make use of, allowing scripts to essentially be, non-compiled ​plugins. (With limitations of course.)
  
 Addons let you extend the game through means of Lua scripting. Addons let you extend the game through means of Lua scripting.
Line 69: Line 69:
 ==== Basic Addon Information ==== ==== Basic Addon Information ====
  
-Lua creates an object called a state when you begin using it. However, this state is fragile and does not offer much protection against errors and problems. Because of this, every single addon that you load is ran inside of its own Lua state. By doing this, it helps prevent addons from conflicting and causing others to crash. If 1 addon has a problem, it simply is set to an error state and no longer receives events. Rather ​then causing all addons to mess up, only one is removed.+Lua creates an object called a state when you begin using it. However, this state is fragile and does not offer much protection against errors and problems. Because of this, every single addon that you load is run inside of its own Lua state. By doing this, it helps prevent addons from conflicting and causing others to crash. If 1 addon has a problem, it simply is set to an error state and no longer receives events. Rather ​than causing all addons to mess up, only one is removed.
  
-However this does come with a drawback. Addons cannot directly communicate with each other.+Howeverthis does come with a drawback. Addons cannot directly communicate with each other.
  
 This is where the libs folder comes in handy. Commonly used functions and such can be placed inside of the libs folder allowing all plugins to access them. This does not mean that plugins can talk to each other using this folder, it is simply a location where commonly used things can be put to allow all addons to access them. This is where the libs folder comes in handy. Commonly used functions and such can be placed inside of the libs folder allowing all plugins to access them. This does not mean that plugins can talk to each other using this folder, it is simply a location where commonly used things can be put to allow all addons to access them.
  
 If you land up needing to have addons communicate,​ you can make use of the command system. Have one addon invoke a command to be processed, and in another addon, handle that command. If you land up needing to have addons communicate,​ you can make use of the command system. Have one addon invoke a command to be processed, and in another addon, handle that command.
addons.txt · Last modified: 2017/04/21 15:14 by atom0s