Folders: update

master
rubenwardy 2015-02-19 14:55:37 +00:00
parent d2bea4fda2
commit a49fb394d4
4 changed files with 18 additions and 17 deletions

View File

@ -1,6 +1,6 @@
</div> </div>
<script async src="http://code.jquery.com/jquery-1.11.2.min.js"></script> <script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
<script async src="{{ page.root }}static/script.js"></script> <script src="{{ page.root }}static/script.js"></script>
<link rel="stylesheet" href="{{ page.root }}static/style.css"> <link rel="stylesheet" href="{{ page.root }}static/style.css">
<link rel="stylesheet" href="{{ page.root }}static/syntax.css"> <link rel="stylesheet" href="{{ page.root }}static/syntax.css">
</body> </body>

View File

@ -7,8 +7,8 @@ root: ../
Introduction Introduction
------------ ------------
In this chapter we will learn how the basic structure of a mod's folder. In this chapter we will learn the basic structure of a mod's folder.
This is essential for creating mods. This is an essential skill when creating mods.
* Mod Folders * Mod Folders
* Dependencies * Dependencies
@ -17,18 +17,19 @@ This is essential for creating mods.
Mod Folders Mod Folders
----------- -----------
![Find the mod's folder]({{ page.root }}/static/folder_modfolder.png) ![Find the mod's folder]({{ page.root }}/static/folder_modfolder.jpg)
Each mod has its own folder, where all its Lua code, textures, models and sounds are placed. Each mod has its own folder, where all its Lua code, textures, models and sounds
These folders need to be placed in a mod location, such as minetest/mods, and they can be are placed. These folders need to be placed in a mod location, such as
placed in mod packs: as explained below. minetest/mods. Mods can be grouped into mod packs, which are explained below.
The modname is used to refer to a mod. Each mod should have a unique modname, which you can choose - A "mod name" is used to refer to a mod. Each mod should have a unique mod name,
it should describe what the mod does. Modnames can be make up of letters, numbers which you can choose - a good mod name can describes what the mod does.
or underscores. Mod names can be make up of letters, numbers or underscores. The folder a mod is
in needs to be called the same as the mod name.
### Mod Folder Structure ### Mod Folder Structure
Modname Mod name (eg: "mymod")
- init.lua - the main scripting code file, which is run when the game loads. - init.lua - the main scripting code file, which is run when the game loads.
- (optional) depends.txt - a list of mod names that needs to be loaded before this mod. - (optional) depends.txt - a list of mod names that needs to be loaded before this mod.
- (optional) textures/ - place images here, commonly in the format modname_itemname.png - (optional) textures/ - place images here, commonly in the format modname_itemname.png
@ -36,8 +37,8 @@ or underscores.
- (optional) models/ - place 3d models in here - (optional) models/ - place 3d models in here
...and any other lua files to be included by init.lua ...and any other lua files to be included by init.lua
Only the init.lua file is required in a mod for it to run on game load, however the other Only the init.lua file is required in a mod for it to run on game load, however
items are needed by some mods to perform its functionality. the other items are needed by some mods to perform their functionality.
Dependencies Dependencies
------------ ------------
@ -51,7 +52,7 @@ needs to be loaded before this mod.
modtwo modtwo
modthree? modthree?
As you can see, each mod name is on its own line. As you can see, each modname is on its own line.
Mod names with a question mark following them are optional dependencies. Mod names with a question mark following them are optional dependencies.
If an optional mod is installed, it is loaded before the current mod. If an optional mod is installed, it is loaded before the current mod.
@ -63,7 +64,7 @@ Mod Packs
--------- ---------
Modpacks allow multiple mods to be packaged together, and move together. Modpacks allow multiple mods to be packaged together, and move together.
They are useful if you want to supply multiple mods to an end user, and don't They are useful if you want to supply multiple mods to a player but don't
want to make them download each one individually. want to make them download each one individually.
### Mod Pack Folder Structure ### Mod Pack Folder Structure
@ -92,7 +93,7 @@ Are you confused? Don't worry, here is an example putting all of this together.
{% highlight lua %} {% highlight lua %}
print("This file will be run at load time!") print("This file will be run at load time!")
minetest.register_node("mymod:node",{ minetest.register_node("mymod:node", {
description = "This is a node", description = "This is a node",
tiles = { tiles = {
"mymod_node.png", "mymod_node.png",

BIN
static/folder_modfolder.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 KiB