Basics
Mods have in Luanti a multiple meaning. Luanti itself is working with mods (modules) as functional entities written in Lua. A game runninng in Luanti is a combination of several mods. And the functionality of a game can be extended with additional mods in the more common sense of the word (modification).
To be used, a Mod has to be activated in the world.mt of the game world used. Add simply a line with
load_mod_<name of the mod> = true
and start the game. The mod will now be loaded automatically.
Mods can be stored in several locations. Each mod has his own directory to store Lua code, textures, models and sounds. Luanti checks three locations for mods while starting. <minetest> is the user-data directory.
1. Game mods
Mods that build the game running the world. They are placed in the folder of the game.
minetest/games/VoxeLibre/mods/
2. Global mods
Global mods are placed in the top level and are the place, where mods are placed to be used in several worlds
minetest/mods/
3. World mods
Mods located in a specific world, affecting and to be loaded only, if this world is used in a game.
minetest/worlds/world/worldmods/
Luanti checks each of those locations in order. If you place a mod with the same name in the worldmods folder, it will overwrite the mod previously loaded in the game mods folder.
Basic structure of a mod
The basic structure of a mod is quite simple. It consists of an configuration file and the basic lua code of the mod.
mymod
├── init.lua
└── mod.conf
Textures, models and sound can be placed in the same folder, but is good practice to place them in subfolder of the mod.
mymod
├── textures
│ └── mymod_node.png files
├── init.lua
└── mod.conf
Keine Kommentare vorhanden
Keine Kommentare vorhanden