Change headings to standard Markdown

gh-pages
rubenwardy 2015-02-22 10:28:37 +00:00
parent c9b2bc178e
commit e185c2d2d6
9 changed files with 62 additions and 109 deletions

View File

@ -4,8 +4,7 @@ layout: default
root: ../ root: ../
--- ---
Introduction ## Introduction
------------
In this chapter we will learn how to create an **A**ctive **B**lock **M**odifier (**ABM**). In this chapter we will learn how to create an **A**ctive **B**lock **M**odifier (**ABM**).
An active block modifier allows you to run code on certain nodes at certain An active block modifier allows you to run code on certain nodes at certain
@ -16,8 +15,7 @@ massive amounts of lag. Use them lightly.
* Special Growing Grass * Special Growing Grass
* Your Turn * Your Turn
Special Growing Grass ## Special Growing Grass
---------------------
We are now going to make a mod (yay!). We are now going to make a mod (yay!).
It will add a type of grass called alien grass - it grows near water on grassy It will add a type of grass called alien grass - it grows near water on grassy
@ -50,8 +48,7 @@ blocks above grass blocks - you should check there is space by doing minetest.ge
That's really all there is to ABMs. Specifying a neighbor is optional, so is chance. That's really all there is to ABMs. Specifying a neighbor is optional, so is chance.
Your Turn ## Your Turn
---------
* **Midas touch**: Make water turn to gold blocks with a 1 in 100 chance, every 5 seconds. * **Midas touch**: Make water turn to gold blocks with a 1 in 100 chance, every 5 seconds.
* **Decay**: Make wood turn into dirt when water is a neighbor. * **Decay**: Make wood turn into dirt when water is a neighbor.

View File

@ -4,8 +4,7 @@ layout: default
root: ../ root: ../
--- ---
Introduction ## Introduction
------------
In this chapter we will learn the basic structure of a mod's folder. In this chapter we will learn the basic structure of a mod's folder.
This is an essential skill when creating mods. This is an essential skill when creating mods.
@ -14,8 +13,7 @@ This is an essential skill when creating mods.
* Dependencies * Dependencies
* Mod Packs * Mod Packs
Mod Folders ## Mod Folders
-----------
![Find the mod's folder]({{ page.root }}/static/folder_modfolder.jpg) ![Find the mod's folder]({{ page.root }}/static/folder_modfolder.jpg)
@ -40,8 +38,7 @@ in needs to be called the same as the mod name.
Only the init.lua file is required in a mod for it to run on game load, however Only the init.lua file is required in a mod for it to run on game load, however
the other items are needed by some mods to perform their functionality. the other items are needed by some mods to perform their functionality.
Dependencies ## Dependencies
------------
The depends text file allows you to specify what mods this mod requires to run, and what The depends text file allows you to specify what mods this mod requires to run, and what
needs to be loaded before this mod. needs to be loaded before this mod.
@ -60,8 +57,7 @@ However, if the mod is not installed, the current one still loads.
This is in contrast to normal dependencies, which will cause the current This is in contrast to normal dependencies, which will cause the current
mod not to work if the mod is not installed. mod not to work if the mod is not installed.
Mod Packs ## 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 a player but don't They are useful if you want to supply multiple mods to a player but don't
@ -75,8 +71,7 @@ want to make them download each one individually.
- modfour/ - modfour/
- modpack.txt signals that this is a mod pack, content does not matter - modpack.txt signals that this is a mod pack, content does not matter
Example Time ## Example Time
------------
Are you confused? Don't worry, here is an example putting all of this together. Are you confused? Don't worry, here is an example putting all of this together.

View File

@ -4,8 +4,7 @@ layout: default
root: ../ root: ../
--- ---
Introduction ## Introduction
------------
<figure class="right_image"> <figure class="right_image">
<img src="{{ page.root }}/static/formspec_example.png" alt="Furnace Inventory"> <img src="{{ page.root }}/static/formspec_example.png" alt="Furnace Inventory">
@ -28,8 +27,7 @@ tend to disrupt game play.
* Contexts * Contexts
* Node Meta Formspecs * Node Meta Formspecs
Formspec Syntax ## Formspec Syntax
---------------
Formspecs have a rather weird syntax. Formspecs have a rather weird syntax.
They consist of a series of tags which are in the following form: They consist of a series of tags which are in the following form:
@ -68,8 +66,7 @@ You should look in [lua_api.txt](https://github.com/minetest/minetest/blob/maste
for a list of all possible elements, just search for "Formspec". for a list of all possible elements, just search for "Formspec".
It is near line 1019, at time of writing. It is near line 1019, at time of writing.
Displaying Formspecs ## Displaying Formspecs
--------------------
Here is a generalized way to show a formspec Here is a generalized way to show a formspec
@ -114,8 +111,7 @@ Note: the .. is used to join two strings together. The following two lines are e
"foo" .. "bar" "foo" .. "bar"
{% endhighlight %} {% endhighlight %}
Callbacks ## Callbacks
---------
Let's expand on the above example. Let's expand on the above example.
@ -177,8 +173,7 @@ for a clicked button.
} }
{% endhighlight %} {% endhighlight %}
Contexts ## Contexts
--------
In quite a lot of cases you want your minetest.show_formspec to give information In quite a lot of cases you want your minetest.show_formspec to give information
to the callback which you don't want to have to send to the client. Information to the callback which you don't want to have to send to the client. Information
@ -240,8 +235,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end) end)
{% endhighlight %} {% endhighlight %}
Node Meta Formspecs ## Node Meta Formspecs
-------------------
minetest.show_formspec is not the only way to show a formspec, you can also minetest.show_formspec is not the only way to show a formspec, you can also
add formspecs to a node's meta data. This is used on nodes such as chests to add formspecs to a node's meta data. This is used on nodes such as chests to

View File

@ -11,8 +11,7 @@ root: ../
Be aware that you may need to update your mods if the API is changed. Be aware that you may need to update your mods if the API is changed.
</div> </div>
Introduction ## Introduction
------------
Heads Up Display (HUD) elements allow you to show text, images, and other graphical elements. Heads Up Display (HUD) elements allow you to show text, images, and other graphical elements.
@ -24,8 +23,7 @@ HUD doesn't accept user input. For that, you should use a [Formspec](formspecs.h
* Image Elements * Image Elements
* Other Elements * Other Elements
Basic Interface ## Basic Interface
---------------
HUD elements are created using a player object. HUD elements are created using a player object.
You can get the player object from a username like this: You can get the player object from a username like this:
@ -64,8 +62,7 @@ You can also delete the element:
player:hud_remove(idx) player:hud_remove(idx)
{% endhighlight %} {% endhighlight %}
Positioning ## Positioning
-----------
Screens come in different sizes, and HUD elements need to work well on all sizes. Screens come in different sizes, and HUD elements need to work well on all sizes.
You locate an element using a combination of a position and an offset. You locate an element using a combination of a position and an offset.
@ -80,8 +77,7 @@ co-ordinates (0 * width + 10, 0 * height + 10).
Please note that offset scales to DPI and a user defined factor. Please note that offset scales to DPI and a user defined factor.
Text Elements ## Text Elements
-------------
A text element is the simplest form of a HUD element.\\ A text element is the simplest form of a HUD element.\\
Here is our earlier example, but with comments to explain each part: Here is our earlier example, but with comments to explain each part:
@ -112,8 +108,7 @@ local idx = player:hud_add({
}) })
{% endhighlight %} {% endhighlight %}
Image Elements ## Image Elements
--------------
Displays an image on the HUD. Displays an image on the HUD.
@ -122,7 +117,6 @@ Negative values represent that percentage of the screen it should take; e.g. x=-
Use `text` to specify the name of the texture. Use `text` to specify the name of the texture.
Other Elements ## Other Elements
--------------
Have a look at [lua_api.txt]({{ page.root }}lua_api.html#hud-element-types) for a complete list of HUD elements. Have a look at [lua_api.txt]({{ page.root }}lua_api.html#hud-element-types) for a complete list of HUD elements.

View File

@ -4,8 +4,7 @@ layout: default
root: ../ root: ../
--- ---
Introduction ## Introduction
------------
In this chapter we will talk about scripting in Lua, the tools required, In this chapter we will talk about scripting in Lua, the tools required,
and go over some techniques which you will probably find useful. and go over some techniques which you will probably find useful.
@ -16,8 +15,7 @@ and go over some techniques which you will probably find useful.
* Local and Global * Local and Global
* Including other Lua Scripts * Including other Lua Scripts
Programming ## Programming
-----------
Teaching you how to program is beyond the scope of this book. Teaching you how to program is beyond the scope of this book.
@ -31,8 +29,7 @@ learning the problem solving techniques required to program.\\
Programming is all about breaking down problems into steps a computer can manage.\\ Programming is all about breaking down problems into steps a computer can manage.\\
Scratch is **designed to teach children** how to program, it isn't a serious programming language. Scratch is **designed to teach children** how to program, it isn't a serious programming language.
Tools ## Tools
-----
A text editor with code highlighting is sufficient for writing scripts in Lua. A text editor with code highlighting is sufficient for writing scripts in Lua.
Code highlighting gives different colors to different words and characters Code highlighting gives different colors to different words and characters
@ -80,8 +77,7 @@ One such IDE is Eclipse with the Koneki Lua plugin:
* Start Minetest. * Start Minetest.
* Enter the game to startup Lua. * Enter the game to startup Lua.
Local and Global ## Local and Global
----------------
Whether a variable is local or global determines where it can be written to or read to. Whether a variable is local or global determines where it can be written to or read to.
A local variable is only accessible from where it is defined. Here are some examples: A local variable is only accessible from where it is defined. Here are some examples:
@ -168,8 +164,7 @@ end
mymod.foo("foobar") mymod.foo("foobar")
{% endhighlight %} {% endhighlight %}
Including other Lua Scripts ## Including other Lua Scripts
---------------------------
You can include Lua scripts from your mod, or another mod like this: You can include Lua scripts from your mod, or another mod like this:

View File

@ -11,8 +11,7 @@ root: ../
and placeholder images are being used. and placeholder images are being used.
</div> </div>
Introduction ## Introduction
------------
In this chapter we explain all the different types of node drawtypes there are. In this chapter we explain all the different types of node drawtypes there are.
@ -44,8 +43,7 @@ This article is not complete yet. These drawtypes are missing:
* Raillike * Raillike
* Mesh * Mesh
Normal ## Normal
------
<figure class="right_image"> <figure class="right_image">
<img src="{{ page.root }}/static/drawtype_normal.png" alt="Normal Drawtype"> <img src="{{ page.root }}/static/drawtype_normal.png" alt="Normal Drawtype">
@ -77,8 +75,7 @@ minetest.register_node("mymod:diamond", {
{% endhighlight %} {% endhighlight %}
Airlike ## Airlike
-------
These nodes are see through, and thus have no textures. These nodes are see through, and thus have no textures.
@ -86,11 +83,11 @@ These nodes are see through, and thus have no textures.
minetest.register_node("myair:air", { minetest.register_node("myair:air", {
description = "MyAir (you hacker you!)", description = "MyAir (you hacker you!)",
drawtype = "airlike", drawtype = "airlike",
paramtype = "light", paramtype = "light",
-- ^ Allows light to propagate through the node with the -- ^ Allows light to propagate through the node with the
-- light value falling by 1 per node. -- light value falling by 1 per node.
sunlight_propagates = true, -- Sunlight shines through sunlight_propagates = true, -- Sunlight shines through
walkable = false, -- Would make the player collide with the air node walkable = false, -- Would make the player collide with the air node
pointable = false, -- You can't select the node pointable = false, -- You can't select the node
@ -98,15 +95,14 @@ minetest.register_node("myair:air", {
buildable_to = true, -- Nodes can be replace this node. buildable_to = true, -- Nodes can be replace this node.
-- (you can place a node and remove the air node -- (you can place a node and remove the air node
-- that used to be there) -- that used to be there)
air_equivalent = true, air_equivalent = true,
drop = "", drop = "",
groups = {not_in_creative_inventory=1} groups = {not_in_creative_inventory=1}
}) })
{% endhighlight %} {% endhighlight %}
Liquid ## Liquid
------
<figure class="right_image"> <figure class="right_image">
<img src="{{ page.root }}/static/drawtype_liquid.png" alt="Liquid Drawtype"> <img src="{{ page.root }}/static/drawtype_liquid.png" alt="Liquid Drawtype">
@ -126,7 +122,7 @@ minetest.register_node("default:water_source", {
inventory_image = minetest.inventorycube("default_water.png"), inventory_image = minetest.inventorycube("default_water.png"),
-- ^ this is required to stop the inventory image from being animated -- ^ this is required to stop the inventory image from being animated
tiles = { tiles = {
{ {
name = "default_water_source_animated.png", name = "default_water_source_animated.png",
@ -138,7 +134,7 @@ minetest.register_node("default:water_source", {
} }
} }
}, },
special_tiles = { special_tiles = {
-- New-style water source material (mostly unused) -- New-style water source material (mostly unused)
{ {
@ -183,8 +179,7 @@ minetest.register_node("default:water_source", {
See default:water_flowing in the default mod in minetest_game, it is mostly See default:water_flowing in the default mod in minetest_game, it is mostly
the same as the above example the same as the above example
Glasslike ## Glasslike
---------
<figure class="right_image"> <figure class="right_image">
<img src="{{ page.root }}/static/drawtype_glasslike.png" alt="Glasslike Drawtype"> <img src="{{ page.root }}/static/drawtype_glasslike.png" alt="Glasslike Drawtype">
@ -216,11 +211,10 @@ minetest.register_node("default:obsidian_glass", {
}) })
{% endhighlight %} {% endhighlight %}
Glasslike_Framed ## Glasslike_Framed
----------------
This makes the node's edge go around the whole thing, rather than individual nodes, This makes the node's edge go around the whole thing with a 3D effect, rather
like the following: than individual nodes, like the following:
<figure> <figure>
<img src="{{ page.root }}/static/drawtype_glasslike_framed.png" alt="Glasslike_framed's Edges"> <img src="{{ page.root }}/static/drawtype_glasslike_framed.png" alt="Glasslike_framed's Edges">
@ -233,14 +227,14 @@ like the following:
minetest.register_node("default:glass", { minetest.register_node("default:glass", {
description = "Glass", description = "Glass",
drawtype = "glasslike_framed", drawtype = "glasslike_framed",
tiles = {"default_glass.png", "default_glass_detail.png"}, tiles = {"default_glass.png", "default_glass_detail.png"},
inventory_image = minetest.inventorycube("default_glass.png"), inventory_image = minetest.inventorycube("default_glass.png"),
paramtype = "light", paramtype = "light",
sunlight_propagates = true, -- Sunlight can shine through block sunlight_propagates = true, -- Sunlight can shine through block
is_ground_content = false, -- Stops caves from being generated over this node. is_ground_content = false, -- Stops caves from being generated over this node.
groups = {cracky = 3, oddly_breakable_by_hand = 3}, groups = {cracky = 3, oddly_breakable_by_hand = 3},
sounds = default.node_sound_glass_defaults() sounds = default.node_sound_glass_defaults()
}) })
@ -250,8 +244,7 @@ minetest.register_node("default:glass", {
"optional" drawtypes need less rendering time if deactivated on the client's side. "optional" drawtypes need less rendering time if deactivated on the client's side.
Allfaces ## Allfaces
--------
<figure class="right_image"> <figure class="right_image">
<img src="{{ page.root }}/static/drawtype_allfaces.png" alt="Allfaces drawtype"> <img src="{{ page.root }}/static/drawtype_allfaces.png" alt="Allfaces drawtype">
@ -298,7 +291,7 @@ minetest.register_node("foobar:torch", {
inventory_image = "foobar_torch_floor.png", inventory_image = "foobar_torch_floor.png",
wield_image = "default_torch_floor.png", wield_image = "default_torch_floor.png",
light_source = LIGHT_MAX-1, light_source = LIGHT_MAX-1,
-- Determines how the torch is selected, ie: the wire box around it. -- Determines how the torch is selected, ie: the wire box around it.
-- each value is { x1, y1, z1, x2, y2, z2 } -- each value is { x1, y1, z1, x2, y2, z2 }
-- (x1, y1, y1) is the bottom front left corner -- (x1, y1, y1) is the bottom front left corner
@ -313,8 +306,7 @@ minetest.register_node("foobar:torch", {
}) })
{% endhighlight %} {% endhighlight %}
Nodebox ## Nodebox
-------
<figure class="right_image"> <figure class="right_image">
<img src="{{ page.root }}/static/drawtype_nodebox.gif" alt="Nodebox drawtype"> <img src="{{ page.root }}/static/drawtype_nodebox.gif" alt="Nodebox drawtype">

View File

@ -4,8 +4,7 @@ layout: default
root: ../ root: ../
--- ---
Introduction ## Introduction
------------
In this chapter we will learn how to register a new node or craftitem, In this chapter we will learn how to register a new node or craftitem,
and create craft recipes. and create craft recipes.
@ -18,8 +17,7 @@ and create craft recipes.
* Crafting * Crafting
* Groups * Groups
Item Strings ## Item Strings
------------
Each item, whether that be a node, craftitem, tool or entity, has an item string.\\ Each item, whether that be a node, craftitem, tool or entity, has an item string.\\
This is sometimes referred to as registered name or just name. This is sometimes referred to as registered name or just name.
@ -41,8 +39,7 @@ Overriding allows you to:
To override, you prefix the item string with a colon, ``:``. To override, you prefix the item string with a colon, ``:``.
Declaring an item as ``:default:dirt`` will override the default:dirt in the default mod. Declaring an item as ``:default:dirt`` will override the default:dirt in the default mod.
Textures ## Textures
--------
Textures are usually 16 by 16 pixels. Textures are usually 16 by 16 pixels.
They can be any resolution, but it is recommended that they are in the order of 2 (eg, 16, 32, 64, 128, etc), They can be any resolution, but it is recommended that they are in the order of 2 (eg, 16, 32, 64, 128, etc),
@ -51,8 +48,7 @@ as other resolutions may not be supported correctly on older devices.
Textures should be placed in textures/. Their name should match ``modname_itemname.png``.\\ Textures should be placed in textures/. Their name should match ``modname_itemname.png``.\\
JPEGs are supported, but they do not support transparency and are generally bad quality at low resolutions. JPEGs are supported, but they do not support transparency and are generally bad quality at low resolutions.
Registering a Craftitem ## Registering a Craftitem
-----------------------
Craftitems are the simplest items in Minetest. Craftitems cannot be placed in the world. Craftitems are the simplest items in Minetest. Craftitems cannot be placed in the world.
They are used in recipes to create other items, or they can be used be the player, such as food. They are used in recipes to create other items, or they can be used be the player, such as food.
@ -107,7 +103,7 @@ minetest.register_craftitem("mymod:mudpie", {
minetest.chat_send_player(user:get_player_name(), "You ate an alien mud pie!") minetest.chat_send_player(user:get_player_name(), "You ate an alien mud pie!")
-- Support for hunger mods using minetest.register_on_item_eat -- Support for hunger mods using minetest.register_on_item_eat
for _, callback in pairs(minetest.registered_on_item_eats) do for _ , callback in pairs(minetest.registered_on_item_eats) do
local result = callback(hp_change, replace_with_item, itemstack, user, pointed_thing) local result = callback(hp_change, replace_with_item, itemstack, user, pointed_thing)
if result then if result then
return result return result
@ -126,8 +122,7 @@ minetest.register_craftitem("mymod:mudpie", {
If you are creating a hunger mod, or if you are affecting foods outside of your If you are creating a hunger mod, or if you are affecting foods outside of your
mod, you should consider using minetest.register_on_item_eat mod, you should consider using minetest.register_on_item_eat
Registering a basic node ## Registering a basic node
------------------------
In Minetest, a node is an item that you can place. In Minetest, a node is an item that you can place.
Most nodes are 1m x 1m x 1m cubes, however the shape doesn't Most nodes are 1m x 1m x 1m cubes, however the shape doesn't
@ -178,8 +173,7 @@ minetest.register_node("mymod:diamond", {
The is_ground_content attribute allows caves to be generated over the stone. The is_ground_content attribute allows caves to be generated over the stone.
Crafting ## Crafting
--------
There are several different types of crafting, There are several different types of crafting,
identified by the ``type`` property. identified by the ``type`` property.
@ -235,8 +229,7 @@ minetest.register_craft({
(Explainations of more crafting types are coming soon) (Explainations of more crafting types are coming soon)
Groups ## Groups
------
Items can be members of many groups, and groups may have many members. Items can be members of many groups, and groups may have many members.
Groups are usually identified using ``group:group_name`` Groups are usually identified using ``group:group_name``

View File

@ -4,8 +4,7 @@ layout: default
root: ../ root: ../
--- ---
Introduction ## Introduction
------------
Player physics can be modified using physics overrides. Physics overrides can set the Player physics can be modified using physics overrides. Physics overrides can set the
walking speed, jump speed and gravity constants. Physics overrides are set on a player walking speed, jump speed and gravity constants. Physics overrides are set on a player
@ -15,8 +14,7 @@ as strong.
* Basic Interface * Basic Interface
* Your Turn * Your Turn
Basic Interface ## Basic Interface
---------------
Here is an example which adds an antigravity command, which Here is an example which adds an antigravity command, which
puts the caller in low G: puts the caller in low G:
@ -57,8 +55,7 @@ Please be warned that mods that override the physics of a player tend
to be incompatible with each other. When setting an override, it overwrites to be incompatible with each other. When setting an override, it overwrites
and override that has been set before, by your or anyone else's mod. and override that has been set before, by your or anyone else's mod.
Your Turn ## Your Turn
---------
* **sonic**: Set the speed multiplayer to a high value (at least 6) when a player joins the game. * **sonic**: Set the speed multiplayer to a high value (at least 6) when a player joins the game.
* **super bounce**: Increase the jump value so that the player can jump up 20 meters (1 meter is 1 block). * **super bounce**: Increase the jump value so that the player can jump up 20 meters (1 meter is 1 block).

View File

@ -4,8 +4,7 @@ layout: default
root: ../ root: ../
--- ---
Introduction ## Introduction
------------
In this chapter we will find out how to publish a mod so that other users can use it. In this chapter we will find out how to publish a mod so that other users can use it.
@ -19,8 +18,7 @@ In this chapter we will find out how to publish a mod so that other users can us
* Is there another mod that does the same thing? If so, how does yours differ or improve on it? * Is there another mod that does the same thing? If so, how does yours differ or improve on it?
* Is your mod useful? * Is your mod useful?
License Choices ## License Choices
---------------
You need to specify a license for your mod. You need to specify a license for your mod.
**Public domain is not a valid licence**, as the definition varies in different countries. **Public domain is not a valid licence**, as the definition varies in different countries.
@ -71,8 +69,7 @@ These licenses allows anyone to do what they want with your mod.
Modify, redistribute, sell, leave out attribution. Modify, redistribute, sell, leave out attribution.
They can be used for both code and art. They can be used for both code and art.
Packaging ## Packaging
---------
There are some files that we recommend you include in your mod There are some files that we recommend you include in your mod
when you release it. when you release it.
@ -182,11 +179,10 @@ Click browse and select the zipped file. I suggest that you enter the version of
</figcaption> </figcaption>
</figure> </figure>
Forum Topic ## Forum Topic
-----------
You can now create a forum topic. You should create it in You can now create a forum topic. You should create it in
the ["WIP Mods"](https://forum.minetest.net/viewforum.php?f=9) (Work In Progress) the ["WIP Mods"](https://forum.minetest.net/viewforum.php?f=9) (Work In Progress)
forum.\\ forum.\\
When you consider your mod no longer a work in progress, you can When you consider your mod no longer a work in progress, you can
[request that it be moved](https://forum.minetest.net/viewtopic.php?f=11&t=10418) [request that it be moved](https://forum.minetest.net/viewtopic.php?f=11&t=10418)
@ -233,7 +229,7 @@ Here is an example. The Minetest forum uses bbcode for formating.
For further information or help see: For further information or help see:
[url]http://wiki.minetest.com/wiki/Installing_Mods[/url] [url]http://wiki.minetest.com/wiki/Installing_Mods[/url]
If you modify the above example for your mod topic, remember to If you modify the above example for your mod topic, remember to
change "modfldername" to the name of the folder your mod should be change "modfldername" to the name of the folder your mod should be
in. in.