From 930b0f1eeed98baae3aacabcdaabe15b60929d2f Mon Sep 17 00:00:00 2001 From: Lars Mueller Date: Sun, 27 Sep 2020 11:18:50 +0200 Subject: [PATCH] Add documentation --- game_api.txt | 26 +++++++++++++------------- mods/player_api/mod.conf | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/game_api.txt b/game_api.txt index bddf7e27..5d3b30b4 100644 --- a/game_api.txt +++ b/game_api.txt @@ -445,13 +445,13 @@ The player API can register player models and update the player's appearance. * `player_api.set_model(player, model_name)` * Change a player's model * `player`: PlayerRef - * `model_name`: model registered with player_api.register_model() + * `model_name`: model registered with `player_api.register_model` * `player_api.set_animation(player, anim_name, speed)` - * Applies an animation to a player + * Applies an animation to a player if speed or anim_name differ from the currently playing animation * `player`: PlayerRef * `anim_name`: name of the animation - * `speed`: frames per second. If nil, the default from the model def is used + * `speed`: keyframes per second. If nil, the default from the model def is used * `player_api.set_textures(player, textures)` * Sets player textures @@ -473,18 +473,18 @@ The player API can register player models and update the player's appearance. ### Model Definition { - animation_speed = 30, -- Default animation speed, in FPS - textures = {"character.png", }, -- Default array of textures - visual_size = {x = 1, y = 1}, -- Used to scale the model + animation_speed = 30, -- Default animation speed, in keyframes per second + textures = {"character.png"}, -- Default array of textures animations = { - -- = {x = , y = }, - foo = {x = 0, y = 19}, - bar = {x = 20, y = 39}, - -- ... + -- [anim_name] = {x = , y = , collisionbox = default collisionbox, eye_height = default eye height}, + stand = ..., lay = ..., walk = ..., mine = ..., walk_mine = ..., -- required animations + sit = ... -- used by boats and other MTG mods }, - collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3}, -- In nodes from feet position - stepheight = 0.6, -- In nodes - eye_height = 1.47, -- In nodes above feet position + -- Default object properties, see lua_api.txt + visual_size = {x = 1, y = 1}, + collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3}, + stepheight = 0.6, + eye_height = 1.47 } diff --git a/mods/player_api/mod.conf b/mods/player_api/mod.conf index 198b86dc..bf62327b 100644 --- a/mods/player_api/mod.conf +++ b/mods/player_api/mod.conf @@ -1,2 +1,2 @@ name = player_api -description = Minetest Game mod: player_api +description = Minetest Game mod: Manages player visuals