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

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

by Splizard » Post

With activating mesecon pistons this error occurs:

Code: Select all

minetest/item_drop/init.lua:31: attempt to index a nil value
Games: Builda City, The Hungry Games Mods: Lifters, Snow Biomes and Gates. Also checkout my texture pack Gridtoon!

Spots
Member
Posts: 124
Joined: Tue Jul 24, 2012 12:12
Location: Outta my mind someplace.

by Spots » Post

minetest-0.4.1-win32 , Windows 7 ,item_drop v3
Last edited by Spots on Mon Aug 06, 2012 00:21, edited 1 time in total.

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

by leo_rockway » Post

In moreores' init.lua line 60, the drop has an additional "craft" in front of the name of the drop, which confuses your mod.
I believe that your mod is acting correctly, so I changed that line in moreores to this:

Code: Select all

drop = item_base..'_lump 1'
It seems to work fine now.
Try Skyblock for MineClone 2
Listen to this sound and music pack!

User avatar
SegFault22
Member
Posts: 872
Joined: Mon May 21, 2012 03:17
Location: NaN

by SegFault22 » Post

why limit stacks to 64? That's too Minecraft-like and slow.
"All we need it the right major crisis and the nations will accept the new world order."

u34

by u34 » Post

works fine with latest minecraft version (0.4.2) ... awesome ...

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

by PilzAdam » Post

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 » Post

Hi! My server sometimes crashes with this message:

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 » Post

had a bug at line 34 where item was nil... line 34 is:

Code: Select all

local item = minetest.env:add_item(pos, oldnode)
added this below it

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 » Post

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:

Code: Select all

craft "mod:item" 1

Here is the fix:
find:

Code: Select all

if string.find(oldnode.name, " ") ~= nil then
below, insert:

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.

u34

by u34 » Post

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

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

by leo_rockway » Post

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
Try Skyblock for MineClone 2
Listen to this sound and music pack!

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

by PilzAdam » Post

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: 211
Joined: Tue Jul 31, 2012 20:37

by leo_rockway » Post

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.
Try Skyblock for MineClone 2
Listen to this sound and music pack!

User avatar
Melkor
Member
Posts: 378
Joined: Sat Sep 24, 2011 01:03
Location: Underground

by Melkor » Post

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 » Post

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: 211
Joined: Tue Jul 31, 2012 20:37

by leo_rockway » Post

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.
Try Skyblock for MineClone 2
Listen to this sound and music pack!

User avatar
Melkor
Member
Posts: 378
Joined: Sat Sep 24, 2011 01:03
Location: Underground

by Melkor » Post

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
Location: Germany

by PilzAdam » Post

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 » Post

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
Location: Germany

by PilzAdam » Post

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
Location: Victoria, Australia

by Josh » Post

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: 122
Joined: Tue Jul 31, 2012 08:11
Location: Germany

by Echo » Post

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
Location: Germany

by PilzAdam » Post

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: 122
Joined: Tue Jul 31, 2012 08:11
Location: Germany

by Echo » Post

PilzAdam Image

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

by PilzAdam » Post

Echo wrote:PilzAdam Image
:-D

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 69 guests