Armor drop on death
- rubenwardy
- Moderator
- Posts: 6978
- Joined: Tue Jun 12, 2012 18:11
- GitHub: rubenwardy
- IRC: rubenwardy
- In-game: rubenwardy
- Location: Bristol, United Kingdom
- Contact:
- Achilles
- Member
- Posts: 247
- Joined: Sun Dec 15, 2013 11:55
- In-game: Achilles
- Location: Excuse Me???? -_-
I know... but it would be more realistic if the armor was destroyed, unless you could have an object that would repair the armor, so that it can be used after you kill someone...mcfan wrote:It is better dropping than being pulverized because the player who killed you can then get the armor and use it.
The Ironic Thing About Common Sense Is That It Isn't Very Common
- stu
- Member
- Posts: 923
- Joined: Sat Feb 02, 2013 02:51
- GitHub: stujones11
- Location: United Kingdom
I am currently working on some updates for my armor mod, including support for unified inventory and the new unified skins,
I also plan to make armor a lot more configurable and will make item drop on die an option.
So you're best just waiting another day or two, I am hoping to get all this done over the weekend.
btw, you might have got my attention sooner if you had posted this on the 3d_armor modpack topic ;-)
I also plan to make armor a lot more configurable and will make item drop on die an option.
So you're best just waiting another day or two, I am hoping to get all this done over the weekend.
btw, you might have got my attention sooner if you had posted this on the 3d_armor modpack topic ;-)
Last edited by stu on Fri Apr 11, 2014 20:18, edited 1 time in total.
- stu
- Member
- Posts: 923
- Joined: Sat Feb 02, 2013 02:51
- GitHub: stujones11
- Location: United Kingdom
The current git master of minetest-3d_armor now supports armor drop on death.
For items to physically drop requires that you do not use the bones mod.
Please report any problems in the the 3d_armor mod topic, not here.
For items to physically drop requires that you do not use the bones mod.
Please report any problems in the the 3d_armor mod topic, not here.
This is configurable but defaults to true, which to me makes sense now that bones are part of minetest_game.4aiman wrote:stu, if you're up to making armor be dropped on_death, make it configurable, please
Last edited by stu on Sun Apr 13, 2014 23:07, edited 1 time in total.
well, I tried it but I didn't want to remove the older armor mod that I liked so much and have revised to be so nice. So I tried to take the drop armor code from it and it didn't work. Could you post code that we could add to the death(or dropondie) mod that would work?
Love MINECRAFT... will settle for Minetest
- stu
- Member
- Posts: 923
- Joined: Sat Feb 02, 2013 02:51
- GitHub: stujones11
- Location: United Kingdom
This is untested but should give you an idea, best I can do as I no longer have a working installation of the old version.mcfan wrote:well, I tried it but I didn't want to remove the older armor mod that I liked so much and have revised to be so nice. So I tried to take the drop armor code from it and it didn't work. Could you post code that we could add to the death(or dropondie) mod that would work?
Code: Select all
minetest.register_on_dieplayer(function(player)
local name = player:get_player_name()
local pos = player:getpos()
if name and pos then
local player_inv = player:get_inventory()
local armor_inv = minetest.get_inventory({type="detached", name=name.."_armor"})
for _,v in ipairs(armor.elements) do
local stack = armor_inv:get_stack("armor"..v, 1)
if stack:get_count() > 0 then
armor_inv:set_stack("armor"..v, 1, nil)
player_inv:set_stack("armor"..v, 1, nil)
local obj = minetest.add_item(pos, stack)
if obj then
local x = math.random(1, 5)
if math.random(1,2) == 1 then
x = -x
end
local z = math.random(1, 5)
if math.random(1,2) == 1 then
z = -z
end
obj:setvelocity({x=1/x, y=obj:getvelocity().y, z=1/z})
end
end
end
armor:set_player_armor(player)
end
end)
- stu
- Member
- Posts: 923
- Joined: Sat Feb 02, 2013 02:51
- GitHub: stujones11
- Location: United Kingdom
If you insist on putting the code your 'death' mod then it will need to depend on 3d_armor to ensure that the armor api is loaded first.mcfan wrote:Got this error
6:19:11: ERROR[main]: ServerError: LuaError: error: ...sr/share/minetest/games/MiniTest/mods/death/init.lua:76: attempt to index global 'armor' (a nil value)
16:19:11: ERROR[main]: stack traceback:
Better to just put the code at the end of armor.lua
Last edited by stu on Wed Apr 16, 2014 20:29, edited 1 time in total.
- stu
- Member
- Posts: 923
- Joined: Sat Feb 02, 2013 02:51
- GitHub: stujones11
- Location: United Kingdom
What did you do, depend or move the code? I am not a mind reader, there is no line 570 in my copy of 3d_armor/init.luamcfan wrote:Now this error:
17:43:39: ERROR[main]: ServerError: LuaError: error: ...minetest/games/MiniTest/mods/armor/3d_armor/init.lua:570: attempt to index global 'armor' (a nil value)
17:43:39: ERROR[main]: stack traceback:
Edit: I fired my crystal ball, it says that you should remove the code from init.lua and put it at the end of armor.lua like I told you.
Last edited by stu on Wed Apr 16, 2014 22:17, edited 1 time in total.
- stu
- Member
- Posts: 923
- Joined: Sat Feb 02, 2013 02:51
- GitHub: stujones11
- Location: United Kingdom
I must send that ball off to the polisher, clearly you are using an ancient version, you could try replacingmcfan wrote:I have a older version for this though(P.S. I like the older version better) and I've revised it soo much where I don't want to have to make the changes again.
armor.elements with {"head", "torso", "legs", "shield"} (braces included).
P.S. What is it about the older version you like better?
Last edited by stu on Thu Apr 17, 2014 20:59, edited 1 time in total.
Ok. Well I might be updating to your new version now. Our server just had a terrible glitch and was ruined.
I had made enchanted diamond armor and everything for it. I wish that you would also keep a version with boots and without the shields- a MC like version
I had made enchanted diamond armor and everything for it. I wish that you would also keep a version with boots and without the shields- a MC like version
Love MINECRAFT... will settle for Minetest
- stu
- Member
- Posts: 923
- Joined: Sat Feb 02, 2013 02:51
- GitHub: stujones11
- Location: United Kingdom
I strongly recommend that you do use the latest version for minetest-0.4.9, if you do not want shields then simply remove the shields mod from the modpack (delete the shields folder). Armor definitions are unchanged so you should easily be able to incorporate any customizations you might have made to the old version. If you want it to look more like minecraft then I would suggest you try the crafting mod by BlockMen (requires version 2.0.1)mcfan wrote:Ok. Well I might be updating to your new version now. Our server just had a terrible glitch and was ruined.
I had made enchanted diamond armor and everything for it. I wish that you would also keep a version with boots and without the shields- a MC like version
Edit: Not entirely accurate, some armor definitions have changed but the way in which armor is defined has not (added for clarity)
Last edited by stu on Fri Apr 18, 2014 20:53, edited 1 time in total.
Who is online
Users browsing this forum: No registered users and 8 guests