Update 'creative' mod to hand override version. Move bubble, heart textures to 'gui' mod. Rename 'textures' mod to 'media'. Move player damage sound to 'media' mod. Improve README documentation

master
paramat 2019-09-01 19:06:11 +01:00
parent 8222a92c9c
commit 2e1dc6c638
17 changed files with 142 additions and 55 deletions

View File

@ -1,12 +1,13 @@
minipeli 0.1.2 by paramat.
minipeli 0.1.3 by paramat.
A game for Minetest Engine 5.0.0 and later.
Authors of media (textures)
---------------------------
Authors of media
----------------
paramat (CC BY-SA 3.0):
header.png
icon.png
About Minipeli
--------------
'Peli' is the Finnish word for 'game'.
@ -16,9 +17,12 @@ This also suggests a good mod structure, as opposed to the problematic structure
This game is not as minimal as it could be, the 'creative' mod is not necessary. However, i consider it desirable for most games as freely building without it is very awkward. So the 'creative' mod from Minetest Game has been included, and therefore also the 'sfinv' mod on which it depends, they are almost completely unmodified.
The 'lamp' mod is not necessary, it is only provided to illuminate caves and dungeons during testing.
Because creating animated meshes is difficult the player model from Minetest Game is used, it seems suitable for many games.
The player API of Minetest Game is quite fundamental.
So, the 'player_api' mod from Minetest Game is included in a simplified form.
The player API of Minetest Game is very useful and quite fundamental.
So, the 'player_api' mod from Minetest Game is included in a slightly simplified form.
Why Mapgen v6 is not supported
------------------------------
@ -28,10 +32,44 @@ Mapgen v6 is very different to all the other mapgens, it has hardcoded biomes an
It is highly recommended that games do not support Mapgen v6 for these reasons.
Note about 'lamp' mod
---------------------
The mods
--------
This is not a necessary part of the game, it is only provided in creative mode to illuminate caves and dungeons during testing.
'creative'
Unmodified mod from Minetest Game. Convenient for creative mode building.
'sfinv'
Unmodified mod from Minetest Game. Required by 'creative'.
'player_api'
Slightly simplified version of mod from Minetest Game.
Provides an API to support multiple registered player models and to set the player model, player textures or a particular player animation.
Provides an animated player model and skin texture.
Sets suitable animations according to control inputs and player health.
'gui'
Contains formspec and HUD related stuff:
Formspec background, hotbar background, bubble and heart textures.
Sets the formspec prepend, and can optionally set custom hotbar textures.
'hand'
Contains the hand tool related stuff:
The wieldhand texture.
Registers the hand tool.
'mapgen'
Contains the mapgen related stuff:
Terrain, liquid and dungeon nodes, their textures and sounds.
Mapgen aliases to tell the C++ mapgens which nodes to use.
Biome registrations.
'media'
Contains textures and sounds that have no suitable location anywhere else:
The node-digging progress texture 'crack_anylength'.
The 'player_damage' sound.
'lamp'
Unnecessary mod, only included to provide illumination for testing.
How this game was created
@ -40,52 +78,52 @@ How this game was created
Minetest Game mods used unmodified or slightly modified:
'creative':
Optional-depend on 'hand' mod instead of 'default' mod.
Depend on 'hand' mod instead of 'default' mod.
'sfinv'
Minetest Game mods used modified:
'default' (becomes 'hand', 'gui' and 'textures' mods)
'default' (becomes 'hand', 'gui' and 'media' mods)
'player_api'
'default' mod changes:
Split into 3 mods:
'hand', contains:
Textures:
wieldhand.png
Code:
minetest.register_item
init.lua:
minetest.register_item to register the hand tool.
'gui', contains:
Textures:
gui_formbg
gui_hb_bg
Code:
bubble
heart
init.lua:
minetest.register_on_joinplayer player:set_formspec_prepend
'textures', contains:
'media', contains:
Code:
Required non-functional init.lua.
Textures:
bubble
crack_anylength
heart
Sounds:
player_damage (from player_api)
'player_api' mod changes:
Now only contains:
Models:
Player model b3d, blend, skin texture
Sounds:
player_damage
Files:
api.lua: Remove 2D sprite player code.
init.lua: From register_on_joinplayer remove:
Player model .b3d, .blend, skin texture
api.lua:
Reorder code for clarity, use 'model_name' in 'player_api.register_model'.
From 'player_api.set_model()' remove sprite code and 'if model then ... end'.
init.lua:
From register_on_joinplayer remove:
player:hud_set_hotbar_image("gui_hotbar.png")
player:hud_set_hotbar_selected_image("gui_hotbar_selected.png")

View File

@ -40,10 +40,8 @@ if creative_mode_cache then
local digtime = 42
local caps = {times = {digtime, digtime, digtime}, uses = 0, maxlevel = 256}
minetest.register_item(":", {
type = "none",
wield_image = "wieldhand.png",
wield_scale = {x = 1, y = 1, z = 2.5},
-- Override the hand tool
minetest.override_item("", {
range = 10,
tool_capabilities = {
full_punch_interval = 0.5,

View File

@ -1,4 +1,3 @@
name = creative
description = Minetest Game mod: creative
depends = sfinv
optional_depends = hand
depends = hand, sfinv

View File

@ -13,3 +13,7 @@ Authors of media
BlockMen (CC BY-SA 3.0):
gui_formbg.png
gui_hb_bg.png
Paramat (CC BY-SA 3.0):
bubble.png
heart.png

View File

@ -21,6 +21,7 @@ License of media
----------------
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
Copyright (C) 2019 paramat
Copyright (C) 2019 BlockMen
You are free to:

View File

Before

Width:  |  Height:  |  Size: 116 B

After

Width:  |  Height:  |  Size: 116 B

View File

Before

Width:  |  Height:  |  Size: 112 B

After

Width:  |  Height:  |  Size: 112 B

View File

@ -3,7 +3,7 @@
minetest.register_item(":", {
type = "none",
wield_image = "wieldhand.png",
wield_scale = {x = 1, y = 1, z = 2.5},
wield_scale = {x = 1, y = 1, z = 4},
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level = 0,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 B

After

Width:  |  Height:  |  Size: 109 B

View File

@ -1,8 +1,12 @@
Minipeli mod: textures
======================
Minipeli mod: media
===================
See license.txt for license information.
Derived by paramat from Minetest Game 'default' mod.
Authors of media
----------------
All textures by paramat (CC BY-SA 3.0).
sonictechtonic (CC BY 3.0):
https://www.freesound.org/people/sonictechtonic/sounds/241872/
player_damage.ogg

View File

@ -35,3 +35,33 @@ privacy, or moral rights may limit how you use the material.
For more details:
http://creativecommons.org/licenses/by-sa/3.0/
-----------------------
Attribution 3.0 Unported (CC BY 3.0)
Copyright (C) 2014 sonictechtonic
You are free to:
Share — copy and redistribute the material in any medium or format.
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the license, and
indicate if changes were made. You may do so in any reasonable manner, but not in any way
that suggests the licensor endorses you or your use.
No additional restrictions — You may not apply legal terms or technological measures that
legally restrict others from doing anything the license permits.
Notices:
You do not have to comply with the license for elements of the material in the public
domain or where your use is permitted by an applicable exception or limitation.
No warranties are given. The license may not give you all of the permissions necessary
for your intended use. For example, other rights such as publicity, privacy, or moral
rights may limit how you use the material.
For more details:
http://creativecommons.org/licenses/by/3.0/

View File

Before

Width:  |  Height:  |  Size: 117 B

After

Width:  |  Height:  |  Size: 117 B

View File

@ -1,18 +1,19 @@
-- Global table for use by other mods
player_api = {}
-- Player animation blending
-- Note: This is currently broken due to a bug in Irrlicht, leave at 0
local animation_blend = 0
player_api.registered_models = { }
-- Local for speed.
-- Tables
---------
-- Registered models
player_api.registered_models = {}
-- Localize for better performance
local models = player_api.registered_models
function player_api.register_model(name, def)
models[name] = def
end
-- Player stats and animations
local player_model = {}
local player_textures = {}
@ -20,6 +21,15 @@ local player_anim = {}
local player_sneak = {}
player_api.player_attached = {}
-- Functions
------------
function player_api.register_model(model_name, def)
models[model_name] = def
end
function player_api.get_animation(player)
local name = player:get_player_name()
return {
@ -29,28 +39,28 @@ function player_api.get_animation(player)
}
end
-- Called when a player's appearance needs to be updated
function player_api.set_model(player, model_name)
local name = player:get_player_name()
local model = models[model_name]
if model then
if player_model[name] == model_name then
return
end
player:set_properties({
mesh = model_name,
textures = player_textures[name] or model.textures,
visual = "mesh",
visual_size = model.visual_size or {x = 1, y = 1},
collisionbox = model.collisionbox or {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3},
stepheight = model.stepheight or 0.6,
eye_height = model.eye_height or 1.47,
})
player_api.set_animation(player, "stand")
if player_model[name] == model_name then
return
end
player:set_properties({
mesh = model_name,
textures = player_textures[name] or model.textures,
visual = "mesh",
visual_size = model.visual_size or {x = 1, y = 1},
collisionbox = model.collisionbox or {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3},
stepheight = model.stepheight or 0.6,
eye_height = model.eye_height or 1.47,
})
player_api.set_animation(player, "stand")
player_model[name] = model_name
end
function player_api.set_textures(player, textures)
local name = player:get_player_name()
local model = models[player_model[name]]
@ -59,6 +69,7 @@ function player_api.set_textures(player, textures)
player:set_properties({textures = textures or model_textures,})
end
function player_api.set_animation(player, anim_name, speed)
local name = player:get_player_name()
if player_anim[name] == anim_name then
@ -73,6 +84,7 @@ function player_api.set_animation(player, anim_name, speed)
player:set_animation(anim, speed or model.animation_speed, animation_blend)
end
minetest.register_on_leaveplayer(function(player)
local name = player:get_player_name()
player_model[name] = nil
@ -80,7 +92,8 @@ minetest.register_on_leaveplayer(function(player)
player_textures[name] = nil
end)
-- Localize for better performance.
-- Localize for better performance in globalstep function
local player_set_animation = player_api.set_animation
local player_attached = player_api.player_attached

View File

@ -3,7 +3,7 @@ dofile(minetest.get_modpath("player_api") .. "/api.lua")
-- Default player appearance
player_api.register_model("character.b3d", {
animation_speed = 30,
textures = {"character.png", },
textures = {"character.png"},
animations = {
-- Standard animations.
stand = {x = 0, y = 79},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 B

After

Width:  |  Height:  |  Size: 202 B