summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md4
-rw-r--r--init.lua6
2 files changed, 5 insertions, 5 deletions
diff --git a/README.md b/README.md
index b993176..087f9ba 100644
--- a/README.md
+++ b/README.md
@@ -85,11 +85,11 @@ You should normally not need to care about these internally used fields.
### Functions
-#### `playereffects.register_effect_type(name, description, icon, groups, apply, cancel, hidden)`
+#### `playereffects.register_effect_type(effect_type_id, description, icon, groups, apply, cancel, hidden)`
Adds a new effect type for the Player Effects mods, so it can be later be applied to players.
##### Parameters
-* `name` is the name (a string) which is internally used by the mod. Later known as `effect_type_id`. Please use only alphanumeric ASCII characters.
+* `effect_type_id` is the identifier (a string) which is internally used by the mod. Later known as `effect_type_id`. You may choose the identifier at will, but please use only alphanumeric ASCII characters. The identifier must be unique along all mods.
* `description` is the text which is exposed to the HUD and visible to the player.
* `icon`: This is optional an can be `nil`. It can be the file name of a texture. Should have a size of 16px×16px. In this case, this is the icon for the HUD. Basically this is just eye-candy. If this is `nil`, no icon is shown. The icon will be exposed to the HUD, iff `hidden` is `false`.
* `groups` is a table of strings to which the effect type is assigned to.
diff --git a/init.lua b/init.lua
index 97bf532..fe7eb32 100644
--- a/init.lua
+++ b/init.lua
@@ -47,7 +47,7 @@ function playereffects.next_effect_id()
end
--[=[ API functions ]=]
-function playereffects.register_effect_type(name, description, icon, groups, apply, cancel, hidden)
+function playereffects.register_effect_type(effect_type_id, description, icon, groups, apply, cancel, hidden)
effect_type = {}
effect_type.description = description
effect_type.apply = apply
@@ -63,8 +63,8 @@ function playereffects.register_effect_type(name, description, icon, groups, app
else
effect_type.hidden = false
end
- playereffects.effect_types[name] = effect_type
- minetest.log("action", "[playereffects] Effect type "..name.." registered!")
+ playereffects.effect_types[effect_type_id] = effect_type
+ minetest.log("action", "[playereffects] Effect type "..effect_type_id.." registered!")
end
function playereffects.apply_effect_type(effect_type_id, duration, player)