[Mod] Item Drop [item_drop]

User avatar
jordan4ibanez
Member
Posts: 1895
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez
Location: Rhode Island, USA

[Mod] Item Drop [item_drop]

by jordan4ibanez » Post

This is a mod of pilzadam original item drop.

Features:
  • New function to direct item to player using moveto to stop glitching when lagging
  • Items which fell straight down now have a random trajectory
  • Delay for pickup, you can now walk away from an item when you throw it on the ground
  • Made player throw item farther and will throw using player's velocity
  • Uses a gui to show what and how much of the item's you've collected
Video

Github

Download


License: WTFPL

Code: Select all

            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
                    Version 2, December 2004

 Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>

 Everyone is permitted to copy and distribute verbatim or modified
 copies of this license document, and changing it is allowed as long
 as the name is changed.

            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. You just DO WHAT THE FUCK YOU WANT TO.
Last edited by jordan4ibanez on Mon Nov 21, 2016 00:30, edited 10 times in total.
I've been gone for a long time

MoNTE48
Member
Posts: 321
Joined: Sat Apr 06, 2013 11:58
GitHub: MoNTE48
In-game: MoNTE48
Location: Internet

Re: [Mod] Item Drop Reloaded [item_drop]

by MoNTE48 » Post

Wow, +1!!!

User avatar
jordan4ibanez
Member
Posts: 1895
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez
Location: Rhode Island, USA

Re: [Mod] Item Drop Reloaded [item_drop]

by jordan4ibanez » Post

Martin_Devil wrote:Wow, +1!!!
Thanks.

I updated it to use moveto to prevent lag from breaking item collection and player throws item farther.
I've been gone for a long time

MoNTE48
Member
Posts: 321
Joined: Sat Apr 06, 2013 11:58
GitHub: MoNTE48
In-game: MoNTE48
Location: Internet

Re: [Mod] Item Drop Reloaded [item_drop]

by MoNTE48 » Post

jordan4ibanez wrote:
Martin_Devil wrote:Wow, +1!!!
Thanks.

I updated it to use moveto to prevent lag from breaking item collection and player throws item farther.
Please use Github!
By the way, too many food particles, it is a bit annoying! :)
I added it to MultiCraft - Best Minecraft clone based Minetest!

User avatar
jordan4ibanez
Member
Posts: 1895
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez
Location: Rhode Island, USA

Re: [Mod] Item Drop Reloaded [item_drop]

by jordan4ibanez » Post

Martin_Devil wrote:
jordan4ibanez wrote:
Martin_Devil wrote:Wow, +1!!!
Thanks.

I updated it to use moveto to prevent lag from breaking item collection and player throws item farther.
Please use Github!
By the way, too many food particles, it is a bit annoying! :)
I added it to MultiCraft - Best Minecraft clone based Minetest!
You might want to download it again and readd it, I just fixed items falling down if server lags and items following players if they walk away from it and made it feel a little better

And that's awesome.
I've been gone for a long time

User avatar
Splizard
Member
Posts: 224
Joined: Wed Jan 25, 2012 07:20
GitHub: Splizard
IRC: Splizard
In-game: Splizard
Location: New Zealand
Contact:

Re: [Mod] Item Drop Reloaded [item_drop]

by Splizard » Post

Is it possible for the food particles to just be a similar colour to the food or a subset of the image?
Games: The Hungry Games Mods: Lifters (Simple Lifts), Snow Biomes and Gates. Also checkout my texture pack Gridtoon!

User avatar
mahmutelmas06
Member
Posts: 367
Joined: Mon Mar 02, 2015 13:10
GitHub: mahmutelmas06
IRC: mahmutelmas06
In-game: masum

Re: [Mod] Item Drop Reloaded [item_drop]

by mahmutelmas06 » Post

Code: Select all

2016-02-13 20:52:45: ERROR[Main]: ServerError: Runtime error from mod 'item_drop' in callback ScriptApiEnv::environment_Step(): D:\Oyun\Kurulan\Minetest\bin\..\mods\item_drop\init.lua:281: attempt to index local 'vel' (a nil value)
2016-02-13 20:52:45: ERROR[Main]: stack traceback:
2016-02-13 20:52:45: ERROR[Main]: 	D:\Oyun\Kurulan\Minetest\bin\..\mods\item_drop\init.lua:281: in function 'func'
2016-02-13 20:52:45: ERROR[Main]: 	D:\Oyun\Kurulan\Minetest\bin\..\builtin\game\misc.lua:18: in function 'update_timers'
2016-02-13 20:52:45: ERROR[Main]: 	D:\Oyun\Kurulan\Minetest\bin\..\builtin\game\misc.lua:50: in function 'toregister'
2016-02-13 20:52:45: ERROR[Main]: 	...n\Kurulan\Minetest\bin\..\builtin\game\mod_profiling.lua:154: in function <...n\Kurulan\Minetest\bin\..\builtin\game\mod_profiling.lua:150>
2016-02-13 20:52:45: ERROR[Main]: 	D:\Oyun\Kurulan\Minetest\bin\..\builtin\game\register.lua:361: in function <D:\Oyun\Kurulan\Minetest\bin\..\builtin\game\register.lua:341>
My Mods:

Beverage

User avatar
SaKeL
Member
Posts: 653
Joined: Tue Apr 14, 2015 18:39
GitHub: JurajVajda
IRC: SaKeL
In-game: SaKeL

Re: [Mod] Item Drop Reloaded [item_drop]

by SaKeL » Post

I really like the minetest way of getting the drop item straight the way to the inventory but it would be a nice addition to pick up dropped items what didn't got straight to inventory (i.e. by killing a sheep the wool and meet falls always on the ground) while holding shift. Would it be possible to collect the dropped items only while holding shift and for the rest as default going straight to inventory?

User avatar
cHyper
Member
Posts: 904
Joined: Fri May 06, 2011 08:49
GitHub: cHyper-0815OL
IRC: cHyper cHyper_de
In-game: cHyper cHyper_0815
Location: Austria
Contact:

Re: [Mod] Item Drop Reloaded [item_drop]

by cHyper » Post

+1 nice

blert2112
Member
Posts: 244
Joined: Sat Apr 25, 2015 04:05
GitHub: blert2112

Re: [Mod] Item Drop Reloaded [item_drop]

by blert2112 » Post

My daughter opened her mailbox and my server crashed with the following error...

Code: Select all

2016-02-17 18:09:26: ERROR[Main]: ServerError: Runtime error from mod 'item_drop' in callback environment_Step(): ...esktop\minetest\bin\..\games\mk4\mods\item_drop\init.lua:281: attempt to index local 'vel' (a nil value)
Changed line 280 from...

Code: Select all

local vel = self.object:getvelocity()
..to..

Code: Select all

local vel = self.object:getvelocity() or {x=0, y=0, z=0}
...fixed the problem.

User avatar
cy
Member
Posts: 59
Joined: Sun Jun 24, 2012 17:25

Re: [Mod] Item Drop Reloaded [item_drop]

by cy » Post

Did you see my fork of that item drop mod? I haven't tried this one you made out, but a few years ago I added to the PilzAdam one, preventing items from never expiring, and making items accelerate towards the player as they get close. It worked pretty good when I did it, but it's been a while, so I dunno if yours uses a better technique or not. Still, worth taking a look I hope. I did a lot of refactoring and cleanup too, to make it more readable.

DoyleChris
Member
Posts: 254
Joined: Sat Jul 25, 2015 19:54
In-game: DoyleChris

Re: [Mod] Item Drop Reloaded [item_drop]

by DoyleChris » Post

How do you make the items that you dig go right into your inventory.

User avatar
xeranas
Member
Posts: 162
Joined: Fri Feb 05, 2016 11:06

Re: [Mod] Item Drop Reloaded [item_drop]

by xeranas » Post

How eating food particles related with item drop? Maybe worth to split into separate mod?

User avatar
azekill_DIABLO
Member
Posts: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Item Drop Reloaded [item_drop]

by azekill_DIABLO » Post

+1000

User avatar
jordan4ibanez
Member
Posts: 1895
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez
Location: Rhode Island, USA

Re: [Mod] Item Drop [item_drop]

by jordan4ibanez » Post

I've updated the mod.
  • It's a little faster, tried to optimize as much as I could
  • Has a gui that shows you the items you've collected
  • Uses your velocity when throwing items
Here's a video https://youtu.be/iEbl417sgdM
I've been gone for a long time

MoNTE48
Member
Posts: 321
Joined: Sat Apr 06, 2013 11:58
GitHub: MoNTE48
In-game: MoNTE48
Location: Internet

Re: [Mod] Item Drop [item_drop]

by MoNTE48 » Post

jordan4ibanez wrote:I've updated the mod.
  • It's a little faster, tried to optimize as much as I could
  • Has a gui that shows you the items you've collected
  • Uses your velocity when throwing items
Here's a video https://youtu.be/iEbl417sgdM
Thank you! +1

User avatar
jordan4ibanez
Member
Posts: 1895
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez
Location: Rhode Island, USA

Re: [Mod] Item Drop [item_drop]

by jordan4ibanez » Post

I've updated it to work with mods that use the drop item function, mainly VanessaE's pipeworks mod. The changes throw items further from dispensers and so forth.
I've been gone for a long time

User avatar
mahmutelmas06
Member
Posts: 367
Joined: Mon Mar 02, 2015 13:10
GitHub: mahmutelmas06
IRC: mahmutelmas06
In-game: masum

Re: [Mod] Item Drop [item_drop]

by mahmutelmas06 » Post

Seems you have deleted food particles. Could you release it as a seperate mod ?
My Mods:

Beverage

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

Re: [Mod] Item Drop [item_drop]

by texmex » Post

I like this mod! It's very snappy.

By glancing the code it looks like you're checking for sneaking key. Not knowing code that well I'm assuming it's for being able to drop a single item out of an item stack. Can't get that to work however, it throws the whole stack regardless of sneak key being pressed or not.

Coming from Minetest_TNG I'm kinda used to pressing the use key (E) to trigger the pickup function. What would you think of adding such feature to your mod?
Last edited by texmex on Fri Feb 10, 2017 00:25, edited 4 times in total.
Mods | Support Mesehub: bc1qluuests9rxmlnvpjrhsnyjg9ucwy6z3r0y3srw

User avatar
GreenXenith
Member
Posts: 1329
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
IRC: GreenXenith
In-game: GreenXenith
Location: The singularity
Contact:

Re: [Mod] Item Drop [item_drop]

by GreenXenith » Post

Welp, I want to try this, but if I enable it, Minetest disables it for me. Why?
Y▹uTube | Mods | Patre●n | Twitter | Minetest Discord | GreenXenith#3232

Hey, you. You're finally awake.
You were trying to view their profile, right? Found the rest of their signature, same as us, and that guest over there.

User avatar
burli
Member
Posts: 1643
Joined: Fri Apr 10, 2015 13:18

Re: [Mod] Item Drop [item_drop]

by burli » Post

GreenDimond wrote:Welp, I want to try this, but if I enable it, Minetest disables it for me. Why?
Maybe you need to exit Minetest completely and then edit the setting. If you edit Minetest.conf while Minetest is running (even in main menu) any change will be overwritten

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

Re: [Mod] Item Drop [item_drop]

by texmex » Post

texmex wrote:Coming from Minetest_TNG I'm kinda used to pressing the use key (E) to trigger the pickup function. What would you think of adding such feature to your mod?
I managed to do it myself, here. :D
Last edited by texmex on Thu May 04, 2017 07:15, edited 1 time in total.
Mods | Support Mesehub: bc1qluuests9rxmlnvpjrhsnyjg9ucwy6z3r0y3srw

Cage
Member
Posts: 72
Joined: Mon Oct 24, 2016 21:07

Re: [Mod] Item Drop [item_drop]

by Cage » Post

Can anyone tell me the right way to install this mod so that it works. I installed it per the readme and a few other ways. While it is activated it doesn't seem to work. Thanks in advance.

User avatar
burli
Member
Posts: 1643
Joined: Fri Apr 10, 2015 13:18

Re: [Mod] Item Drop [item_drop]

by burli » Post

Cage wrote:Can anyone tell me the right way to install this mod so that it works. I installed it per the readme and a few other ways. While it is activated it doesn't seem to work. Thanks in advance.
Are you in creative mode? Items don't drop in creative mode

User avatar
Linuxdirk
Member
Posts: 2662
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Item Drop [item_drop]

by Linuxdirk » Post

Sometimes items dropping right in front of me (for example when harvesting a tree) just float a little towards me and then disappear without the item being added to my inventory and without the little "plopp" sound :(

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests