Difference between revisions of "Modding FAQ"
Domtron vox (talk | contribs) (Contributed by HeroOfTheWinds but by my misleading it got posted in the wrong wiki.) |
Domtron vox (talk | contribs) |
||
Line 26: | Line 26: | ||
<br /> | <br /> | ||
− | + | === General Information on Registering Nodes === | |
− | + | See [http://dev.minetest.net/minetest.register_node minetest.register_node]. | |
+ | <br /> | ||
− | + | === How can I make my new nodes transparent in certain sections? === | |
<br /> | <br /> | ||
Line 35: | Line 36: | ||
<br /> | <br /> | ||
− | + | === What if I only want it partially transparent, such as with tinted glass? === | |
<br /> | <br /> | ||
To do this, add <code>use_texture_alpha = true</code> to the node definition while following the directions above.<br /> | To do this, add <code>use_texture_alpha = true</code> to the node definition while following the directions above.<br /> |
Revision as of 22:29, 18 July 2014
Basic Modding
What is a Mod
Mods (short for modifications) are user-created modifications to the game in such a way that alters gameplay. Some larger mods may add a lot of content to the game, while other smaller mods may add more settings/customization options, or optimize the speed, gameplay or graphics of Minetest. Server mods or plugins mainly give server admins more options and ease of use, and all mods for single-player can also be used in multiplayer.
Installing Mods
See Installing Mods
Where Do I Find Tutorials and Documentation About Modding?
Start at the Minetest Developer Wiki. It isn't just about changing the Minetest (C++) core program. There are articles and references about modding you can find right from the main page. Look for the "Develop a mod" and "Modding API" headings.
For obscure details about the modding API that seem poorly documented or not yet documented at all, check the lua_api.txt file shipped with Minetest, and other stuff under the doc directory (links are to latest versions in Git; for ones that apply directly to your installed version of Minetest, see the files included in your download/install). The Developer Wiki is very much a community project, so don't forget to go back there and help document what you find!
Finally, for more interactive support head over to the Modding General section of the Minetest forums. The forum search seems to be mostly broken, but the forums are crawled and indexed so you can always try a narrowed web search (e.g. include the term site:forum.minetest.net
in a Google search).
Specific Questions Regarding Node Definitions
General Information on Registering Nodes
How can I make my new nodes transparent in certain sections?
To make a node have transparent patches, you need to do two things: Have your image texture be transparent where you need it to be, and second, you need to specify the node's drawtype
to be one of the following: "glasslike", "glasslike_framed", "allfaces", or "allfaces_optional".
What if I only want it partially transparent, such as with tinted glass?
To do this, add use_texture_alpha = true
to the node definition while following the directions above.
How Do I Generate a Custom Map?
First, there are a bunch of mapgen parameters you can change for the built-in mapgens, so you might be able to get what you want without touching Lua at all. You may also be able to find an existing mod that does what you want, so check the mod list here and the Mod Releases section of the forums (the community has already written several mods for various map generation, importing real-world data, editing sections of existing worlds, etc.). Finally, the Lua modding API has recently been enhanced to make custom mapgens more feasible to write without modifying the core Minetest engine. It's not for the feint of heart but if you want to dive in, start by reading up in the Developer Wiki on:
- Category:Mapgen
- VoxelManip: the voxel manipulator, for fast modification of large chunks of nodes.
- minetest.register_on_generated: for handling freshly-minted, previously unexplored sections of the map.
- minetest.spawn_tree. L-system generation for trees and other interesting constructs.
- minetest.create_schematic and minetest.place_schematic: schematics/templates for cookie-cutter placement of pre-planned sections that can include minor variation.
This is a pretty advanced task to do in a mod, so expect to also have to do some digging and research in the lua_api.txt document.