diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 3d5420cfe..0d42d8ef6 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -51,7 +51,7 @@ where gameid is unique to each game. The game directory contains the file game.conf, which contains these fields: name = -eg. +e.g. name = Minetest The game directory can contain the file minetest.conf, which will be used @@ -66,14 +66,14 @@ Generic: $path_user/mods/ <-- User-installed mods $worldpath/worldmods/ -In a run-in-place version (eg. the distributed windows version): +In a run-in-place version (e.g. the distributed windows version): minetest-0.4.x/games/gameid/mods/ - minetest-0.4.x/mods/gameid/ <-- User-installed mods + minetest-0.4.x/mods/ <-- User-installed mods minetest-0.4.x/worlds/worldname/worldmods/ -On an installed version on linux: +On an installed version on Linux: /usr/share/minetest/games/gameid/mods/ - ~/.minetest/mods/gameid/ <-- User-installed mods + ~/.minetest/mods/ <-- User-installed mods ~/.minetest/worlds/worldname/worldmods Mod load path for world-specific games @@ -81,7 +81,7 @@ Mod load path for world-specific games It is possible to include a game in a world; in this case, no mods or games are loaded or checked from anywhere else. -This is useful for eg. adventure worlds. +This is useful for e.g. adventure worlds. This happens if the following directory exists: $world/game/ @@ -127,7 +127,7 @@ screenshot.png: A screenshot shown in modmanager within mainmenu. description.txt: - File containing desctiption to be shown within mainmenu. + File containing description to be shown within mainmenu. init.lua: The main Lua script. Running this script should register everything it @@ -170,30 +170,30 @@ convert_to. This can be used for maintaining backwards compatibility. -This can be also used for setting quick access names for things, eg. if +This can be also used for setting quick access names for things, e.g. if you have an item called epiclylongmodname:stuff, you could do minetest.register_alias("stuff", "epiclylongmodname:stuff") and be able to use "/giveme stuff". Textures -------- -Mods should generally prefix their textures with modname_, eg. given +Mods should generally prefix their textures with modname_, e.g. given the mod name "foomod", a texture could be called "foomod_foothing.png" Textures are referred to by their complete name, or alternatively by stripping out the file extension: - eg. foomod_foothing.png - eg. foomod_foothing + e.g. foomod_foothing.png + e.g. foomod_foothing Sounds ------- -Only OGG files are supported. +Only OGG Vorbis files are supported. For positional playing of sounds, only single-channel (mono) files are supported. Otherwise OpenAL will play them non-positionally. -Mods should generally prefix their sounds with modname_, eg. given +Mods should generally prefix their sounds with modname_, e.g. given the mod name "foomod", a sound could be called "foomod_foosound.ogg" @@ -210,11 +210,11 @@ from the available ones of the following files: foomod_foosound.9.ogg Examples of sound parameter tables: --- Play locationless on all clients +-- Play location-less on all clients { gain = 1.0, -- default } --- Play locationless to a player +-- Play location-less to a player { to_player = name, gain = 1.0, -- default @@ -234,11 +234,11 @@ Examples of sound parameter tables: } SimpleSoundSpec: -eg. "" -eg. "default_place_node" -eg. {} -eg. {name="default_place_node"} -eg. {name="default_place_node", gain=1.0} +e.g. "" +e.g. "default_place_node" +e.g. {} +e.g. {name="default_place_node"} +e.g. {name="default_place_node", gain=1.0} Registered definitions of stuff -------------------------------- @@ -259,7 +259,7 @@ minetest.register_craftitem(name, item definition) -> minetest.registered_items[name] Note that in some cases you will stumble upon things that are not contained -in these tables (eg. when a mod has been removed). Always check for +in these tables (e.g. when a mod has been removed). Always check for existence before trying to access the fields. Example: If you want to check the drawtype of a node, you could do: @@ -384,7 +384,7 @@ A box is defined as: A box of a regular node would look like: {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -type = "leveled" is same as "fixed", but y2 will be automaticaly setted to level from param2 +type = "leveled" is same as "fixed", but y2 will be automatically set to level from param2 Ore types --------------- @@ -561,16 +561,16 @@ Craftitem (register_craftitem): Items and item stacks can exist in three formats: Serialized; This is called stackstring or itemstring: -eg. 'default:dirt 5' -eg. 'default:pick_wood 21323' -eg. 'default:apple' +e.g. 'default:dirt 5' +e.g. 'default:pick_wood 21323' +e.g. 'default:apple' Table format: -eg. {name="default:dirt", count=5, wear=0, metadata=""} +e.g. {name="default:dirt", count=5, wear=0, metadata=""} ^ 5 dirt nodes -eg. {name="default:pick_wood", count=1, wear=21323, metadata=""} - ^ a wooden pick about 1/3 weared out -eg. {name="default:apple", count=1, wear=0, metadata=""} +e.g. {name="default:pick_wood", count=1, wear=21323, metadata=""} + ^ a wooden pick about 1/3 worn out +e.g. {name="default:apple", count=1, wear=0, metadata=""} ^ an apple. ItemStack: @@ -604,7 +604,7 @@ You can read the rating of a group for an item or a node by using Groups of items ---------------- -Groups of items can define what kind of an item it is (eg. wool). +Groups of items can define what kind of an item it is (e.g. wool). Groups of nodes ---------------- @@ -617,7 +617,7 @@ For entities, groups are, as of now, used only for calculating damage. The rating is the percentage of damage caused by tools with this damage group. See "Entity damage mechanism". -object.get_armor_groups() -> a group-rating table (eg. {fleshy=100}) +object.get_armor_groups() -> a group-rating table (e.g. {fleshy=100}) object.set_armor_groups({fleshy=30, cracky=80}) Groups of tools @@ -648,8 +648,8 @@ Special groups --------------- - immortal: Disables the group damage system for an entity - level: Can be used to give an additional sense of progression in the game. - - A larger level will cause eg. a weapon of a lower level make much less - damage, and get weared out much faster, or not be able to get drops + - A larger level will cause e.g. a weapon of a lower level make much less + damage, and get worn out much faster, or not be able to get drops from destroyed nodes. - 0 is something that is directly accessible at the start of gameplay - There is no upper limit @@ -672,9 +672,9 @@ Known damage and digging time defining groups ---------------------------------------------- - crumbly: dirt, sand - cracky: tough but crackable stuff like stone. -- snappy: something that can be cut using fine tools; eg. leaves, small +- snappy: something that can be cut using fine tools; e.g. leaves, small plants, wire, sheets of metal -- choppy: something that can be cut using force; eg. trees, wooden planks +- choppy: something that can be cut using force; e.g. trees, wooden planks - fleshy: Living things like animals and the player. This could imply some blood effects when hitting. - explody: Especially prone to explosions @@ -693,7 +693,7 @@ Item groups are often used for defining, well, //groups of items//. - eatable: anything that can be eaten. Rating might define HP gain in half hearts. - flammable: can be set on fire. Rating might define the intensity of the - fire, affecting eg. the speed of the spreading of an open fire. + fire, affecting e.g. the speed of the spreading of an open fire. - wool: any wool (any origin, any color) - metal: any metal - weapon: any weapon @@ -726,12 +726,12 @@ groups to enable interaction with tools. **Full punch interval**: When used as a weapon, the tool will do full damage if this time is spent -between punches. If eg. half the time is spent, the tool will do half +between punches. If e.g. half the time is spent, the tool will do half damage. **Maximum drop level** Suggests the maximum level of node, when dug with the tool, that will drop -it's useful item. (eg. iron ore to drop a lump of iron). +it's useful item. (e.g. iron ore to drop a lump of iron). - This is not automated; it is the responsibility of the node definition to implement this @@ -750,7 +750,7 @@ be able to dig. **Digging times** List of digging times for different ratings of the group, for nodes of the maximum level. - * For example, as a lua table, ''times={2=2.00, 3=0.70}''. This would + * For example, as a Lua table, ''times={2=2.00, 3=0.70}''. This would result in the tool to be able to dig nodes that have a rating of 2 or 3 for this group, and unable to dig the rating 1, which is the toughest. Unless there is a matching group that enables digging otherwise. @@ -769,7 +769,7 @@ tool_capabilities = { damage_groups = {fleshy=2}, } -This makes the tool be able to dig nodes that fullfill both of these: +This makes the tool be able to dig nodes that fulfill both of these: - Have the **crumbly** group - Have a **level** group less or equal to 2 @@ -801,12 +801,12 @@ damage = 0 foreach group in cap.damage_groups: damage += cap.damage_groups[group] * limit(actual_interval / cap.full_punch_interval, 0.0, 1.0) * (object.armor_groups[group] / 100.0) - -- Where object.armor_groups[group] is 0 for inexisting values + -- Where object.armor_groups[group] is 0 for inexistent values return damage Client predicts damage based on damage groups. Because of this, it is able to give an immediate response when an entity is damaged or dies; the response is -pre-defined somehow (eg. by defining a sprite animation) (not implemented; +pre-defined somehow (e.g. by defining a sprite animation) (not implemented; TODO). - Currently a smoke puff will appear when an entity dies. @@ -987,7 +987,7 @@ label[,;