[Mod] Item magnet and in-world node drops [item_drop]
Re: [Mod] Item drops, pickups. Rewrite, new features [item_d
Good to hear. I have downloaded the 5.0 version, having thought that it is the beta version and that the most mods won't work I didn't try to play it.
Tested this mod on 5.0 and it works well now. Thanks for the help.
Tested this mod on 5.0 and it works well now. Thanks for the help.
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: [Mod] Item drops, pickups. Rewrite, new features [item_d
It sounds like you're coming from the Minecraft side of town. In Minetest it's the opposite: the vast majority of mods do work in newer versions. :Dzasnool wrote:Good to hear. I have downloaded the 5.0 version, having thought that it is the beta version and that the most mods won't work I didn't try to play it.
Tested this mod on 5.0 and it works well now. Thanks for the help.
You're welcome, thanks for using item_drop!
Re: [Mod] Item drops, pickups. Rewrite, new features [item_d
I ended up using 4.17 after all, some of the mods don't work quite well on the v5 of minetest. If anyone comes looking for the same problem solution here's what I did:
Set the magnet radius to -1, as it was by default and set the pickup radius to 2 blocks(or is it meters, i don;t know) you can set it to whatever you find comfortable. Sure, I don't have this nice little visual effect of items transitioning to the character, but at least I don't miss out on blocks that fall on the ground in close proximity(pickup radius value), like, for example, tree saplings that fall from the tree crown that no longer has it's trunk. Optionally, you can disable item drop - in case you are mining further away than pickup radius value.
Overall, this is a very good and useful mod, thank you for providing it.
Set the magnet radius to -1, as it was by default and set the pickup radius to 2 blocks(or is it meters, i don;t know) you can set it to whatever you find comfortable. Sure, I don't have this nice little visual effect of items transitioning to the character, but at least I don't miss out on blocks that fall on the ground in close proximity(pickup radius value), like, for example, tree saplings that fall from the tree crown that no longer has it's trunk. Optionally, you can disable item drop - in case you are mining further away than pickup radius value.
Overall, this is a very good and useful mod, thank you for providing it.
- Hybrid Dog
- Member
- Posts: 2836
- Joined: Thu Nov 01, 2012 12:46
- GitHub: HybridDog
Re: [Mod] Item drops, pickups. Rewrite, new features [item_d
I've pushed a fix: https://github.com/minetest-mods/item_d ... a929a7f042
Please test if it works.
A small problem is left: When a player makes an item fly to it and then quickly runs away from it, the item flies away, e.g. into sky. After 5 (magnet_time) seconds, the item is collected (or falls down if it can't be collected).
This could be fixed by moving the magnet flight code to the on_step function.
Please test if it works.
A small problem is left: When a player makes an item fly to it and then quickly runs away from it, the item flies away, e.g. into sky. After 5 (magnet_time) seconds, the item is collected (or falls down if it can't be collected).
This could be fixed by moving the magnet flight code to the on_step function.
Re: [Mod] Item drops, pickups. Rewrite, new features [item_d
It works good in first-person view, but in third person you can see that the items fly right through the player on a vector. I would've never noticed it if it wasn't for you pointing to that problem. By the way, this happens even when the player stands still, you don't have to run away.
- Hybrid Dog
- Member
- Posts: 2836
- Joined: Thu Nov 01, 2012 12:46
- GitHub: HybridDog
Re: [Mod] Item drops, pickups. Rewrite, new features [item_d
I can't reproduce it in singleplayer mode.zasnool wrote:It works good in first-person view, but in third person you can see that the items fly right through the player on a vector. I would've never noticed it if it wasn't for you pointing to that problem. By the way, this happens even when the player stands still, you don't have to run away.
The item doesn't collide with the player and I can't easily change this behaviour. If you set pickup_radius large enough, the item should be detected earlier before reaching the player.
I assume you disabled pickup_particle because it may look gaudy together with magnet mode.
- SpaghettiToastBook
- Member
- Posts: 52
- Joined: Sun Feb 22, 2015 21:11
- In-game: STB
- Location: The Milky Way
Re: [Mod] Item drops, pickups. Rewrite, new features [item_d
Is it possible that you could make it so that some of the settings work on a per-player basis? This could be used to make auto-pickup and the magnet effect into power-ups.
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: [Mod] Item drops, pickups. Rewrite, new features [item_d
Interesting idea. For example, features can be protected by privileges. But it would be more like punishing non-privileged players by forcing them to first break the node, then having to pick it up one-by-one. But that’s perhaps exactly what you want? >:)SpaghettiToastBook wrote:Is it possible that you could make it so that some of the settings work on a per-player basis? This could be used to make auto-pickup and the magnet effect into power-ups.
- SpaghettiToastBook
- Member
- Posts: 52
- Joined: Sun Feb 22, 2015 21:11
- In-game: STB
- Location: The Milky Way
Re: [Mod] Item drops, pickups. Rewrite, new features [item_d
Essentially. I'm working on a mod that adds equipment slots, and I wanted to make a piece of equipment that attracts nearby items. I'm currently using this mod just so that you don't have to click on items to pick them up, so this would only be a minor upgrade.texmex wrote:Interesting idea. For example, features can be protected by privileges. But it would be more like punishing non-privileged players by forcing them to first break the node, then having to pick it up one-by-one. But that’s perhaps exactly what you want? >:)SpaghettiToastBook wrote:Is it possible that you could make it so that some of the settings work on a per-player basis? This could be used to make auto-pickup and the magnet effect into power-ups.
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: [Mod] Item drops, pickups. Rewrite, new features [item_d
Interesting. If I got time I can implement it as an opt-in setting that enable a check for a matching priv. That way default mod behavior isn’t affected. But should it reverse key-triggered pickup action settings? If so I feel the mod would start to get a bit bloated.
Re: [Mod] Item drops, pickups. Rewrite, new features [item_d
This mod is very cool. I use it.
- Hybrid Dog
- Member
- Posts: 2836
- Joined: Thu Nov 01, 2012 12:46
- GitHub: HybridDog
Re: [Mod] Item drops, pickups. Rewrite, new features [item_d
The mod is structured so that when specific settings are disabled, the code is not executed. For example, the code which makes items fly to players is ignored if magnet_mode is disabled: https://github.com/minetest-mods/item_d ... t.lua#L132texmex wrote:Interesting. If I got time I can implement it as an opt-in setting that enable a check for a matching priv. That way default mod behavior isn’t affected. But should it reverse key-triggered pickup action settings? If so I feel the mod would start to get a bit bloated.
This could make player-based settings difficult to implement.
However, functions can be added to disable the behaviour under specific conditions when the setting is enabled.
I think that using a privilege is a workaround for what you try to achieve.
To make it more modular, you can add a function to this mod which can be overridden similar to how minetest.is_protected is overridden.
The player would be a parameter of this function, so you could directly test the equipment slot instead of doing the detour with the privilege.
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: [Mod] Item drops, pickups. Rewrite, new features [item_d
Yes. Sounds like you know what you're doing and I'm merely speculating, which goes to show who's the brains in the item_drop operation =)Hybrid Dog wrote:The mod is structured so that when specific settings are disabled, the code is not executed. For example, the code which makes items fly to players is ignored if magnet_mode is disabled: https://github.com/minetest-mods/item_d ... t.lua#L132texmex wrote:Interesting. If I got time I can implement it as an opt-in setting that enable a check for a matching priv. That way default mod behavior isn’t affected. But should it reverse key-triggered pickup action settings? If so I feel the mod would start to get a bit bloated.
This could make player-based settings difficult to implement.
However, functions can be added to disable the behaviour under specific conditions when the setting is enabled.
I think that using a privilege is a workaround for what you try to achieve.
To make it more modular, you can add a function to this mod which can be overridden similar to how minetest.is_protected is overridden.
The player would be a parameter of this function, so you could directly test the equipment slot instead of doing the detour with the privilege.
- Hybrid Dog
- Member
- Posts: 2836
- Joined: Thu Nov 01, 2012 12:46
- GitHub: HybridDog
Re: [Mod] Item drops, pickups. Rewrite, new features [item_d
It's actually quite simple.
https://github.com/HybridDog/item_drop/ ... 85b960e0c0
Can I push the commit to master?
Code: Select all
local old_can_pickup = item_drop.can_pickup
function item_drop.can_pickup(entity, player)
-- example code
if player:get_player_name() == "singleplayer" then
return false
end
return old_can_pickup(entity, player)
end
Can I push the commit to master?
Re: [Mod] Item drops, pickups. Rewrite, new features [item_d
It does not work the magnet thing on 5.0-dev/Android :-(
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: [Mod] Item drops, pickups. Rewrite, new features [item_d
It works just fine on 5.0.0-dev. Android I don’t know about. Are you sure it’s not just set to be key-activated?
Re: [Mod] Item drops, pickups. Rewrite, new features [item_d
What do you mean by 'key-activate'?texmex wrote:It works just fine on 5.0.0-dev. Android I don’t know about. Are you sure it’s not just set to be key-activated?
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: [Mod] Item drops, pickups. Rewrite, new features [item_d
item_drop.enable_pickup_key should be set to true by default, and that key should be Use key by default (E on desktops).
Re: [Mod] Item drops, pickups. Rewrite, new features [item_d
Oh, I will try that. :-)texmex wrote:item_drop.enable_pickup_key should be set to true by default, and that key should be Use key by default (E on desktops).
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: [Mod] Item magnet and in-world node drops [item_drop]
New feature! It's now possible to disable manual item pickups by mouse. This disables those pesky selection boxes for items, making the item magnet the only way of picking them up. Mouse pickups are still enabled by default, however.
Re: [Mod] Item magnet and in-world node drops [item_drop]
For some reason it doesn't drop items if they come from an ore. I can mine stone fine and it works as expected, but if I mine coal it mines it but doesn't go into my inventory, or is dropped on the ground.
Minetest 5.0.1
Just try to mine coal in survival to reproduce
Minetest 5.0.1
Just try to mine coal in survival to reproduce
Testin' mines since 1989
- Hybrid Dog
- Member
- Posts: 2836
- Joined: Thu Nov 01, 2012 12:46
- GitHub: HybridDog
Re: [Mod] Item magnet and in-world node drops [item_drop]
Ore drops should work now.
https://github.com/minetest-mods/item_d ... c7b76c9add
Thanks for discovering this bug.
https://github.com/minetest-mods/item_d ... c7b76c9add
Thanks for discovering this bug.
- FreeGamers
- Member
- Posts: 650
- Joined: Sat May 25, 2019 00:15
- GitHub: is proprietary I use NotABug
- Location: United States
- Contact:
Re: [Mod] Item magnet and in-world node drops [item_drop]
I really enjoy this mod and using it on my server has been very positive.
Unfortunately I've come across a bug that is kicking all players from my server. It is creating a fatal error in the server. I notice it mostly happens when there are more than one players, I've created this bug with 3 players on my server pretty consistently.
I have two players that are usually working together and I've noticed they were mining coal (default:stone_with_coal) together when this kept happening. I see this error in other parts of my log that do not involve coal though. I've had to disable this mod for now. I'm not sure what is causing this error.
Unfortunately I've come across a bug that is kicking all players from my server. It is creating a fatal error in the server. I notice it mostly happens when there are more than one players, I've created this bug with 3 players on my server pretty consistently.
Code: Select all
2019-05-24 18:18:44: WARNING[Server]: Undeclared global variable "can_pickup" accessed at /usr/share/games/minetest/mods/item_drop/init.lua:173
2019-05-24 18:18:44: ACTION[Main]: Server: Shutting down
Code: Select all
2019-05-24 18:57:09: WARNING[Server]: Undeclared global variable "can_pickup" accessed at /usr/share/games/minetest/mods/item_drop/init.lua:173
2019-05-24 18:57:09: ACTION[Main]: Server: Shutting down
2019-05-24 18:57:09: ERROR[Main]: ServerError: AsyncErr: environment_Step: Runtime error from mod '' in callback environment_Step(): /usr/share/games/minetest/mods/item_drop/init.lua:173: attempt to call global$
2019-05-24 18:57:09: ERROR[Main]: stack traceback:
2019-05-24 18:57:09: ERROR[Main]: /usr/share/games/minetest/mods/item_drop/init.lua:173: in function 'func'
2019-05-24 18:57:09: ERROR[Main]: /usr/share/games/minetest/builtin/common/after.lua:18: in function </usr/share/games/minetest/builtin/common/after.lua:4>
2019-05-24 18:57:09: ERROR[Main]: /usr/share/games/minetest/builtin/game/register.lua:419: in function </usr/share/games/minetest/builtin/game/register.lua:399>
FreeGamers.org has moved to MeseCraft.net | FreeGamers on this forum is now MeseCraft
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: [Mod] Item magnet and in-world node drops [item_drop]
Fix is out on Github. Can you test it?
- FreeGamers
- Member
- Posts: 650
- Joined: Sat May 25, 2019 00:15
- GitHub: is proprietary I use NotABug
- Location: United States
- Contact:
Re: [Mod] Item magnet and in-world node drops [item_drop]
You bet. I'll try it out immediately.texmex wrote:Fix is out on Github. Can you test it?
EDIT: So far I haven't seen the bug reoccur in about 2 days of testing.
FreeGamers.org has moved to MeseCraft.net | FreeGamers on this forum is now MeseCraft
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 39 guests