[Mod] Item magnet and in-world node drops [item_drop]

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

[Mod] Item magnet and in-world node drops [item_drop]

by texmex » Post

Image

item_drop
A highly configurable mod providing item magnet and in-world node drops

Features
- pulls items to the player's inventory if item_drop.enable_item_pickup. (true by default)
- drops items in-world on dig if item_drop.enable_item_drop is set to true. (true by default)
- picks items one by one, sounds better.
- displays a particle of the item just picked above the player, useful in multiplayer

Settings
- Enable item pickups: Pick up items automatically.
- Enable item drops: Drop items in-world on dig, does nothing in creative mode.
- Use pickup key: Use a key to pick up items.
- Invert pickup key: Collect items when the key is not pressed instead of when it is pressed.
- Pickup keytype: What keytype to use as pickup key.
- Pickup sound gain: The volume of the pickup sound.
- Pickup radius: Player pickup radius, the maximum distance from which items can be collected.
- Magnet radius: Magnet radius, items between pickup_radius and this begin flying to the player.
- Magnet time: Item flight duration, items flying for more than this time are added to the player's inventory.
- Pickup age: Time delay in seconds after autopicking an item if it's dropped by a player.
- Pickup particle: Display a particle of the item picked up above the player
(All settings may be configured from Settings tab > Advanced settings > Mods > item_drop)
- Pickups by mouse disableable.

Notes
remove_items feature was removed as item_entity_ttl is now in engine.
Version 0.4.17 through 0.4.17.1 creates lag when moving entities. This is fixed in 0.5.0-dev.

Download (zip)
Source
Last edited by texmex on Wed Feb 13, 2019 01:42, edited 22 times in total.

User avatar
Desour
Member
Posts: 1469
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: [Mod] Item drops, key-triggered item pickups [item_picku

by Desour » Post

Maybe nice.
Last edited by Desour on Mon Jun 26, 2017 15:01, edited 1 time in total.
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] Item drops, key-triggered item pickups [item_picku

by texmex » Post

Last edited by texmex on Sat Jun 23, 2018 13:59, edited 1 time in total.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] Maintained item_drop, key-triggered pickup [item_d

by texmex » Post

(Edited first post to completely convert thread to be about item_drop)

LouisCyfer
Member
Posts: 46
Joined: Sun Jun 25, 2017 02:24
GitHub: LouisCyfer

Re: [Mod] Maintained item_drop, key-triggered pickup [item_d

by LouisCyfer » Post

sent you a PR via github, hope you like and agree to the updates

greets :)

User avatar
Desour
Member
Posts: 1469
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: [Mod] Maintained item_drop, key-triggered pickup [item_d

by Desour » Post

@texmex: On github you could enable issues in the settings.
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

User avatar
Phoenixflo44
Member
Posts: 639
Joined: Fri Jul 28, 2017 15:01
In-game: EvilPhoenix
Location: Behind my PC, in Germany

Re: [Mod] Maintained item_drop, key-triggered pickup [item_d

by Phoenixflo44 » Post

like
Spoiler
I hate my life

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] Maintained item_drop, key-triggered pickup [item_d

by texmex » Post

PR merged, Github issues enabled.

User avatar
Stix
Member
Posts: 1385
Joined: Fri Aug 04, 2017 14:19
IRC: nil
In-game: Stix [+alts]
Location: USA

Re: [Mod] Maintained item_drop, key-triggered pickup [item_d

by Stix » Post

This is really great! a plea: could you change the key from auxiliary to left-shift? thats how its set up on the survivalX server and it works great!
*EDIT: nvm, just tealized there was an option for that #dum.
Hey, what can i say? I'm the bad guy.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] Maintained item_drop, key-triggered pickup [item_d

by texmex » Post

Big rewrite by HybridDog merged into master. First post updated accordingly.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] Maintained item_drop, key-triggered pickup [item_d

by texmex » Post

New multiplayer feature: Pickup particle. Display a particle of the item picked up above the player.

Sorry for the horrible gif
Image

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] Maintained item_drop, key-triggered pickup [item_d

by texmex » Post

All newish features are back in the dev branch since a fatal bug was discovered.
Last edited by texmex on Sat Jun 23, 2018 08:17, edited 1 time in total.

User avatar
bosapara
Member
Posts: 637
Joined: Fri Apr 07, 2017 08:49

Re: [Mod] Maintained item_drop, key-triggered pickup [item_d

by bosapara » Post

How to setup it, if i need pickup only, not drop?
checked this, but doesnt work
local drop = minetest.settings:get_bool("enable_item_drop") ~= false

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] Maintained item_drop, key-triggered pickup [item_d

by texmex » Post

Sorry about that bug bosapara, I've committed a fix for it.

User avatar
Otter
Member
Posts: 152
Joined: Fri May 12, 2017 21:17
GitHub: InfiniteOtter
In-game: Otter

Re: [Mod] Maintained item_drop, key-triggered pickup [item_d

by Otter » Post

The option to delete instead of just drop might be nice for particular objects. Cobble and gravel both come to mind as targets for this.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] Maintained item_drop, key-triggered pickup [item_d

by texmex » Post

The bug that caused the mod to crash when dropping 0 items has been resolved, and the dev branch has been merged into master with all the good new stuff.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] Maintained item_drop, key-triggered pickup [item_d

by texmex » Post

Otter wrote:The option to delete instead of just drop might be nice for particular objects. Cobble and gravel both come to mind as targets for this.
I can look into it.

zasnool
Member
Posts: 14
Joined: Wed Oct 03, 2018 03:24

Re: [Mod] Item drops, pickups. Rewrite, new features [item_d

by zasnool » Post

Hello! I tried this mod to make blocks pickups like in mine clone 2, and this doesn't work quite as I would expect it to. Please explain the advanced settings to me. I also tried the other mod and it behaves closer to that in mine clone 2 game but the "dropped" blocks fly around to far and in random directions, it could jump five meters away from a player and you will have to go and get it anyway, because the magnet doesn't seem to work from that distance and you can't adjust it because the mod has no settings. So I looked to this mod, and the "magnet" doesn't work at all, the blocks just drop on the ground and you have to go and click on them manually to get them to your inventory. This is happening on default settings, as well ass when everything is disabled. I also tried to adjust pickup radius and magnet radius to up to 500 and nothings changed.
Does this mod requires something else for the magnet function to work? Or am I doing something wrong here?
Game version is 4.17 from minetest website.

Also, what does the number in the radius setting(for example pickup radius) mean? Is it how many blocks or meters away from player?

User avatar
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

by texmex » Post

Hi! The mod is key triggered by default and the key is the Use key (usually E).

zasnool
Member
Posts: 14
Joined: Wed Oct 03, 2018 03:24

Re: [Mod] Item drops, pickups. Rewrite, new features [item_d

by zasnool » Post

texmex wrote:Hi! The mod is key triggered by default and the key is the Use key (usually E).
Oh, thanks! Setting it to inverted worked well.
Another question rises. The items seem to fly towards the player a bit slow, I would even say very slow, and not in constant pattern, they move unevenly, in gusts(going fast some millimeters and then slowing down, almost stoping, and then moving again until they reach a player). From approximately two block away they can take up to 5 or more seconds to reach the player. It is not fps issue, fps is 60. I can guess that the movement speed is in some setting. I tried to set pickup radius to 1.75 and magnet radius to 2 so that the difference would be very small, and I would imagine that the difference is the distance that the items travel from their initial point to the point where they are being picked up. Sadly it didn't work.
I must also say that I am new to the minetest. If this cannot be fixed by the settings, maybe it can be tweaked in the lua file, just point me in that direction if it is so.

User avatar
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

by texmex » Post

I don't know why your problem arises. By adding only this setting…

Code: Select all

item_drop.magnet_radius = 5
… my pickups are smooth and fast.

zasnool
Member
Posts: 14
Joined: Wed Oct 03, 2018 03:24

Re: [Mod] Item drops, pickups. Rewrite, new features [item_d

by zasnool » Post

texmex wrote:I don't know why your problem arises. By adding only this setting…

Code: Select all

item_drop.magnet_radius = 5
… my pickups are smooth and fast.
Strange. Yes, that's what I want!

Here's what i get:
https://imgur.com/a/h0TlADe
All settings are default except the magnet radius.
Gif is 28mb

I want to add that in mineclone 2 it works well, hence I do not think it is the computer problem.

User avatar
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

by texmex » Post

That sure is laggy, I'm sorry.

Could your graphic settings have something to do with it? Do you run any other mods? What's your OS, Minetest version etc?

zasnool
Member
Posts: 14
Joined: Wed Oct 03, 2018 03:24

Re: [Mod] Item drops, pickups. Rewrite, new features [item_d

by zasnool » Post

My fps is 60 at all times, for the test above I disabled all the other mods and this is the default minetest_game. Version is 0.4.17.1 OS is windows 8.1 x64

User avatar
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

by texmex » Post

I've recreated the problem. I myself tried it on 0.4.16 and 0.5.0-dev. The problem is 0.4.17.1, possibly the whole 0.4.17 version. To my knowledge it's been a quite disastrous release. Since this seems like an engine bug, an issue has been filed here. (I've filed an issue on the mod's end too fwiw)

It's good that it's somehow fixed in 0.5.0-dev, so you should be good with one of these builds by core developer sfan5.
Last edited by texmex on Wed Oct 03, 2018 12:41, edited 1 time in total.

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests