[Mod] Visible Wielditems [visible_wielditem]

Post Reply
User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

[Mod] Visible Wielditems [visible_wielditem]

by LMD » Post

Visible Wielditem

Shows wielded items in-world.

Features

Modern alternative to wield3d:
  • Relies less on deprecated engine APIs, doesn't aim to support older MT versions
  • Supports colored items. Works well with epidermis.
  • Supports glow (for environmental lighting use a wielded light mod)
  • Indicates size of stacks
  • Provides a proper API for mods to use
  • Rotates the model instead of the texture
License

Code written by appgurueu and licensed under the MIT license.

The screenshot (screenshot.png) uses Hugues Ross' RPG16 texture pack, which is licensed under CC-BY-SA-4.0, and is therefore licensed under CC-BY-SA-4.0 as well.

Links
  • GitHub - sources, issue tracking, contributing
  • Discord - discussion, chatting
  • Minetest Forum - (more organized) discussion
  • ContentDB - releases (downloading from GitHub is recommended)
API

All within the visible_wielditem global variable.

get_attachment(modelname, itemname)

Returns a table with fields bonename, position (unit: metric/nodes), rotation (unit: degrees) and scale (number, unit: metric/nodes) based on model attachments and item tweaks.

model_attachments

Table. Keys are model media (file) names, values are tables with field bonename, position, rotation and scale. The special field default is used for default attachment settings based on character.b3d if no model attachments are specified for a player model or if the specified attachment settings are incomplete.

item_tweaks

Table of tweaks applied based on the item. Subtable entries have strings as keys and tweak tables with fields position, rotation and scale as values. positions are added up, rotations are properly composed, scale is multiplied.

types

Applies tweaks based on item type. Possible keys are unknown, node, tool and craftitem.

groups

Tweaks for a key are applied if the item has an item group with that name.

names

Tweaks for a single item, by full item name.
My stuff: Projects - Mods - Website

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

Re: [Mod] Visible Wielditems [visible_wielditem]

by runs » Post

OH MY GOSHHHHHHH!!!

I was just desperate for such a mod these days. And there is stu's wield3d, which is the de facto one.

But with serious problems!!!

My new game, new model, a ghost appears in another orientation/direction? this:
https://github.com/minetest/minetest_ga ... -375910737

I'll test it.

User avatar
j0j0n4th4n
Member
Posts: 249
Joined: Tue Jan 26, 2021 06:45

Re: [Mod] Visible Wielditems [visible_wielditem]

by j0j0n4th4n » Post

Hmm, I have been using a mod called "weildview" however I don't seem to find it anywhere, I found one called "weildview II" ( viewtopic.php?t=25358 ) which I think may be an updated version (the files have the same name), but there is more dependencies.

Anyway, I will try out both your mod and wieldview II but I would like to ask what the differences between the two are?
cdb_894a100ddd76

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [Mod] Visible Wielditems [visible_wielditem]

by LMD » Post

j0j0n4th4n wrote:
Thu Feb 03, 2022 05:47
Anyway, I will try out both your mod and wieldview II but I would like to ask what the differences between the two are?
I have only had a brief look at wieldview 2, but I believe these (mostly taken from my "features" list) are key features:

- Less dependencies
- Displays actual 3d wielditems instead of changing just the texture, which is generally better as it works better with different rotations or resolutions and doesn't fill up any texture cache.
- Shows changed wielditems immediately (doesn't have a timer)
- Supports colored items
- Supports glow (for environmental lighting use a wielded light mod)
- Indicates size of stacks
- Provides a proper API for mods to use

Downsides:

- Using attachments is slightly heavier and has some engine bugs
- Doesn't support older MT versions
My stuff: Projects - Mods - Website

Jackknife
Member
Posts: 189
Joined: Fri Sep 25, 2020 20:07

Re: [Mod] Visible Wielditems [visible_wielditem]

by Jackknife » Post

I ran into this problem:

2022-04-16 16:58:23: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'visible_wielditem' in callback on_joinplayer(): ...etest-5.5.0-win64\bin\..\mods\visible_wielditem\init.lua:78: attempt to index local 'def' (a nil value)
2022-04-16 16:58:23: ERROR[Main]: stack traceback:
2022-04-16 16:58:23: ERROR[Main]: ...etest-5.5.0-win64\bin\..\mods\visible_wielditem\init.lua:78: in function 'get_attachment'
2022-04-16 16:58:23: ERROR[Main]: ...etest-5.5.0-win64\bin\..\mods\visible_wielditem\init.lua:112: in function '_update_attachment'
2022-04-16 16:58:23: ERROR[Main]: ...etest-5.5.0-win64\bin\..\mods\visible_wielditem\init.lua:149: in function '_set_item'
2022-04-16 16:58:23: ERROR[Main]: ...etest-5.5.0-win64\bin\..\mods\visible_wielditem\init.lua:128: in function '_set_player'
2022-04-16 16:58:23: ERROR[Main]: ...etest-5.5.0-win64\bin\..\mods\visible_wielditem\init.lua:7: in function <...etest-5.5.0-win64\bin\..\mods\visible_wielditem\init.lua:5>
2022-04-16 16:58:23: ERROR[Main]: ...ds\minetest-5.5.0-win64\bin\..\builtin\game\register.lua:425: in function <...ds\minetest-5.5.0-win64\bin\..\builtin\game\register.lua:409>
2022-04-16 16:58:23: ACTION[Main]: Server: Shutting down

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [Mod] Visible Wielditems [visible_wielditem]

by LMD » Post

Jackknife wrote:
Sat Apr 16, 2022 22:05
I ran into this problem:

2022-04-16 16:58:23: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'visible_wielditem' in callback on_joinplayer(): ...etest-5.5.0-win64\bin\..\mods\visible_wielditem\init.lua:78: attempt to index local 'def' (a nil value)
2022-04-16 16:58:23: ERROR[Main]: stack traceback:
2022-04-16 16:58:23: ERROR[Main]: ...etest-5.5.0-win64\bin\..\mods\visible_wielditem\init.lua:78: in function 'get_attachment'
2022-04-16 16:58:23: ERROR[Main]: ...etest-5.5.0-win64\bin\..\mods\visible_wielditem\init.lua:112: in function '_update_attachment'
2022-04-16 16:58:23: ERROR[Main]: ...etest-5.5.0-win64\bin\..\mods\visible_wielditem\init.lua:149: in function '_set_item'
2022-04-16 16:58:23: ERROR[Main]: ...etest-5.5.0-win64\bin\..\mods\visible_wielditem\init.lua:128: in function '_set_player'
2022-04-16 16:58:23: ERROR[Main]: ...etest-5.5.0-win64\bin\..\mods\visible_wielditem\init.lua:7: in function <...etest-5.5.0-win64\bin\..\mods\visible_wielditem\init.lua:5>
2022-04-16 16:58:23: ERROR[Main]: ...ds\minetest-5.5.0-win64\bin\..\builtin\game\register.lua:425: in function <...ds\minetest-5.5.0-win64\bin\..\builtin\game\register.lua:409>
2022-04-16 16:58:23: ACTION[Main]: Server: Shutting down
You were wielding an unknown item, right? Fixed.
My stuff: Projects - Mods - Website

Post Reply

Who is online

Users browsing this forum: No registered users and 24 guests