[Modpack] 3D Armor [0.4.8] [minetest-3d_armor]

tinoesroho
Member
 
Posts: 570
Joined: Fri Feb 17, 2012 21:55

by tinoesroho » Thu Feb 14, 2013 21:38

I don't think we'll see mobs in core minetest for a year - the various mods are quite "unready for use", and a mobs API is off in the future.
We are what we create.

I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.

My github:
https://github.com/tinoesroho/
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Thu Feb 14, 2013 21:45

there were mobs before but for some reason celeron got rid of them.
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Thu Feb 14, 2013 22:38

Jordach wrote:At some point I will fork this and make a better system for hand wielding. Me thanks GPL V3.

EDIT: Because I know a little about the engine, I might be able to make the hand wielding a little less laggy.


That's great, I rather hoped someone might pick up on the basic concept and take it further.

Reading a recent post in the 'mod questions' thread gave me an idea how to improve the wielded item handling somewhat.

I admit that it is still not ideal but I am much happier with this approach and will probably update the mod sometime over the weekend.

In the meantime anyone interested can apply the following patch:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
66,67d65
< local player_wielded_item = {}
< local time = 0
138,148c136
< end
<
< local function update_wielded_item(player)
<     local name = player:get_player_name()
<     local stack = player:get_wielded_item()
<     local item = stack:get_name()
<     if player_wielded_item[name] == item then
<         return
<     end
<     player_wielded_item[name] = item
<     set_player_armor(player)
---
>     minetest.after(4, set_player_armor, player)
196,206d183
<
< minetest.register_globalstep(function(dtime)
<     time = time + dtime
<     if time > 4 then
<         for _,player in ipairs(minetest.get_connected_players()) do
<             update_wielded_item(player)
<         end
<         time = 0
<     end
< end)
<

Again, thanks for all the encouraging comments and ideas.
 

Josh
Member
 
Posts: 1146
Joined: Fri Jun 29, 2012 23:11

by Josh » Fri Feb 15, 2013 02:04

0gb.us wrote:
LorenzoVulcan wrote:
0gb.us wrote:
No, armour is too Minecraft-like. It's okay for people who want it, but it would be sad to see the default game become too close to what Minecraft is like.

Unless you mean only the visible wield items. I get the feeling that's going to be added to default Minetest eventually.


Armors are necessary to PVP,independently they're minecraft-like or not.And i think they're not minecraft-like.


So this should be added to player versus player servers, not the default game.

jojoa1997 wrote:They are not minecraft-like they are flat against skin, have diffrperent textures, and the legs and shoes are combined in this mod.


Being flat against the skin is just the style. It's not the style that I'm commenting on. Having armour at all is quite Minecraft-like, and I don't think any style of armour belongs in the default game.

Besides, it encourages fighting. On some servers, that's fine, but others are build/peaceful servers instead. Recommending this to be added to PvP servers is one thing, and I would agree that this would be nice on PvP servers. But I do not agree that this belongs in the default game.

You have a point. But if you don't want something in minetest, you can always remove it :)
 

User avatar
Jordach
Member
 
Posts: 4412
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach

by Jordach » Fri Feb 15, 2013 07:44

stu wrote:
Jordach wrote:At some point I will fork this and make a better system for hand wielding. Me thanks GPL V3.

EDIT: Because I know a little about the engine, I might be able to make the hand wielding a little less laggy.


That's great, I rather hoped someone might pick up on the basic concept and take it further.

Reading a recent post in the 'mod questions' thread gave me an idea how to improve the wielded item handling somewhat.

I admit that it is still not ideal but I am much happier with this approach and will probably update the mod sometime over the weekend.

In the meantime anyone interested can apply the following patch:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
66,67d65
< local player_wielded_item = {}
< local time = 0
138,148c136
< end
<
< local function update_wielded_item(player)
<     local name = player:get_player_name()
<     local stack = player:get_wielded_item()
<     local item = stack:get_name()
<     if player_wielded_item[name] == item then
<         return
<     end
<     player_wielded_item[name] = item
<     set_player_armor(player)
---
>     minetest.after(4, set_player_armor, player)
196,206d183
<
< minetest.register_globalstep(function(dtime)
<     time = time + dtime
<     if time > 4 then
<         for _,player in ipairs(minetest.get_connected_players()) do
<             update_wielded_item(player)
<         end
<         time = 0
<     end
< end)
<

Again, thanks for all the encouraging comments and ideas.
I dont know how patches work, could it be possible to generate an init.lua file?

( ͡° ͜ʖ ͡°) ( ͡o ͜ʖ ͡o) [$ ( ͡° ͜ʖ ͡°) $] ( ͡$ ͜ʖ ͡$) ヽ༼ຈل͜ຈ༽ノ



My image and media server is back online and is functioning as normal.
 

User avatar
LorenzoVulcan
Member
 
Posts: 437
Joined: Mon Mar 12, 2012 06:46

by LorenzoVulcan » Fri Feb 15, 2013 10:03

Can i give you a suggestion?

Now this mod is incompatible with mod like In-game Skin Switching: http://forum.minetest.net/viewtopic.php?id=4147

Can't you render the .x file with compatible skin schemes?
Developer of the BlockForge 2# Project!
Official thread: http://minetest.net/forum/viewtopic.php?pid=54290#p54290
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Fri Feb 15, 2013 11:55

"Someone (I forgot who) made a "3D Armor" mod"

According to the readme, Kaeza "forgot" who made this mod despite it's WIP state and made his own version.
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Fri Feb 15, 2013 22:25

Jordach wrote:I dont know how patches work, could it be possible to generate an init.lua file?


on a real operating system you would use: patch init.lua < foobar.patch. IIRC you can maybe do this with MSYS under windoze.

4aiman wrote:According to the readme, Kaeza "forgot" who made this mod despite it's WIP state and made his own version.


I think Kaeza was referring to your 3d armor entity thread there. He does not seem to even acknowledge the existence of this mod. To be fair though, I did not even release this as a mod myself, it got moved here from modding general and re-titled by some admin.

Anyway, Kaeza is quite welcome to use this idea with the existing armor mod because that is exactly what I did not want to do. There should be no wood (shield excepted) or stone armor for sure. Even copper, gold and silver are a bit wrong IMO.

@LorenzoVulcan I do plan to include some limited support for the player skin switching. Unfortunately it is not something as straightforward as rendering the .x to fit the skin. The skin needs to fit the mesh and will therefore need to be re-sized in order to work with the new wielded items model.
Last edited by stu on Fri Feb 15, 2013 23:11, edited 1 time in total.
 

User avatar
Calinou
Member
 
Posts: 3124
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou

by Calinou » Sat Feb 16, 2013 12:58

stu wrote:on a real operating system you would use: patch init.lua < foobar.patch. IIRC you can maybe do this with MSYS under windoze.


"patch init.lua foobar.patch" works too, no need for the "<".
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Sun Feb 24, 2013 19:03

Mod Updated. Offical release, version: 0.1.0

Armor now takes damage when a player is hurt but also offers a chance of healing!

Added: limited support for player skin switching (see: player_skins.txt)
Added: Wooden Shield and Enhanced Wooden Shield
Added: wieldable items, all default tools (axe, shovel, pick, sword) are now visible.

Many improvements have been been made to the base code, including wrapping the inner workings in an api while keeping the mod easily extendable via its init.lua.

See top post for updated screenie.

I would still like to find a better way of catching player damage rather than constantly monitoring player health points.

I did post a question about a week ago in this thread: http://forum.minetest.net/viewtopic.php?pid=70595#p70595 However, I fear it may have gotten lost among the trees...
 

User avatar
jordan4ibanez
Member
 
Posts: 1865
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Sun Feb 24, 2013 19:04

Goodwork, couldn't you just have multiple textures on the model? one for the player, one for the wield item?
If you can think it, you can make it.
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Sun Feb 24, 2013 19:11

jordan4ibanez wrote:Goodwork, couldn't you just have multiple textures on the model? one for the player, one for the wield item?


Not sure I get your meaning...is that not what I am already doing?
 

User avatar
jordan4ibanez
Member
 
Posts: 1865
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Sun Feb 24, 2013 19:35

stu wrote:
jordan4ibanez wrote:Goodwork, couldn't you just have multiple textures on the model? one for the player, one for the wield item?


Not sure I get your meaning...is that not what I am already doing?

Aren't you having the player's wield item be part of their skin?
If you can think it, you can make it.
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Sun Feb 24, 2013 19:44

jordan4ibanez wrote:Aren't you having the player's wield item be part of their skin?

Not quite, the wielded item image is merged with the player skin, as are the individual armor images. Only problem is, all images need to be the same size for this to work. If you know a better way to accomplish this then I would really love to hear it.

Cheers!
 

User avatar
jordan4ibanez
Member
 
Posts: 1865
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Sun Feb 24, 2013 22:18

stu wrote:
jordan4ibanez wrote:Aren't you having the player's wield item be part of their skin?

Not quite, the wielded item image is merged with the player skin, as are the individual armor images. Only problem is, all images need to be the same size for this to work. If you know a better way to accomplish this then I would really love to hear it.

Cheers!

So what you're saying is it can work with any 16x16 image? How does the wield image get stuck onto the hand?
If you can think it, you can make it.
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Sun Feb 24, 2013 22:53

jordan4ibanez wrote:So what you're saying is it can work with any 16x16 image? How does the wield image get stuck onto the hand?

By merging the image with the unwrap vector map (or skin) of a customized player mesh.

Edit: Or more correctly, character mesh ;)
Last edited by stu on Sun Feb 24, 2013 22:56, edited 1 time in total.
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Sun Feb 24, 2013 22:59

stu wrote:
jordan4ibanez wrote:Aren't you having the player's wield item be part of their skin?

Not quite, the wielded item image is merged with the player skin, as are the individual armor images. Only problem is, all images need to be the same size for this to work. If you know a better way to accomplish this then I would really love to hear it.

I believe you can now attach entities to parts of the player mesh, so you can spawn a Lua entity with a mesh that represents the tool the player is wielding. That might be a lot more work though, of course.
 

User avatar
jordan4ibanez
Member
 
Posts: 1865
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Sun Feb 24, 2013 23:39

stu wrote:
jordan4ibanez wrote:So what you're saying is it can work with any 16x16 image? How does the wield image get stuck onto the hand?

By merging the image with the unwrap vector map (or skin) of a customized player mesh.

Edit: Or more correctly, character mesh ;)

Oh so whatever you're wielding does show? or only certain things? I'm kind of confused.
If you can think it, you can make it.
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Sun Feb 24, 2013 23:52

jordan4ibanez wrote:Oh so whatever you're wielding does show? or only certain things? I'm kind of confused.

Additional wieldable items can be included via init.lua
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
armor_api.wieldable_items = {
    ["default:sword_steel"] = "3d_armor_default_sword_steel.png",
    ["default:sword_stone"] = "3d_armor_default_sword_stone.png",
    ["default:sword_wood"] = "3d_armor_default_sword_wood.png",
    ["default:pick_mese"] = "3d_armor_default_pick_mese.png",
    ["default:pick_steel"] = "3d_armor_default_pick_steel.png",
    ["default:pick_stone"] = "3d_armor_default_pick_stone.png",
    ["default:pick_wood"] = "3d_armor_default_pick_wood.png",
    ["default:axe_steel"] = "3d_armor_default_axe_steel.png",
    ["default:axe_stone"] = "3d_armor_default_axe_stone.png",
    ["default:axe_wood"] = "3d_armor_default_axe_wood.png",
    ["default:shovel_steel"] = "3d_armor_default_shovel_steel.png",
    ["default:shovel_stone"] = "3d_armor_default_shovel_stone.png",
    ["default:shovel_wood"] = "3d_armor_default_shovel_wood.png",
}

Just look at those already included for an example.
Last edited by stu on Mon Feb 25, 2013 00:19, edited 1 time in total.
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Sun Feb 24, 2013 23:53

jordan4ibanez wrote:Oh so whatever you're wielding does show? or only certain things? I'm kind of confused.


By default nothing does, but mods like this one are aiming at fixing that, with the help of some game engine features behind the scenes.
 

User avatar
jordan4ibanez
Member
 
Posts: 1865
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Mon Feb 25, 2013 00:01

stu wrote:
jordan4ibanez wrote:Oh so whatever you're wielding does show? or only certain things? I'm kind of confused.

Additional wieldable items can be included via init.lua
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
armor_api.wieldable_items = {
    ["default:sword_steel"] = "3d_armor_default_sword_steel.png",
    ["default:sword_stone"] = "3d_armor_default_sword_stone.png",
    ["default:sword_wood"] = "3d_armor_default_sword_wood.png",
    ["default:pick_mese"] = "3d_armor_default_pick_mese.png",
    ["default:pick_steel"] = "3d_armor_default_pick_steel.png",
    ["default:pick_stone"] = "3d_armor_default_pick_stone.png",
    ["default:pick_wood"] = "3d_armor_default_pick_wood.png",
    ["default:axe_steel"] = "3d_armor_default_axe_steel.png",
    ["default:axe_stone"] = "3d_armor_default_axe_stone.png",
    ["default:axe_wood"] = "3d_armor_default_axe_wood.png",
    ["default:shovel_steel"] = "3d_armor_default_shovel_steel.png",
    ["default:shovel_stone"] = "3d_armor_default_shovel_stone.png",
    ["default:shovel_wood"] = "3d_armor_default_shovel_wood.png",
}

Just look at those included for an example.

Why not just check the wield item's wield texture on the go and just use that so you don't have to define every SINGLE THING that is installed?
If you can think it, you can make it.
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Mon Feb 25, 2013 00:31

jordan4ibanez wrote:Why not just check the wield item's wield texture on the go and just use that so you don't have to define every SINGLE THING that is installed?

A. Because I don't even think it is currently possible to read an items texture (could be mistaken here)
B. The image needs to be re-sized to 64x64 to fit my customized mesh.
 

User avatar
jordan4ibanez
Member
 
Posts: 1865
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Mon Feb 25, 2013 00:47

stu wrote:
jordan4ibanez wrote:Why not just check the wield item's wield texture on the go and just use that so you don't have to define every SINGLE THING that is installed?

A. Because I don't even think it is currently possible to read an items texture (could be mistaken here)
B. The image needs to be re-sized to 64x64 to fit my customized mesh.

A: Yes you can
B: Why not resize your mesh to fix 16x16?
If you can think it, you can make it.
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Mon Feb 25, 2013 01:01

jordan4ibanez wrote:A: Yes you can
B: Why not resize your mesh to fix 16x16?

Well, on both counts, I do not know how to do that.
Last edited by stu on Mon Feb 25, 2013 01:02, edited 1 time in total.
 

User avatar
jordan4ibanez
Member
 
Posts: 1865
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Mon Feb 25, 2013 02:42

stu wrote:
jordan4ibanez wrote:A: Yes you can
B: Why not resize your mesh to fix 16x16?

Well, on both counts, I do not know how to do that.

Here, this will check if the wield item's texture, and if it is a block it will use the first texture from the tile face.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_globalstep(function(dtime)
    for _,player in ipairs(minetest.get_connected_players()) do
        local wielded_item = player:get_wielded_item()
        local readable_wielded_item = wielded_item:to_table()
        if readable_wielded_item ~= nil then
            local get_item_name = readable_wielded_item.name
            local wield_item_texture = minetest.registered_items[get_item_name].inventory_image
            if wield_item_texture == "" then
                local wield_item_texture = minetest.registered_items[get_item_name].tiles[1]
            end
            print(dump(wield_item_texture))
        end
    end
end)
Last edited by jordan4ibanez on Mon Feb 25, 2013 02:43, edited 1 time in total.
If you can think it, you can make it.
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Mon Feb 25, 2013 18:57

stu wrote:
Jordach wrote:I dont know how patches work, could it be possible to generate an init.lua file?


on a real operating system you would use: patch init.lua < foobar.patch. IIRC you can maybe do this with MSYS under windoze.

4aiman wrote:According to the readme, Kaeza "forgot" who made this mod despite it's WIP state and made his own version.


I think Kaeza was referring to your 3d armor entity thread there. He does not seem to even acknowledge the existence of this mod. To be fair though, I did not even release this as a mod myself, it got moved here from modding general and re-titled by some admin.

Anyway, Kaeza is quite welcome to use this idea with the existing armor mod because that is exactly what I did not want to do. There should be no wood (shield excepted) or stone armor for sure. Even copper, gold and silver are a bit wrong IMO.

@LorenzoVulcan I do plan to include some limited support for the player skin switching. Unfortunately it is not something as straightforward as rendering the .x to fit the skin. The skin needs to fit the mesh and will therefore need to be re-sized in order to work with the new wielded items model.


I will switch my mod into something different (sorry, I didn't notice this mod was already started).
BTW, what is your method for "displaying" the armors? Do you use overlayed textures?
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
Likwid H-Craft
Member
 
Posts: 1113
Joined: Sun Jan 06, 2013 14:20

by Likwid H-Craft » Mon Feb 25, 2013 19:06

How do you have players holding items?

Since I like to make it, work for my Portaltest.
My Domain's/others:
http://likwidtest.hj.cx/ (Not Done)
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Mon Feb 25, 2013 21:06

jordan4ibanez wrote:
stu wrote:
jordan4ibanez wrote:A: Yes you can
B: Why not resize your mesh to fix 16x16?

Well, on both counts, I do not know how to do that.

Here, this will check if the wield item's texture, and if it is a block it will use the first texture from the tile face.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_globalstep(function(dtime)
    for _,player in ipairs(minetest.get_connected_players()) do
        local wielded_item = player:get_wielded_item()
        local readable_wielded_item = wielded_item:to_table()
        if readable_wielded_item ~= nil then
            local get_item_name = readable_wielded_item.name
            local wield_item_texture = minetest.registered_items[get_item_name].inventory_image
            if wield_item_texture == "" then
                local wield_item_texture = minetest.registered_items[get_item_name].tiles[1]
            end
            print(dump(wield_item_texture))
        end
    end
end)

Thankyou for the code, I never thought of using minetest.registered.item for this, however, that only solves problem A. Problem B might not be so easy without changing the engine itself to support multiple texture maps of different sizes/resolutions.

kaeza wrote:I will switch my mod into something different (sorry, I didn't notice this mod was already started).

No problem, but I really don't think that should be neccessary. Armor_plus would be a very useful addition to the existing armor mod, esp. for those already using it. Just because I don't like the idea of stone armor etc, there are plenty of people who do want that. Armor_plus would also not (as yet) require any changes to the character mesh, which this mod does. That gives it a number of advantages, like much easier integration of player skins.

kaeza wrote:BTW, what is your method for "displaying" the armors? Do you use overlayed textures?


Yes, though not ideal, it does seem to work so long as the images are all kept the same size as the player skin.

Likwid H-Craft wrote:How do you have players holding items?

Since I like to make it, work for my Portaltest.


It's all done with smoke and mirrors...maybe this image will give you an idea.

Image
Last edited by stu on Mon Feb 25, 2013 21:39, edited 1 time in total.
 

Iqualfragile
Member
 
Posts: 160
Joined: Tue Sep 18, 2012 22:11

by Iqualfragile » Tue Feb 26, 2013 22:42

that looks great, but could you please move your code into a repository like git or hg so it would be easier to update your mod for a server-admin.
Gr8 b8, m8. I rel8, str8 appreci8, and congratul8. I r8 this b8 an 8/8. Plz no h8, I'm str8 ir8. Cr8 more, can't w8. We should convers8, I won't ber8, my number is 8888888, ask for N8. No calls l8 or out of st8. If on a d8, ask K8 to loc8. Even with a full pl8, I always have time to communic8 so don't hesit8.
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Tue Feb 26, 2013 23:56

Iqualfragile wrote:that looks great, but could you please move your code into a repository like git or hg so it would be easier to update your mod for a server-admin.

Aboslutely, i will do that, very soon. I've been thinking about it for a while... I'll get on to it asap, I promise.

Cheers.
 

PreviousNext

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 8 guests

cron