minetest-mods / 3d_armor Goto Github PK
View Code? Open in Web Editor NEWThis project forked from stujones11/minetest-3d_armor
Visible player armor & wielded items for minetest
License: Other
This project forked from stujones11/minetest-3d_armor
Visible player armor & wielded items for minetest
License: Other
Is it possible to disable armor visuals on the character? I want the benefit of wearing armor, but don't want it to cover my custom player skins.
The partial fix for issue #24 exposed that when armor recieves wear, whether you wear 1 piece or 5 pieces the armor pieces all take the same amount of wear/damage.
My suggestion; Is that as you wear more pieces of armor the damage/use is spread as a fraction across all armor pieces. Given that damage/use is already set by the armor piece type this would simply involve dividing the use/damage for that armor piece by the number of armor pieces worn.
I have developed a small change to api.lua>>armor.damage which makes the above change, I have tested this and can't detect any issues - basically replace the current armor.damage starting at ~= line 417 with the below :
armor.damage = function(self, player, index, stack, use)
local old_stack = ItemStack(stack)
local worn_armor = armor:get_weared_armor_elements(player) -- Addition Start
local armor_p_cnt = 0
for k,v in pairs(worn_armor) do
armor_p_cnt = armor_p_cnt + 1
end
use = math.ceil(use/armor_p_cnt) --Addition End
minetest.chat_send_all(stack:get_name().." pre_wear: "..stack:get_wear()) -- Added for testing
stack:add_wear(use)
minetest.chat_send_all(stack:get_name().." post_wear: "..stack:get_wear()) -- Added for testing
self:run_callbacks("on_damage", player, index, stack)
self:set_inventory_stack(player, index, stack)
if stack:get_count() == 0 then
self:run_callbacks("on_unequip", player, index, old_stack)
self:run_callbacks("on_destroy", player, index, old_stack)
self:set_player_armor(player)
end
end
Testing and outcomes all as expected - short-hand test cases:
One
Wearing just Wooden Chestplate - Recieved full 2000 use/damage
Two
Wearing Wooden Chestplate and Wooden Boots - Each Recieved 1000 use/damage
Three
Wearing Diamond Chestplate and Wooden Boots - Chestplate 100 use/damage, Boots 1000 use/damage
Four
Full Wooden armor Chest, Boots, Leggings, Helmet - Each recieved 500 use/damage
Five
Wood Helmet, Diamond Chest, Bronze Leggings, Steel Boots:
Helmet 500 use/damage, Chestplate 50 use/damage, Leggings 100 use/damage, boots 200 use/damage.
I did contemplate making Chestplate take a larger proportion (say 2/6 when wearing 5 pieces ie have chestplate count as "2" not 1) but that makes the fix significantly more complex and I thought for an initial enhancement simple might be best? I'm very happy to take suggestions and ideas and code imporvements etc and even roll in that chestplate fix although I was worried ppl might then not wear chestplates.....
It's been a few weeks, but at some point after an update to 3D Armor from ContentDB, armor stopped protecting the player from torch damage.
name = 3d_armor
title = 3D Armor
description = Visible player armor & wielded items.
release = 16954
author = stu
Minetest 5.7.0 x64 portable
These options exist in the mod's settings:
# Enable fire protection (defaults true if using ethereal mod).
armor_fire_protect (Enable fire protection) bool false
# Enable fire damage from torches (defaults true if using ethereal mod).
armor_fire_protect_torch (Enable fire protection torch damage) bool false
I have tried setting fire damage from torches to both true and false, but with either setting, players still take damage from torches. I have tested in my existing modded world, but was able to recreate this bug in a new world with only the 3D Armor mod.
In addition to losing the ability to turn off this damage, the [English translation?] wording of this setting is ambiguous. The setting for fire protection seems to mean if true, protect from fire and if false, don't protect from fire. The torches setting seems to mean the opposite, in that true doesn't protect and false does protect. I suggest that the wording of these 2 settings be changed so that both states match and the wording is less ambiguous:
# Enable fire protection (defaults true if using ethereal mod. **True means armor protects from fire**).
armor_fire_protect (Enable fire protection) bool false
# Enable fire **protection** from torches (defaults false if using ethereal mod. **True means armor protects from torches**).
armor_fire_protect_torch (Enable **torch damage protection**.) bool true
Also, from a roleplay perspective and reality v.s. game mechanics, it sort of makes sense to take fire damage if you are standing in say fire or lava, but in reality any person standing in the same 1 cubic meter area as a torch would instinctually be able to share that space with a torch while avoiding being so close to burn themselves. If I walked by a torch on the floor or wall of a narrow hallway, I wouldn't even have to think about it to avoid burning myself by the torch as I stood next to it.
There are some dependency cycles involving these mods and I think 3d_armor might be the easiest place to fix these, if not I'm happy to file the issue with another mod.
3d_armor -> backedclay -> technic_cnc > technic -> i3 -> 3d_armor -> bakedclay
-> nether -> riesenpilz -> technic -> i3 -> 3d_armor
-> skinsdb -> 3d_armor
-> clothing -> appliances -> technic
Armor is nice and all, but, sometimes you want the defense of the armor but also want to show off your nice skin to your friends. Well, why not? A button somewhere in the UI that can toggle armor visibility would be a great addition I think.
This issue is to track the deprecation of the config support. See init.lua:
-- Legacy Config Support
-- DEPRECATED, will not be supported in future versions
No damage to armor from monster attacs.
Test procedure:
It looks like there is a local variable "damage" set to false and the never come back to true, because mobs hat no groupcaps:
E.g. oerkki groupcaps:
{
max_drop_level = 1,
groupcaps = {
},
damage_groups = {
fleshy = 4
},
full_punch_interval = 1,
punch_attack_uses = 0
}
Temporary solution could be to set damage = true when no groupcaps defined?
--- a/3d_armor/api.lua
+++ b/3d_armor/api.lua
@@ -355,7 +355,10 @@ armor.punch = function(self, player, hitter, time_from_last_punch, tool_capabili
local level = damage_groups.level or 0
local groupcaps = tool_capabilities.groupcaps or {}
local uses = 0
- damage = false
+ if #groupcaps > 0 then
+ damage = false
+ end
+ --damage = false
for group, caps in pairs(groupcaps) do
local maxlevel = caps.maxlevel or 0
local diff = maxlevel - level
3d_armor/3d_armor/locale/3d_armor.es.tr
Line 61 in b6651fd
In Spanish: "Tus botas están a punto de romperse"
In English it kinda works to use capitals here, but in Spanish and probably also in French, Portuguese and Italian, one would use lower-case. Probably some other languages too.
German is a language that capitalizes names, there it's correct. Here too, it would need to be: "Deine Stiefel sind fast kaputt".
However the rest use singular form ist.
Many languages have their own way, it kinda misses the point of translating when sentences sound so weird.
Suggestion: have a translator string for all items instead of using substitutions.
Before I roll onto content_db and clutter it up, would it be better if I rolled my glove/gauntlet into the main 3d_Armor baseas a pull request.
I'm thinking similar to shields but unlike shields off by default. Also understand if its better to leave it as a seperate mod as it will add more maintenace overhead for 3d_Armor.
I'm happy with either outcome just wanted to make the offer.
I'm not sure how to reproduce, but it has been crashing on my server for a while and I have not much idea how to fix it.
2022-08-20 08:25:50: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod '3d_armor' in callback luaentity_Step(): Runtime error from mod '3d_armor' in callback on_punchplayer(): /usr/share/minetest/mods/3d_armor
/3d_armor/api.lua:830: attempt to concatenate local 'element' (a ni
2022-08-20 08:25:50: ERROR[Main]: l value)
2022-08-20 08:25:50: ERROR[Main]: stack traceback:
2022-08-20 08:25:50: ERROR[Main]: /usr/share/minetest/mods/3d_armor/3d_armor/api.lua:830: in function 'get_element'
2022-08-20 08:25:50: ERROR[Main]: /usr/share/minetest/mods/3d_armor/3d_armor/api.lua:659: in function 'get_weared_armor_elements'
2022-08-20 08:25:50: ERROR[Main]: /usr/share/minetest/mods/3d_armor/3d_armor/api.lua:630: in function 'damage'
2022-08-20 08:25:50: ERROR[Main]: /usr/share/minetest/mods/3d_armor/3d_armor/api.lua:605: in function 'punch'
2022-08-20 08:25:50: ERROR[Main]: /usr/share/minetest/mods/3d_armor/3d_armor/init.lua:416: in function 'func'
2022-08-20 08:25:50: ERROR[Main]: /usr/share/minetest/builtin/profiler/instrumentation.lua:107: in function </usr/share/minetest/builtin/profiler/instrumentation.lua:100>
2022-08-20 08:25:50: ERROR[Main]: /usr/share/minetest/builtin/game/register.lua:429: in function </usr/share/minetest/builtin/game/register.lua:415>
2022-08-20 08:25:50: ERROR[Main]: [C]: in function 'punch'
2022-08-20 08:25:50: ERROR[Main]: /usr/share/minetest/mods/mobs/api.lua:2716: in function 'do_states'
2022-08-20 08:25:50: ERROR[Main]: /usr/share/minetest/mods/mobs/api.lua:3544: in function 'func'
2022-08-20 08:25:50: ERROR[Main]: /usr/share/minetest/builtin/profiler/instrumentation.lua:107: in function </usr/share/minetest/builtin/profiler/instrumentation.lua:100>
2022-08-20 08:25:50: ERROR[Main]: stack traceback:
2022-08-20 08:25:50: ERROR[Main]: [C]: in function 'punch'
2022-08-20 08:25:50: ERROR[Main]: /usr/share/minetest/mods/mobs/api.lua:2716: in function 'do_states'
2022-08-20 08:25:50: ERROR[Main]: /usr/share/minetest/mods/mobs/api.lua:3544: in function 'func'
2022-08-20 08:25:50: ERROR[Main]: /usr/share/minetest/builtin/profiler/instrumentation.lua:107: in function </usr/share/minetest/builtin/profiler/instrumentation.lua:100>
The server in question is Mercurio hosted at mars.ronoaldo.dev.br port 3000. Using latest version from Content DB.
I have found that the admin armor makes the walk speed of the character so fast that any game becomes almost unplayable.
Is there a way to reduce this?
[edit] This issue started with the 5.8.0 update. Walk speed went from 4 to around 30-40 while wearing admin armor
[edit 2] I know nothing about coding so any coding advice needs to be eli5 format
Wield a water/lava source and error message happens
Perhaps a missing texture?
3d_armor/wieldview/get_texture.lua
Line 42 in 7f20e5d
2021-06-26 07:17:44: ERROR[Main]: ServerError: AsyncErr: environment_Step: Runtime error from mod 'wieldview' in callback environment_Step(): ...netest/worlds/Bananaland_World/worldmods/skinsdb/api.lua:8: attempt to call method 'get_string' (a nil value)
2021-06-26 07:17:44: ERROR[Main]: stack traceback:
2021-06-26 07:17:44: ERROR[Main]: ...netest/worlds/Bananaland_World/worldmods/skinsdb/api.lua:8: in function 'get_player_skin'
2021-06-26 07:17:44: ERROR[Main]: ...etest/worlds/Bananaland_World/worldmods/skinsdb/init.lua:47: in function 'update_player_visuals'
2021-06-26 07:17:44: ERROR[Main]: ...and_World/worldmods/minetest-3d_armor/wieldview/init.lua:64: in function 'update_wielded_item'
2021-06-26 07:17:44: ERROR[Main]: ...and_World/worldmods/minetest-3d_armor/wieldview/init.lua:75: in function 'func'
2021-06-26 07:17:44: ERROR[Main]: /usr/share/minetest/builtin/common/after.lua:20: in function </usr/share/minetest/builtin/common/after.lua:5>
2021-06-26 07:17:44: ERROR[Main]: /usr/share/minetest/builtin/game/register.lua:425: in function </usr/share/minetest/builtin/game/register.lua:409>
Reported by bosapara
in the forums:
Even in protect, player's armor can be damaged / crashed by another player.
How to reproduce a bug: just punch protected player, his armor will crash more and more.
Checked this bug on Pandora - the same. Tried to fix it, but failed unfortunately.
EDIT: possible fix by the same author (untested, just copy-pasta'd from the forums):
if armor.config.punch_damage == true then
minetest.register_on_punchplayer(function(player, hitter,
time_from_last_punch, tool_capabilities)
local name = player:get_player_name()
local name2 = hitter:get_player_name()
if name and name2 and minetest.is_protected(player:get_pos(), "") then
return
elseif name then
armor:punch(player, hitter, time_from_last_punch, tool_capabilities)
last_punch_time[name] = minetest.get_gametime()
end
end)
end
Both the "preview" images and the actual textures do not support texture modifiers, just the inventory images.
I think.
Sometimes, we want to kill people.
Then we do player:set_hp(0), but if the armor the player wears has some healing properties, we can't kill them.
Repro:
IMO set_hp(0) should do exactly that: kill the player.
Also, fall damage seems to count against the heal property.
Could you please make it that high fall damage and set_hp(0) does not let anyone live?
Or could you make it that armors can register against what type of damage they help?
For my reference 998
The player model is incorrect the body, legs and arms have rectangular pixels instead of square pixels.
2024-01-14 12:10:27: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'petz' in callback environment_Step(): ....7.0/Minetest_live/bin/../mods/3d_armor/3d_armor/api.lua:723: attempt to index local 'inv' (a nil value)
2024-01-14 12:10:27: ERROR[Main]: stack traceback:
2024-01-14 12:10:27: ERROR[Main]: ....7.0/Minetest_live/bin/../mods/3d_armor/3d_armor/api.lua:723: in function 'func'
2024-01-14 12:10:27: ERROR[Main]: ...e/mt/5.7.0/Minetest_live/bin/../builtin/common/after.lua:27: in function <...e/mt/5.7.0/Minetest_live/bin/../builtin/common/after.lua:11>
2024-01-14 12:10:27: ERROR[Main]: .../mt/5.7.0/Minetest_live/bin/../builtin/game/register.lua:446: in function <.../mt/5.7.0/Minetest_live/bin/../builtin/game/register.lua:432>
you can't expect a player object to be valid on a different server step.
Could we get something like can_equip/can_unequip callbacks or some kind of metadata to make things like cursed armors?
Hi. I'm one of the WhyNot? game maintainers and we've noticed a problem with 3d_armor recently (minetest-whynot/whynot-game#169)
The first player to immediately join a new game (first time only, singleplayer or hosted), the armor tab in the inventory says "Armor not initialized!" Quitting and joining again fixes it, but it's still annoying.
This it not specific to WhyNot. I was able to reproduce it by copying 3d_armor into minetest_game/mods, as well as simply enabling 3d_armor on a new MTG world before joining.
I've tracked it down to the init_player_armor
function at
armor.def[name] = {
init_time = minetest.get_gametime(),
Where minetest.get_gametime()
is probably 0 when you first join a new world.
I found a quick workaround by using minetest.after(1
in init.lua:
minetest.register_on_joinplayer(function(player)
default.player_set_model(player, "3d_armor_character.b3d")
local player_name = player:get_player_name()
minetest.after(0, function()
-- TODO: Added in 7566ecc - What's the prupose?
local pplayer = minetest.get_player_by_name(player_name)
if pplayer and init_player_armor(pplayer) == false then
pending_players[pplayer] = 0
end
end)
end)
but given the TODO comment, I thought maybe this needs some deeper investigation.
Hi, not sure if this is a feature or a bug:
3d_armor's admin_boots or other pieces of admin armor used to protect against drowning, but that is no longer the case. If I stay in water for a bit, as an admin I end up drowning.
Hi,
I can create and play a game for a while and close it but when I try to play the game again Minetest shuts it down with the following message:
AsyncErr: Lua: Runtime error from mod '' in callback on_joinplayer(): (load):1578: attempt to index field 'items_progress' (a nil value)
Stack traceback:
(load):1578: in function 'get_items_fs'
(load):1774: in function 'make_fs'
(load):177: in function: 'func'
/home/USR/.minetest/mods/3d_armor/3d_armor/api.lua:340: in function 'run_callbacks'
/home/USR/.minetest/mods/3d_armor/3d_armor/api.lua:361: in function 'update_player_visuals'
/home/USR/.minetest/mods/3d_armor/3d_armor/api.lua:528: in function 'set_player_armor'
/home/USR/.minetest/mods/3d_armor/3d_armor/init.lua:285: in function 'init_player_armor'
/home/USR/.minetest/mods/3d_armor/3d_armor/init.lua:326: in function <home/USR/.minetest/mods/3d_armor/3d_armor/init.lua:324>
/usr/share/minetest/builtin/common/register.lua:26 in function </usr/share/minetest/builtin/common/register.lua:12>
I did try to disable this mod and load the game however that caused Minetest to shutdown.
[Edit] Currently running Minetest 5.8.0 on Linux Mint 21.2
I'm building a Minetest server to play with friends. And while testing the administrative part of the server and the Troll mod, I ran into the problem that when reconnecting the player, the server crashes with a lua error. And judging by the error, this is caused by the 3d_armor (and skinsdb) mod.
AsyncErr: Lua: Runtime error from mod '' in callback environment_Step(): (load):1578: attempt to index field 'items_progress' (a nil value)
stack traceback:
(load):1578: in function 'get_items_fs'
(load):1774: in function 'make_fs'
(load):177: in function 'func'
/home/user/.minetest/mods/3d_armor/3d_armor/api.lua:341: in function 'run_callbacks'
/home/user/.minetest/mods/skinsdb/init.lua:55: in function 'update_player_visuals'
/home/user/.minetest/mods/3d_armor/3d_armor/api.lua:529: in function 'set_player_armor'
/home/user/.minetest/mods/3d_armor/3d_armor/init.lua:291: in function 'init_player_armor'
/home/user/.minetest/mods/3d_armor/3d_armor/init.lua:338: in function 'func'
/usr/share/minetest/builtin/common/after.lua:20: in function </usr/share/minetest/builtin/common/after.lua:5>
/usr/share/minetest/builtin/game/register.lua:446: in function </usr/share/minetest/builtin/game/register.lua:432>
Why are they used in the first place?
Am I correct in assuming that this is just a legacy from the past, when we didn't have player inventory callbacks (that is, before minetest/minetest#7185) or are there other reasons requiring them?
Minetest version 5.7.0 running on Ubuntu 22.04
3d_armor version 2023-02-06
moreores version 2023-02-12 (also tried 2023-01-26)
After starting server receive error:
ERROR[Main]: ModError: Failed to load and run script from /home/minetest/minetestserver/bin/../mods/3d_armor/3d_armor_ui/init.lua:
ERROR[Main]: ...minetestserver/bin/../mods/3d_armor/3d_armor_ui/init.lua:12: attempt to index local 'ui' (a boolean value)
ERROR[Main]: stack traceback:
ERROR[Main]: ...minetestserver/bin/../mods/3d_armor/3d_armor_ui/init.lua:12: in main chunk
Disabling moreores removes the error and works as expected though of course without the optional dependency.
armor.config = {
init_delay = 2,
init_times = 10,
bones_delay = 1,
update_time = 1,
drop = minetest.get_modpath("bones") ~= nil,
destroy = false,
level_multiplier = 1,
heal_multiplier = 1,
material_wood = true,
material_cactus = true,
material_steel = true,
material_bronze = true,
material_diamond = true,
material_gold = true,
material_mithril = true,
material_crystal = true,
material_nether = true,
set_elements = "head torso legs feet shield", --<< SOURCE OF ERROR
set_multiplier = 1.1,
water_protect = true,
fire_protect = minetest.get_modpath("ethereal") ~= nil,
fire_protect_torch = minetest.get_modpath("ethereal") ~= nil,
feather_fall = true,
punch_damage = true,
}
for loc,item in pairs(worn_armor) do
local item_mat = string.match(item, "%:.+_(.+)$")
local worn_key = item_mat or "unknown"
for k,set_loc in pairs(armor.config.set_elements)do --<< ERROR
if set_loc == loc then
if set_worn[worn_key] == nil then
set_worn[worn_key] = 0
set_worn[worn_key] = set_worn[worn_key] + 1
else
set_worn[worn_key] = set_worn[worn_key] + 1
end
end
end
end
ERROR:
As a result the players inventory is being updated even when the armor tab isn't selected.
This interferes with other inventory mods if they don't work 100% through sfinv callbacks.
This obviously isn't much of an issue when the update is triggered through un/equipping of armor pieces, but the issue is, that the update can also be caused by items being moved into/out of the currently selected hotbar slot.
No translations for different types of armor. PR #124
In minetest-whynot/whynot-game#170 (comment)
It seems all code with
@section craft
has a lot of duplicative behavior shared with (virtually) all armor. The license isn't compatible, but I've seen that Instant Ores does this in a better way, by making a function for this. Edge cases would be best served the way this code is currently written, with abstractions for the most common cases.
(This issue is not blocking that pull request).
A few arguments for this:
Problem:
I don't know where the function would go, or what it would and wouldn't cover.
We had frozen 3d_armor in WhyNot? just before the armor types got split.
Before we move to the latest, are you aware of any issues with it? In particular, does it cause any kind of problems with existing worlds?
In the PR, SmallJoker had mentioned a possible issue with existing servers. Would that be a problem if the modpack is part of a game like WhyNot, and the server gets updated and restarted?
Thanks!
I would like to add compatibility for my mod [morphinggrid]. What my mod does is it adds power rangers to Minetest allowing players to morph. The mod provides it's own layer of armor over the 3d_armor armor by using a modified version of the 3d armor character model found here. The idea is that when a player is a power ranger, the armor of [3d_armor] is protected when a player takes a hit. However instead of this, both armors are damaged. The code responsible for not allowing this feature to be possible is found in [3d_armor].
Take a look at line 422-439 in 3d_armor/init.lua
https://github.com/minetest-mods/3d_armor/blob/master/3d_armor/init.lua
My mod uses the same callback (minetest.register_on_player_hpchange
) to prevent damage to a player so this is a very simple fix. All that is needed is to prevent the player's armor from being punched if the player is morphed, which can be done AFTER checking if [morphingrid] is installed. I will also be uploading a pull request. My mod can be found here: https://github.com/LandonAConway/powerrangers_modpack & and the specific file located in my mod which is responsible for preventing player damage is found here: https://github.com/LandonAConway/powerrangers_modpack/blob/master/morphinggrid/ranger_armor.lua
Looking through the API I found a line that calls EntityDefinition.on_punched
. But is this actually doing anything? Looking through Minetest's Lua API docs, I don't see any on_punched
callback. Only on_punch
.
Hi,
if I activate armor_fire_protect = true then Torch damage is activated as well.
Could you add a switch to just turn the torch damage off, even is fire protect is activated?
The latest update with nether armor is great but shouldn't that particular armor have fire protection like the crystal set ??
Also in mod.conf nether isn't spelled correctly.
Hi,
I'm trying to create a shapeshifting mod. In short: set the player's model and texture to some available animals from other mods.
With 3d_armor enabled and wieldview, every change of armor or wielded item breaks the animals texture, as it calls armor:update_player_visuals(player).
Would it be possible to enhance 3d_armor so that other mods can temporarily disable all texture and model changes?
eg
armor:disable_player(player)
armor:enable_player(player)
the commit acd8b26 forces dependency of unnecesary hunger mod.. cos it uses reason that is only defined in hunger api..
so it breaks in other cases.. addition of another dependency is not a way
I noticed a discrepency between what the armor.config.level_multiplier is set to under 3d_armor and what the game reported level as being when you look at the armor_ui inside the game
eg diamond chestplate level should be 20 (fleshy=20), level*armor.config.level_multiplier (default=1). However inside the game when you just wear the chestplate it reports as level 18 with shields enabled
So tracked this back through to Shields which has a block of code:
if minetest.global_exists("armor") and armor.elements then
table.insert(armor.elements, "shield")
local mult = armor.config.level_multiplier or 1
armor.config.level_multiplier = mult * 0.9
end
When enabled the shields multipler of 0.9 overrides the base armor.config.level_multiplier for all armor items not just shields and there is no way to reset it back to 1...well unless you set the setting in armor_3d to 1.111etc. Which is a tough track down to get to root cause lol.
This dosen't quiet seem like the correct behaviour? I'm guessing the intention was to help with balancing? Im not sure?
I'm not sure the armor.config.level_multiplier should be redefined in the shields module but rather leave that out and let people adjust via the base 3d_armor setting "level_multiplier" if they feel they need it?
Took me a fair bit of time to track down what was happening, spotted it in the end using debug were you can clearly see shields suddenly adjust to 0.9 instead of 1 (this overrides for all items later when calulating in game) :
2020-12-13 20:07:43: [Main]: 3d_armor:helmet_admin levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:chestplate_admin levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:leggings_admin levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:boots_admin levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:helmet_wood levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:chestplate_wood levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:leggings_wood levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:boots_wood levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:helmet_cactus levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:chestplate_cactus levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:leggings_cactus levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:boots_cactus levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:helmet_steel levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:chestplate_steel levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:leggings_steel levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:boots_steel levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:helmet_bronze levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:chestplate_bronze levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:leggings_bronze levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:boots_bronze levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:helmet_diamond levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:chestplate_diamond levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:leggings_diamond levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:boots_diamond levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:helmet_gold levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:chestplate_gold levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:leggings_gold levelmulti1: 1
2020-12-13 20:07:43: [Main]: 3d_armor:boots_gold levelmulti1: 1
2020-12-13 20:07:43: [Main]: shields:shield_admin levelmulti1: 0.9
2020-12-13 20:07:43: [Main]: shields:shield_wood levelmulti1: 0.9
2020-12-13 20:07:43: [Main]: shields:shield_enhanced_wood levelmulti1: 0.9
2020-12-13 20:07:43: [Main]: shields:shield_cactus levelmulti1: 0.9
2020-12-13 20:07:43: [Main]: shields:shield_enhanced_cactus levelmulti1: 0.9
2020-12-13 20:07:43: [Main]: shields:shield_steel levelmulti1: 0.9
2020-12-13 20:07:43: [Main]: shields:shield_bronze levelmulti1: 0.9
2020-12-13 20:07:43: [Main]: shields:shield_diamond levelmulti1: 0.9
2020-12-13 20:07:43: [Main]: shields:shield_gold levelmulti1: 0.9
Anyways as Im not sure if this is a bug or by design? Happy to be corrected just seemed like strange behaviour that was not very appaarent to the end user...unless I missed some doco somewhere.
Fix is a two liner
if minetest.global_exists("armor") and armor.elements then
table.insert(armor.elements, "shield")
end
full set diamond no shields enabled, level= 77 (w/ fullset 10% bonus)
full set diamond plus shields without fix, level= 84.5 (w/ fullset 10% bonus)
full set diamond plus shields with fix, level = 93.5 (w/ fullset 10% bonus)
Currently the armor set is set as all registered armor_items must be worn to be a valid set to recieve the set bonus. This is intresting when you start adding extra armor_items.
I worked up a test branch which impliments customisable set using the settings screen, branch is here
https://github.com/sirrobzeroone/3d_armor/tree/armor-set-clean-up
In the process of doing the above I noticed the armor material is gathered from the armor item name using a string match. Which works great until the armor item no longer has the material in the name or the material in the correct location in the name. So I added some new armor groups which start armor_m_"material name" eg armor_m_wood=1 for all wood armor items. Unfortunatly I still had to do an string match to get material name but it is now on a group name which I think is an improvement.
I made the change backwards compatible so if an armor item dosen't have a group included of armor_m_ then it will fallback to calulating set and bonus using the old code (I probably need to harden that old code a little).
Summary of changes
~ Setting to configure parts that make up armor set - default = "head torso legs feet shield"
~ Setting to adjust armor set multiplier default = 1.1
~ New material armor groups to indicate what the material the armor is made of
~ New code in api.lua to calculate armor set and multiplier
~ New code to init.lua to feed set string into table
~ Armor and shield registrations updated to include armor_m_"materials"
~ Updates to Readme.MD
I've done testing and not uncovered any issues but thought it best to do a seperate branch and as the changes are fairly significant.
Edit: Initial compare of changes (note I stuffed up the MD formating a few times so readme.MD got 3 fixs after this....):
beb2150
Please consider updating the LICENSE.md
to the current status and team.
Presumably, should read:
Copyright (C) 2013-2022 Stuart Jones - LGPL v2.1
(or you wait until New Year and make it 2023 already. ;)
Maybe there have been additional contributors? Not sure, if the dev team has to or even wants to be listed. This is totaly at your deliberation, but worth to ask.
I believe the official https://github.com/minetest-mods/ -> Manifest link would be a better place to maintain this project.
Although I am not sure who to invite, thus one pending invitation for @thomasrudin.
There has been no release since 0.4.14 a bit more than a year ago, while I see there were numerous changes.
As per #51 (comment), I created a couple examples for documenting 3d_armor API with LDoc & MkDocs. The documentation is created as an example so is not complete. Keep in mind that I am new to using MkDocs
, so it could probably look a lot nicer as is done with Minetest's API.
Examples:
I get this error when using the API. 'api.lua:282: bad argument #1 to 'pairs' (table expected, got string)'.
To reproduce this error, download the powerrangers_modpack mod (link here), and type the command '/morph mighty_morphin:red'. Or in the code behind, add armor to the armor inventory, and use armor:set_player_armor().
See: stujones11#176
WARNING[Server]: 3d_armor: Detached armor inventory is nil [set_player_armor]
My server has enable_damage=false but when I enable the 3d_armor mod, the player can die of fall damage. Only the specific 3d_armor mod needs to be enabled, no other mods in the 3d_armor pack.
This only happens when the server is on another computer (same LAN). I can not reproduce it in a local singleplayer world. Server and client are Ubuntu 20.04 with default "apt" install of Minetest 5.1.1.
With all other factor kept constant, I bisected the version of 3d_armor and found the following
0.4.0 OK
0.4.4 Players dies
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.