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

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

by Splizard » Sun Aug 05, 2012 22:14

With activating mesecon pistons this error occurs:
Code: Select all
minetest/item_drop/init.lua:31: attempt to index a nil value
Games: The Hungry Games Mods: Lifters (Simple Lifts), 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 » Mon Aug 06, 2012 00:21

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

by leo_rockway » Tue Aug 07, 2012 02:28

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: 870
Joined: Mon May 21, 2012 03:17
Location: NaN

by SegFault22 » Sat Aug 11, 2012 19:19

why limit stacks to 64? That's too Minecraft-like and slow.
Resources are abundant; only money is scarce. People should not have to work hard and remain poor just to pay for the needs of survival.
Society can thrive without money - but only if productive members of society are rewarded for being productive.
 

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

by cHyper » Sat Aug 11, 2012 20:20

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

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
Location: Germany
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:

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:
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 » 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:
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.
 

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

by cHyper » Sun Aug 26, 2012 12:23

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

leo_rockway
Member
 
Posts: 196
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
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
Location: Germany
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: 196
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.
Try Skyblock for MineClone 2
Listen to this sound and music pack!
 

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

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

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

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
Location: Germany
GitHub: PilzAdam
IRC: PilzAdam
 

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

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

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

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

PreviousNext

Return to Mod Releases



Who is online

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