Page 1 of 4

[Mod] 3d visible wielded items [0.4.0] [wield3d]

Posted: Sat Jun 29, 2013 15:39
by stu
Tittle just about says it all.

Image

Now supports the 3d_armor modpack, note that when used in conjunction with the wieldview mod, wield3d will only be used for nodes/items that are not covered by wieldview.

Minetest version: 0.4.12 or later
Depends: default
Download: https://github.com/stujones11/wield3d/a ... master.zip
Github: https://github.com/stujones11/wield3d
License: WTFPL

Known Issues

Items occasionally disappear when viewing in 3rd person. This is a minetest engine bug and not the fault of the mod, turning 3rd person off then back on restores the view.

Posted: Sat Jun 29, 2013 15:50
by Inocudom
stu wrote:Tittle just about says it all. Extremely hacky but it kinda works of a fashion.

Still very much a work in progress, some items don't look so good, like shovels and buckets for example.

Note: Currently not compatible with minetest-3d_armor or any other mod that changes the default character model.

Image

Minetest version: 0.4.5, 0.4.6, 0.4.7
Depends: default
Download: https://dl.dropboxusercontent.com/s/d0t ... ield3d.zip
License: WTFPL
Good work there, stu. This and being able to see your own player model by looking down will make Minetest more fun to play.

Posted: Sat Jun 29, 2013 18:54
by prof-turbo
AWESOME! SO COOL! + 12365498145231025645614635.2016 !
WOWOWOWOWOWOWO!

( Don't like it #joke )

Posted: Sat Jun 29, 2013 18:54
by prof-turbo
Download it now!

Posted: Sat Jun 29, 2013 20:49
by VanessaE
This actually works reasonably well on my server. The only issue I see so far is sometimes a player's hand doesn't show the item they're holding. Then again, that player said that sometimes signs (which use entities for visible text) show random player skins (!), so his client may be glitchy.

Would you consider a variation of this mod that is combined with your "knees and elbows" player model?

Posted: Sat Jun 29, 2013 21:32
by stu
VanessaE wrote:This actually works reasonably well on my server. The only issue I see so far is sometimes a player's hand doesn't show the item they're holding. Then again, that player said that sometimes signs (which use entities for visible text) show random player skins (!), so his client may be glitchy.
It is difficult to test this properly by myself so I really apperiate any feedback from those running servers. Please let me know if you do discover the cause.
VanessaE wrote:Would you consider a variation of this mod that is combined with your "knees and elbows" player model?
Maybe, although I'd rather get to the root of the probem with bone attachment, otherwise I'd need to maintain multiple models everywhere. It is currently not clear whether Irrlicht is at fault or the blender directx exporter.
prof-turbo wrote:AWESOME! SO COOL! + 12365498145231025645614635.2016 !
WOWOWOWOWOWOWO!)
Glad you like it!
prof-turbo wrote:Download it now!
I do appreciate your enthusiasm, however, this mod is somewhat useless unless you run a server.

Posted: Sun Jun 30, 2013 00:46
by VanessaE
Another thing I've noticed is sometimes the item that should be in my hand is shown attached to a spot on the ground near where I'm standing. If I roll my mouse wheel to switch items, the item embedded into the ground changes to match. Its location on the ground seems to be where I spawned at least (e.g. at client sign-on). Probably related to the issue with the other player's wielded item not being visible.

Posted: Sun Jun 30, 2013 10:18
by prof-turbo
stu wrote:
prof-turbo wrote:Download it now!
I do appreciate your enthusiasm, however, this mod is somewhat useless unless you run a server.
Yes... I thought to it after I downloaded it ;)

Posted: Sun Jun 30, 2013 13:01
by stu
VanessaE wrote:Another thing I've noticed is sometimes the item that should be in my hand is shown attached to a spot on the ground near where I'm standing. If I roll my mouse wheel to switch items, the item embedded into the ground changes to match. Its location on the ground seems to be where I spawned at least (e.g. at client sign-on). Probably related to the issue with the other player's wielded item not being visible.
I have so far not been able to repproduce this locally, however, it soulds like the entity is not being attached to the player. I have added a half second delay in register_on_joinplayer to see if that helps. If it doesn't then you could try increasing the delay a little.

Thanks again for the update.

Posted: Sun Jun 30, 2013 16:58
by VanessaE
Can you put your code up on github? Makes it easier for the rest of us to grab updates. :-)

Posted: Sun Jun 30, 2013 17:16
by stu
VanessaE wrote:Can you put your code up on github? Makes it easier for the rest of us to grab updates. :-)
I probaby will if it gets moved to release, although I am not sure whether to replace wieldview in the 3d_armor modpack with this.

I have just made some more updates as it goes, i corrected the rotations of default items that looked wrong.
This has been done by including a table of override rotations.

Code: Select all

wield3d_rotation = {
    ["default:torch"]=315,
    ["default:sapling"]=315,
    ["flowers:dandelion_white"]=315,
    ["flowers:dandelion_yellow"]=315,
    ["flowers:geranium"]=315,
    ["flowers:rose"]=315,
    ["flowers:tulip"]=315,
    ["flowers:viola"]=315,
    ["default:shovel_wood"]=270,
    ["default:shovel_stone"]=270,
    ["default:shovel_steel"]=270,
    ["default:shovel_bronze"]=270,
    ["default:shovel_mese"]=270,
    ["default:shovel_diamond"]=270,
    ["bucket:bucket_empty"]=270,
    ["bucket:bucket_water"]=270,
    ["bucket:bucket_lava"]=270,
    ["screwdriver:screwdriver"]=270,
    ["screwdriver:screwdriver1"]=270,
    ["screwdriver:screwdriver2"]=270,
    ["screwdriver:screwdriver3"]=270,
    ["screwdriver:screwdriver4"]=270,
}
Not exactly ideal but it's all I can think of for now. Server admins can extend this table to include any additional items not already covered. Alternatively modders could add rotational support for thier own items in code.

Code: Select all

    if minetest.get_modpath("wield3d") then
        wield3d_rotation["my_cool_mod:my_awesome_tool"]=270
    end

Posted: Sun Jun 30, 2013 17:21
by PilzAdam
stu wrote: Alternatively modders could add rotational support for thier own items in code.

Code: Select all

    if minetest.get_modpath("wield3d") then
        wield3d_rotation["my_cool_mod:my_awesome_tool"]=270
    end
They have to put "wield3d?" in depends.txt too, so this mod is loaded first.

Posted: Sun Jun 30, 2013 17:33
by stu
PilzAdam wrote:
stu wrote: Alternatively modders could add rotational support for thier own items in code.

Code: Select all

    if minetest.get_modpath("wield3d") then
        wield3d_rotation["my_cool_mod:my_awesome_tool"]=270
    end
They have to put "wield3d?" in depends.txt too, so this mod is loaded first.
That is true, although they could wrap it in a minetest.after if they wanted to avoid dependency.

Posted: Sun Jun 30, 2013 17:47
by PilzAdam
stu wrote:
PilzAdam wrote:
stu wrote: Alternatively modders could add rotational support for thier own items in code.

Code: Select all

    if minetest.get_modpath("wield3d") then
        wield3d_rotation["my_cool_mod:my_awesome_tool"]=270
    end
They have to put "wield3d?" in depends.txt too, so this mod is loaded first.
That is true, although they could wrap it in a minetest.after if they wanted to avoid dependency.
With the "?" at the end its an optional dependency, wich means that its not a real dependency, the mod just gets loaded first.

Posted: Sun Jun 30, 2013 17:51
by stu
PilzAdam wrote:
stu wrote:
PilzAdam wrote: They have to put "wield3d?" in depends.txt too, so this mod is loaded first.
That is true, although they could wrap it in a minetest.after if they wanted to avoid dependency.
With the "?" at the end its an optional dependency, wich means that its not a real dependency, the mod just gets loaded first.
Ah, I didn't know that, thanks!

Actually, I thought that was either a typo or that you were skitting the name 8)

Posted: Sun Jun 30, 2013 18:43
by VanessaE
By using a ? mark in depends.txt, the mod calling for wield3d (or whatever) will proceed without it if it's missing.

Posted: Sun Jun 30, 2013 20:24
by stu
Now posted on github.

There have been a few minor changes since the last update. Entities now only detach/re-attach if the rotation has changed and the overrides have been moved to a separate file, rotation.lua.

Posted: Mon Jul 01, 2013 21:17
by VanessaE
It seems to be working more reliably now.

Posted: Mon Jul 01, 2013 21:30
by stu
VanessaE wrote:It seems to be working more reliably now.
I am pleased to hear that, looks like the delay is needed then maybe I'll extend it to 1 just to be sure.

I have just noticed though that the player skin in fact mirrored, this is a result of all the blender jiggery-pokery I had to do to get this thing to work. I will fix that as soon as I get a chance, it's quite a tedious exercise...

Posted: Mon Jul 01, 2013 21:55
by Mito551
when will this be able for use with your 3darmor mod?

Posted: Mon Jul 01, 2013 22:27
by stu
Mito551 wrote:when will this be able for use with your 3darmor mod?
I would like to eventually add support for this in 3d_armor but curremtly that would involve practically redoing the whole armor model.

Essentially I am exploiting a bug to make this work, when by rights it wouldn't work. Did I mention this was extremely hacky?

I am currently trying to find a better solution than this so I'm sorry, I can't give an exact timeframe.

Posted: Tue Jul 02, 2013 10:34
by Mito551
Oh alright. Take your time! I'm really excite about having better way to see what's in other people's hands.

Posted: Wed Jul 03, 2013 19:56
by stu
Mod updated.

Fixed the mirrored skins (I think) and fixed wielding an unkown object tile when joining 'empty handed'.
Also added better looking rotations for vessels.

Posted: Mon Jul 08, 2013 19:54
by stu
VanessaE wrote:Would you consider a variation of this mod that is combined with your "knees and elbows" player model?
Not sure if you are still using this, however, I have now made a wield3d version of the split-limb model.
Download link in the "knees and elbows" topic.

Posted: Mon Jul 08, 2013 23:02
by VanessaE
Sweet - thanks!