[Mod] Minecraft like item drop/pick up [item_drop]

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sat Aug 11, 2012 22:02

SegFault22 wrote:why limit stacks to 64? That's too Minecraft-like and slow.

Its because its a mod from my game MiniTest wich copies Minecraft like features. I will change it in this mod.
 

kozec
New member
 
Posts: 3
Joined: Fri Aug 10, 2012 16:34

by kozec » Thu Aug 16, 2012 11:35

Hi! My server sometimes crashes with this message:

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
13:31:34: ERROR[main]: ServerError: LuaError: error: .../.minetest/mods/minetest/item_drop/init.lua:92: attempt to index a nil value


I added check for item and item:get_luaentity() nil values, but I'm not sure if it's not part of some bigger bug, so it may be good idea to report it.
 

cornernote
Member
 
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Thu Aug 16, 2012 18:35

had a bug at line 34 where item was nil... line 34 is:
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
local item = minetest.env:add_item(pos, oldnode)


added this below it
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 item ~= nil then
... do the stuff you had
end
 

cornernote
Member
 
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Sun Aug 19, 2012 05:31

I had another bug where anzahl was not a number. It was caused when digging moreores tin. The problem is the node name that drops looks like this:
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
craft "mod:item" 1


Here is the fix:
find:
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 string.find(oldnode.name, " ") ~= nil then

below, insert:
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
oldnode.name = oldnode.name:gsub('"',""):gsub("craft ",""):gsub("item ",""):gsub("node ","")



EDIT, changed the code
Last edited by cornernote on Sun Aug 19, 2012 07:54, edited 1 time in total.
 

User avatar
cHyper
Member
 
Posts: 587
Joined: Fri May 06, 2011 08:49
IRC: cHyper
In-game: cHyper

by cHyper » Sun Aug 26, 2012 12:23

where is the next update please ....... ;)
--------------------------------------------------------
 

leo_rockway
Member
 
Posts: 131
Joined: Tue Jul 31, 2012 20:37

by leo_rockway » Sun Aug 26, 2012 22:10

I saw in the minitest thread that you were asking for a better sound for this. How about this one? http://opengameart.org/content/cork
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sun Aug 26, 2012 22:30

leo_rockway wrote:I saw in the minitest thread that you were asking for a better sound for this. How about this one? http://opengameart.org/content/cork

License? WTFPL would be best.
 

leo_rockway
Member
 
Posts: 131
Joined: Tue Jul 31, 2012 20:37

by leo_rockway » Sun Aug 26, 2012 23:03

PilzAdam wrote:
leo_rockway wrote:I saw in the minitest thread that you were asking for a better sound for this. How about this one? http://opengameart.org/content/cork

License? WTFPL would be best.


CC-BY 3.0. I didn't upload it, I was just looking for existing sounds on OGA.
I have modified the pitch with Audacity and created a few of these. So when I pick up items it goes POP pop PoP poP! o.o
Last edited by leo_rockway on Sun Aug 26, 2012 23:04, edited 1 time in total.
 

User avatar
Melkor
Member
 
Posts: 285
Joined: Sat Sep 24, 2011 01:03

by Melkor » Mon Aug 27, 2012 18:29

I've been testing this mod and looks great, but I would like to comment on a few things:
1. Some items such as coal exceed the maximum limit of 64 to 99.
2. how nodes are attracted by the played makes this too easy, it's like wearing a magnet, gravity is the one who has to win! The player should have to walk over the item to pick up it.
3. if you put a node over an dropped item, it stays there, inside of the node, what should happen is that the item must look for the nearest air node to pop up.
(damn you google translator!)
 

cornernote
Member
 
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Tue Aug 28, 2012 00:32

Melkor wrote:I've been testing this mod and looks great, but I would like to comment on a few things:
3. if you put a node over an dropped item, it stays there, inside of the node, what should happen is that the item must look for the nearest air node to pop up.
(damn you google translator!)


I think lava should destroy it. Perhaps placing any block will destroy it? What does MC do?
 

leo_rockway
Member
 
Posts: 131
Joined: Tue Jul 31, 2012 20:37

by leo_rockway » Tue Aug 28, 2012 02:23

cornernote wrote:
Melkor wrote:I've been testing this mod and looks great, but I would like to comment on a few things:
3. if you put a node over an dropped item, it stays there, inside of the node, what should happen is that the item must look for the nearest air node to pop up.
(damn you google translator!)


I think lava should destroy it. Perhaps placing any block will destroy it? What does MC do?


MC moves them to the nearest air node, like Melkor said.
 

User avatar
Melkor
Member
 
Posts: 285
Joined: Sat Sep 24, 2011 01:03

by Melkor » Tue Aug 28, 2012 11:17

well, that could be the 4th point: Lava should destroy everything what falls on it
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sat Sep 01, 2012 01:54

I made a complete rewrite of the code. See GitHub: https://github.com/PilzAdam/item_drop
 

cornernote
Member
 
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Sat Sep 01, 2012 07:00

anything functionally different? or just a different way of writing the code?
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sat Sep 01, 2012 10:32

cornernote wrote:anything functionally different? or just a different way of writing the code?

The functionallity is the same but some (nearly all) bugs are fixed e.g. my farming mod now drops everything correctly.
 

Josh
Member
 
Posts: 1146
Joined: Fri Jun 29, 2012 23:11

by Josh » Fri Sep 07, 2012 04:36

This should be added in by default. Or are you guys happy with the goes straight into your inventory thing?
 

User avatar
Echo
Member
 
Posts: 121
Joined: Tue Jul 31, 2012 08:11

by Echo » Fri Sep 07, 2012 08:38

In 0.4.3 there's a new function:
minetest.handle_node_drops(pos, drops, digger)

It could be used to optimize your mod.
I think celeron added this because of the popularity of your mod :-)
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Fri Sep 07, 2012 12:37

Echo wrote:In 0.4.3 there's a new function:
minetest.handle_node_drops(pos, drops, digger)

It could be used to optimize your mod.
I think celeron added this because of the popularity of your mod :-)

c55 added this because we were talking about improvement of my code. It is already in latest GitHub.
 

User avatar
Echo
Member
 
Posts: 121
Joined: Tue Jul 31, 2012 08:11

by Echo » Fri Sep 07, 2012 13:32

PilzAdam Image
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Fri Sep 07, 2012 13:35

Echo wrote:PilzAdam Image

:-D
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Mon Sep 17, 2012 17:21

New sounds added.
 

User avatar
RAPHAEL
Member
 
Posts: 627
Joined: Tue Nov 01, 2011 09:09

by RAPHAEL » Wed Dec 19, 2012 09:21

So how does one remove this mod? I tried deleting mod folder and restarting server (many times since removal of folder) and item drop still happens.
"Before you speak, ask yourself: Is it kind, is it true, is it necessary, does it improve upon the silence?"
My mods: http://goo.gl/n4kpn
(Currently Various, Industrial, Fakeblocks, Jail, MoarCraft, Christmas, Replicator, minetest dev installer for linux, bash mod installer, windows mod installer)
 

Vincentius_Maximus
Member
 
Posts: 14
Joined: Mon Nov 05, 2012 13:52

by Vincentius_Maximus » Thu Dec 20, 2012 03:05

Did you make the sounds from scratch?
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Thu Dec 20, 2012 16:31

Vincentius_Maximus wrote:Did you make the sounds from scratch?

No, they are from the blockplanet alias Minetest++ fork.
 

restcoser
New member
 
Posts: 1
Joined: Wed Apr 10, 2013 14:48

by restcoser » Wed Apr 10, 2013 14:49

I changed the mod for me to have a gain of 0.4, seems much better, could it be modified in the original as well?
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Wed Apr 10, 2013 14:53

restcoser wrote:I changed the mod for me to have a gain of 0.4, seems much better, could it be modified in the original as well?

Done: https://github.com/PilzAdam/item_drop/commit/d59ec6005808cf1d35c14f428fb5d0e8c999e255
 

User avatar
Mito551
Member
 
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Wed Apr 10, 2013 16:01

excuse me, what part of code does the dig-drop part and what part does the pickup part?
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Wed Apr 10, 2013 16:12

Mito551 wrote:excuse me, what part of code does the dig-drop part and what part does the pickup part?

The globalstep function handles the pickup and the handle_node_drops() function does the drop.
Last edited by PilzAdam on Wed Apr 10, 2013 16:13, edited 1 time in total.
 

User avatar
Mito551
Member
 
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Wed Apr 10, 2013 16:16

PilzAdam wrote:
Mito551 wrote:excuse me, what part of code does the dig-drop part and what part does the pickup part?

The globalstep function handles the pickup and the handle_node_drops() function does the drop.


thank you! so that means if i comment out the handle_node_drops() function, i will be picking up stuff which is on the floor already, but getting it directly in my inventory if i dig a node?
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Wed Apr 10, 2013 18:24

Mito551 wrote:
PilzAdam wrote:
Mito551 wrote:excuse me, what part of code does the dig-drop part and what part does the pickup part?

The globalstep function handles the pickup and the handle_node_drops() function does the drop.


thank you! so that means if i comment out the handle_node_drops() function, i will be picking up stuff which is on the floor already, but getting it directly in my inventory if i dig a node?

Yes.
 

PreviousNext

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 42 guests

cron