Change headings to standard Markdown
This commit is contained in:
parent
c9b2bc178e
commit
e185c2d2d6
@ -4,8 +4,7 @@ layout: default
|
||||
root: ../
|
||||
---
|
||||
|
||||
Introduction
|
||||
------------
|
||||
## Introduction
|
||||
|
||||
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
|
||||
@ -16,8 +15,7 @@ massive amounts of lag. Use them lightly.
|
||||
* Special Growing Grass
|
||||
* Your Turn
|
||||
|
||||
Special Growing Grass
|
||||
---------------------
|
||||
## Special Growing Grass
|
||||
|
||||
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
|
||||
@ -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.
|
||||
|
||||
Your Turn
|
||||
---------
|
||||
## Your Turn
|
||||
|
||||
* **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.
|
||||
|
@ -4,8 +4,7 @@ layout: default
|
||||
root: ../
|
||||
---
|
||||
|
||||
Introduction
|
||||
------------
|
||||
## Introduction
|
||||
|
||||
In this chapter we will learn the basic structure of a mod's folder.
|
||||
This is an essential skill when creating mods.
|
||||
@ -14,8 +13,7 @@ This is an essential skill when creating mods.
|
||||
* Dependencies
|
||||
* Mod Packs
|
||||
|
||||
Mod Folders
|
||||
-----------
|
||||
## Mod Folders
|
||||
|
||||

|
||||
|
||||
@ -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
|
||||
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
|
||||
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
|
||||
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.
|
||||
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/
|
||||
- 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.
|
||||
|
||||
|
@ -4,8 +4,7 @@ layout: default
|
||||
root: ../
|
||||
---
|
||||
|
||||
Introduction
|
||||
------------
|
||||
## Introduction
|
||||
|
||||
<figure class="right_image">
|
||||
<img src="{{ page.root }}/static/formspec_example.png" alt="Furnace Inventory">
|
||||
@ -28,8 +27,7 @@ tend to disrupt game play.
|
||||
* Contexts
|
||||
* Node Meta Formspecs
|
||||
|
||||
Formspec Syntax
|
||||
---------------
|
||||
## Formspec Syntax
|
||||
|
||||
Formspecs have a rather weird syntax.
|
||||
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".
|
||||
It is near line 1019, at time of writing.
|
||||
|
||||
Displaying Formspecs
|
||||
--------------------
|
||||
## Displaying Formspecs
|
||||
|
||||
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"
|
||||
{% endhighlight %}
|
||||
|
||||
Callbacks
|
||||
---------
|
||||
## Callbacks
|
||||
|
||||
Let's expand on the above example.
|
||||
|
||||
@ -177,8 +173,7 @@ for a clicked button.
|
||||
}
|
||||
{% endhighlight %}
|
||||
|
||||
Contexts
|
||||
--------
|
||||
## Contexts
|
||||
|
||||
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
|
||||
@ -240,8 +235,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
end)
|
||||
{% endhighlight %}
|
||||
|
||||
Node Meta Formspecs
|
||||
-------------------
|
||||
## Node Meta Formspecs
|
||||
|
||||
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
|
||||
|
@ -11,8 +11,7 @@ root: ../
|
||||
Be aware that you may need to update your mods if the API is changed.
|
||||
</div>
|
||||
|
||||
Introduction
|
||||
------------
|
||||
## Introduction
|
||||
|
||||
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
|
||||
* Other Elements
|
||||
|
||||
Basic Interface
|
||||
---------------
|
||||
## Basic Interface
|
||||
|
||||
HUD elements are created using a player object.
|
||||
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)
|
||||
{% endhighlight %}
|
||||
|
||||
Positioning
|
||||
-----------
|
||||
## Positioning
|
||||
|
||||
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.
|
||||
@ -80,8 +77,7 @@ co-ordinates (0 * width + 10, 0 * height + 10).
|
||||
|
||||
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.\\
|
||||
Here is our earlier example, but with comments to explain each part:
|
||||
@ -112,8 +108,7 @@ local idx = player:hud_add({
|
||||
})
|
||||
{% endhighlight %}
|
||||
|
||||
Image Elements
|
||||
--------------
|
||||
## Image Elements
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
@ -4,8 +4,7 @@ layout: default
|
||||
root: ../
|
||||
---
|
||||
|
||||
Introduction
|
||||
------------
|
||||
## Introduction
|
||||
|
||||
In this chapter we will talk about scripting in Lua, the tools required,
|
||||
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
|
||||
* Including other Lua Scripts
|
||||
|
||||
Programming
|
||||
-----------
|
||||
## Programming
|
||||
|
||||
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.\\
|
||||
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.
|
||||
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.
|
||||
* 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.
|
||||
A local variable is only accessible from where it is defined. Here are some examples:
|
||||
@ -168,8 +164,7 @@ end
|
||||
mymod.foo("foobar")
|
||||
{% endhighlight %}
|
||||
|
||||
Including other Lua Scripts
|
||||
---------------------------
|
||||
## Including other Lua Scripts
|
||||
|
||||
You can include Lua scripts from your mod, or another mod like this:
|
||||
|
||||
|
@ -11,8 +11,7 @@ root: ../
|
||||
and placeholder images are being used.
|
||||
</div>
|
||||
|
||||
Introduction
|
||||
------------
|
||||
## Introduction
|
||||
|
||||
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
|
||||
* Mesh
|
||||
|
||||
Normal
|
||||
------
|
||||
## Normal
|
||||
|
||||
<figure class="right_image">
|
||||
<img src="{{ page.root }}/static/drawtype_normal.png" alt="Normal Drawtype">
|
||||
@ -77,8 +75,7 @@ minetest.register_node("mymod:diamond", {
|
||||
{% endhighlight %}
|
||||
|
||||
|
||||
Airlike
|
||||
-------
|
||||
## Airlike
|
||||
|
||||
These nodes are see through, and thus have no textures.
|
||||
|
||||
@ -105,8 +102,7 @@ minetest.register_node("myair:air", {
|
||||
})
|
||||
{% endhighlight %}
|
||||
|
||||
Liquid
|
||||
------
|
||||
## Liquid
|
||||
|
||||
<figure class="right_image">
|
||||
<img src="{{ page.root }}/static/drawtype_liquid.png" alt="Liquid Drawtype">
|
||||
@ -183,8 +179,7 @@ minetest.register_node("default:water_source", {
|
||||
See default:water_flowing in the default mod in minetest_game, it is mostly
|
||||
the same as the above example
|
||||
|
||||
Glasslike
|
||||
---------
|
||||
## Glasslike
|
||||
|
||||
<figure class="right_image">
|
||||
<img src="{{ page.root }}/static/drawtype_glasslike.png" alt="Glasslike Drawtype">
|
||||
@ -216,11 +211,10 @@ minetest.register_node("default:obsidian_glass", {
|
||||
})
|
||||
{% endhighlight %}
|
||||
|
||||
Glasslike_Framed
|
||||
----------------
|
||||
## Glasslike_Framed
|
||||
|
||||
This makes the node's edge go around the whole thing, rather than individual nodes,
|
||||
like the following:
|
||||
This makes the node's edge go around the whole thing with a 3D effect, rather
|
||||
than individual nodes, like the following:
|
||||
|
||||
<figure>
|
||||
<img src="{{ page.root }}/static/drawtype_glasslike_framed.png" alt="Glasslike_framed's Edges">
|
||||
@ -250,8 +244,7 @@ minetest.register_node("default:glass", {
|
||||
|
||||
"optional" drawtypes need less rendering time if deactivated on the client's side.
|
||||
|
||||
Allfaces
|
||||
--------
|
||||
## Allfaces
|
||||
|
||||
<figure class="right_image">
|
||||
<img src="{{ page.root }}/static/drawtype_allfaces.png" alt="Allfaces drawtype">
|
||||
@ -313,8 +306,7 @@ minetest.register_node("foobar:torch", {
|
||||
})
|
||||
{% endhighlight %}
|
||||
|
||||
Nodebox
|
||||
-------
|
||||
## Nodebox
|
||||
|
||||
<figure class="right_image">
|
||||
<img src="{{ page.root }}/static/drawtype_nodebox.gif" alt="Nodebox drawtype">
|
||||
|
@ -4,8 +4,7 @@ layout: default
|
||||
root: ../
|
||||
---
|
||||
|
||||
Introduction
|
||||
------------
|
||||
## Introduction
|
||||
|
||||
In this chapter we will learn how to register a new node or craftitem,
|
||||
and create craft recipes.
|
||||
@ -18,8 +17,7 @@ and create craft recipes.
|
||||
* Crafting
|
||||
* Groups
|
||||
|
||||
Item Strings
|
||||
------------
|
||||
## Item Strings
|
||||
|
||||
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.
|
||||
@ -41,8 +39,7 @@ Overriding allows you to:
|
||||
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.
|
||||
|
||||
Textures
|
||||
--------
|
||||
## Textures
|
||||
|
||||
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),
|
||||
@ -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``.\\
|
||||
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.
|
||||
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!")
|
||||
|
||||
-- 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)
|
||||
if result then
|
||||
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
|
||||
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.
|
||||
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.
|
||||
|
||||
Crafting
|
||||
--------
|
||||
## Crafting
|
||||
|
||||
There are several different types of crafting,
|
||||
identified by the ``type`` property.
|
||||
@ -235,8 +229,7 @@ minetest.register_craft({
|
||||
|
||||
(Explainations of more crafting types are coming soon)
|
||||
|
||||
Groups
|
||||
------
|
||||
## Groups
|
||||
|
||||
Items can be members of many groups, and groups may have many members.
|
||||
Groups are usually identified using ``group:group_name``
|
||||
|
@ -4,8 +4,7 @@ layout: default
|
||||
root: ../
|
||||
---
|
||||
|
||||
Introduction
|
||||
------------
|
||||
## Introduction
|
||||
|
||||
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
|
||||
@ -15,8 +14,7 @@ as strong.
|
||||
* Basic Interface
|
||||
* Your Turn
|
||||
|
||||
Basic Interface
|
||||
---------------
|
||||
## Basic Interface
|
||||
|
||||
Here is an example which adds an antigravity command, which
|
||||
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
|
||||
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.
|
||||
* **super bounce**: Increase the jump value so that the player can jump up 20 meters (1 meter is 1 block).
|
||||
|
@ -4,8 +4,7 @@ layout: default
|
||||
root: ../
|
||||
---
|
||||
|
||||
Introduction
|
||||
------------
|
||||
## Introduction
|
||||
|
||||
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 your mod useful?
|
||||
|
||||
License Choices
|
||||
---------------
|
||||
## License Choices
|
||||
|
||||
You need to specify a license for your mod.
|
||||
**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.
|
||||
They can be used for both code and art.
|
||||
|
||||
Packaging
|
||||
---------
|
||||
## Packaging
|
||||
|
||||
There are some files that we recommend you include in your mod
|
||||
when you release it.
|
||||
@ -182,8 +179,7 @@ Click browse and select the zipped file. I suggest that you enter the version of
|
||||
</figcaption>
|
||||
</figure>
|
||||
|
||||
Forum Topic
|
||||
-----------
|
||||
## Forum Topic
|
||||
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user