Item Dropping

User avatar
VoidLord
Member
 
Posts: 46
Joined: Sun Jan 20, 2013 16:07

Item Dropping

by VoidLord » Fri Jul 05, 2013 23:30

What is the syntax to get an item to drop, 'cause I have a bomb that removes nodes and I want to know how to turn the nodes into items. Here's the code:

for x=-URANIUM_BOMB_RANGE,URANIUM_BOMB_RANGE do
for y=-URANIUM_BOMB_RANGE,URANIUM_BOMB_RANGE do
for z=-URANIUM_BOMB_RANGE,URANIUM_BOMB_RANGE do
if x*x+y*y+z*z <= URANIUM_BOMB_RANGE * URANIUM_BOMB_RANGE + URANIUM_BOMB_RANGE then
local np={x=pos.x+x,y=pos.y+y,z=pos.z+z}
local n = minetest.env:get_node(np)
if n.name ~= "air" then
-- I want to add the item drop here.
minetest.env:remove_node(np)
end
activate_if_tnt(n.name, np, pos, URANIUM_BOMB_RANGE)
end
end
end
end
</randomtextcrap>
</forumposthing>
</body>
</html>
/0
 

tinoesroho
Member
 
Posts: 570
Joined: Fri Feb 17, 2012 21:55

by tinoesroho » Sat Jul 06, 2013 23:34

Check the TNT mod by PilzAdam- it does have dropping code. /grin
We are what we create.

I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.

My github:
https://github.com/tinoesroho/
 


Return to Minetest Problems

Who is online

Users browsing this forum: No registered users and 2 guests

cron