Page 1 of 3

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

PostPosted: 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/archive/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.

PostPosted: 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/d0tw0tl0ebzlnra/wield3d.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.

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

( Don't like it #joke )

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

PostPosted: 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?

PostPosted: 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.

PostPosted: 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.

PostPosted: 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 ;)

PostPosted: 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.

PostPosted: 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. :-)

PostPosted: 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.
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
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.
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
    if minetest.get_modpath("wield3d") then
        wield3d_rotation["my_cool_mod:my_awesome_tool"]=270
    end

PostPosted: Sun Jun 30, 2013 17:21
by PilzAdam
stu wrote: Alternatively modders could add rotational support for thier own items in code.
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
    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.

PostPosted: Sun Jun 30, 2013 17:33
by stu
PilzAdam wrote:
stu wrote: Alternatively modders could add rotational support for thier own items in code.
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
    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.

PostPosted: 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.
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
    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.

PostPosted: 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)

PostPosted: 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.

PostPosted: 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.

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

PostPosted: 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...

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

PostPosted: 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.

PostPosted: 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.

PostPosted: 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.

PostPosted: 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.

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

PostPosted: Wed Oct 02, 2013 19:30
by VanessaE
Got this error today:

15:30:56: ERROR[main]: ERROR: An unhandled exception occurred: ServerError: LuaError: error: ...test/.minetest/games/vanessae_game/mods/wield3d/init.lua:65: calling 'add_entity' on bad self (table expected, got nil)

PostPosted: Wed Oct 02, 2013 20:20
by stu
VanessaE wrote:Got this error today:

15:30:56: ERROR[main]: ERROR: An unhandled exception occurred: ServerError: LuaError: error: ...test/.minetest/games/vanessae_game/mods/wield3d/init.lua:65: calling 'add_entity' on bad self (table expected, got nil)


I have no idea why that can be, afaik minetest.env has not been removed yet although I should update this sometime soon.
My only guess is that it is in some way related to that damned entity dupe bug.

Sorry that I am unable to help.

PostPosted: Wed Oct 02, 2013 20:32
by VanessaE
In the meantime, I've had to remove this mod from my servers to prevent the crash. :-(

Possibly related: I still occasionally see my or someone else's wield item not attached to their hand, but rather attached to where that player spawned. E.g. if I'm holding a pick when I sign on, sometimes I will see a copy of that pick "embedded" into the ground where I spawned at.

PostPosted: Wed Oct 02, 2013 20:57
by stu
VanessaE wrote:In the meantime, I've had to remove this mod from my servers to prevent the crash. :-(

Possibly related: I still occasionally see my or someone else's wield item not attached to their hand, but rather attached to where that player spawned. E.g. if I'm holding a pick when I sign on, sometimes I will see a copy of that pick "embedded" into the ground where I spawned at.


I will make some updates to this mod and at least see if I can make it fail more gracefully. The other problem you mention is alomst certainly related to the entity bug, the mod itself is really quite simple. The magic (as it were) is all in the model.

In the meantime you could try using the current-git version of wieldview, though it doesn't look quite as good as wield3d, it does now have a 3d look and unlike the old version, supports any texture resolution.

Edit: Of course you would lose the split-limb effect character model using wieldview.

PostPosted: Wed Oct 02, 2013 21:45
by stu
Update, I just made a small commit that should hopefully prevent the crash. If you get a lot of logged attachment errors then you will need to increase the attachment delay time. I shall make this more easily configurable in a future update.