Vendetta/overview: Difference between revisions
Imported overview page from wiki.js instance. needs to be edited, as some details have significantly changed since this was first written. |
Updated overview page to better match Neoloader v6.11.0 |
||
Line 1: | Line 1: | ||
Neoloader | == '''Why modders should use Neoloader''' == | ||
The goals of Neoloader are twofold: make complex mods easier to develop, and make mods safer to run and manage for the user. | |||
a | * Neoloader provides a stable and managed way to load plugins based on their dependencies, and introduces safety measures for the plugin loading process | ||
in-game toolset for | * Neoloader provides an in-game toolset for managing a mod's state and settings directly | ||
an API that promotes inter-mod communication and expandability, including with Neoloader itself | * Neoloader provides an API that promotes inter-mod communication and expandability, including with Neoloader itself | ||
Currently, no alternative exists for Vendetta Online. Plugins could be (and historically have been) designed in a monolithic style for the ASCII-betical plugin loader. Due to this, mods rarely communicate with each other, and a lot of duplicated code exists between projects. | |||
Neoloader doesn't replace the default plugin loader embedded in the game, but runs before it using built-in game mechanics to provide its extended functionality without need for exploits. | |||
== Regarding the LME terminology == | |||
It is important for plugin developers to note that Neoloader itself is an implementation of a "Library Management Engine". The public-facing API could be seen as LME, where how that API is implemented is Neoloader. This distinction is important in the event that a new tool supercedes Neoloader in the future while providing the same features. For a game like Vendetta Online, which is undergoing active development to this day, this distinction helps future-proof plugins as the game changes. Indeed, as long as the API itself remains untouched, how that API is implemented should not matter. | |||
== '''How Neoloader works''' == | |||
Neoloader loads itself as Vendetta Online's interface, using the <nowiki>if=</nowiki> option in config.ini. As such, it will always be the first plugin to be loaded. Neoloader first sets up basic functionality and builds the API in the public "lib" table, before entering "Init", or the loader phase, where it handles loading and executing all mods that have been registered to the loading system. Once the Init phase is complete, it assigns a few events and commands, before completing. At this point, the game client takes back over and begins the normal mod loading procedure. | |||
Due to the highly limited file access abilities of the Vendetta Online sandbox, Neoloader cannot see plugins when installed. Instead, plugins must manually 'register' themselves to Neoloader during the normal mod loader's execution. Neoloader saves the path of the INI registration file to the game's config.ini; this is what is iterated over during the Init period. | |||
To register a mod or execute any LME functions at the time of the game's normal plugin loading process, mods should check for the existence of Neoloader. To do this, plugins should wrap all LME calls within a check for the correct environment, as described here: | |||
<syntaxhighlight lang="lua" line> | |||
if (type(lib) == "table") and (lib[0] == "LME")) then | if (type(lib) == "table") and (lib[0] == "LME")) then | ||
--LME API functions here | --LME API functions here | ||
end | end | ||
</syntaxhighlight> | |||
You can explore how this used in some of the plugins located in the examples | You can explore how this used in some of the plugins located in the development examples package provided here (todo). The Design page also describes how to set up specific files to make your plugin ready for management through Neoloader. |
Revision as of 02:53, 3 March 2025
Why modders should use Neoloader
The goals of Neoloader are twofold: make complex mods easier to develop, and make mods safer to run and manage for the user.
- Neoloader provides a stable and managed way to load plugins based on their dependencies, and introduces safety measures for the plugin loading process
- Neoloader provides an in-game toolset for managing a mod's state and settings directly
- Neoloader provides an API that promotes inter-mod communication and expandability, including with Neoloader itself
Currently, no alternative exists for Vendetta Online. Plugins could be (and historically have been) designed in a monolithic style for the ASCII-betical plugin loader. Due to this, mods rarely communicate with each other, and a lot of duplicated code exists between projects.
Neoloader doesn't replace the default plugin loader embedded in the game, but runs before it using built-in game mechanics to provide its extended functionality without need for exploits.
Regarding the LME terminology
It is important for plugin developers to note that Neoloader itself is an implementation of a "Library Management Engine". The public-facing API could be seen as LME, where how that API is implemented is Neoloader. This distinction is important in the event that a new tool supercedes Neoloader in the future while providing the same features. For a game like Vendetta Online, which is undergoing active development to this day, this distinction helps future-proof plugins as the game changes. Indeed, as long as the API itself remains untouched, how that API is implemented should not matter.
How Neoloader works
Neoloader loads itself as Vendetta Online's interface, using the if= option in config.ini. As such, it will always be the first plugin to be loaded. Neoloader first sets up basic functionality and builds the API in the public "lib" table, before entering "Init", or the loader phase, where it handles loading and executing all mods that have been registered to the loading system. Once the Init phase is complete, it assigns a few events and commands, before completing. At this point, the game client takes back over and begins the normal mod loading procedure.
Due to the highly limited file access abilities of the Vendetta Online sandbox, Neoloader cannot see plugins when installed. Instead, plugins must manually 'register' themselves to Neoloader during the normal mod loader's execution. Neoloader saves the path of the INI registration file to the game's config.ini; this is what is iterated over during the Init period.
To register a mod or execute any LME functions at the time of the game's normal plugin loading process, mods should check for the existence of Neoloader. To do this, plugins should wrap all LME calls within a check for the correct environment, as described here:
if (type(lib) == "table") and (lib[0] == "LME")) then
--LME API functions here
end
You can explore how this used in some of the plugins located in the development examples package provided here (todo). The Design page also describes how to set up specific files to make your plugin ready for management through Neoloader.