Comp52 wrote:1:what is "full_punch_interval" and what does it do?
Comp52 wrote:2:what is "max_drop_level" and what does it do?
Comp52 wrote:3:what do "uses" and "max level" do?
Comp52 wrote:4:there is no question number four, but everyone asks 3 questions so I wanted a fourth. :)
Comp52 wrote:That definitely helps a lot; thanks, PilzAdam!
Another question; is there a way to find out the level of a node(like the level of dirt, tree, stone, etc)? is there a list of that somewhere?
minetest.registered_nodes["default:dirt"].groups.levelminetest.get_item_group("default:dirt", "level")on_use = minetest.env:set_node(special:myblock})
end
self.object:remove()
endwcwyes wrote:how do i get a tool to place a node then disappear?
on_place = function(itemstack, placer, pointed_thing)
local pt = pointed_thing
minetest.set_node({x=pt.under.x, y=pt.under.y+1, z=pt.under.z}, {name="special:myblock"})
itemstack:take_item()
return itemstack
end,
PilzAdam wrote:42
PilzAdam wrote:Comp52 wrote:4:there is no question number four, but everyone asks 3 questions so I wanted a fourth. :)
42
Mossmanikin wrote:wcwyes wrote:how do i get a tool to place a node then disappear?
I'd do it 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
on_place = function(itemstack, placer, pointed_thing)
local pt = pointed_thing
minetest.set_node({x=pt.under.x, y=pt.under.y+1, z=pt.under.z}, {name="special:myblock"})
itemstack:take_item()
return itemstack
end,
wcwyes wrote:is there a way I can hide my node from the recipe guide in unified inventory?
on_use = function(itemstack, user, pointed_thing)
-- pointed_thing.under is the object itself, can be nil.
-- pointed_thing.above is the object above the pointed thing, can be nil.
-- pointed_thing.type is nil if nothing is there, node if it is a node and
-- object if it is an object.
if pointed_thing.under then
local dir = pointed_thing.under.param2
-- Whatever you want to happen here.
end
end,
LionsDen wrote:When the tool is used, I think that below will work. If not exactly then something close. I haven't tested this code but I did adapt it from some code that I wrote that did something a little different. Because I haven't tested it, you might want to.
This goes into the node definition code.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
on_use = function(itemstack, user, pointed_thing)
-- pointed_thing.under is the object itself, can be nil.
-- pointed_thing.above is the object above the pointed thing, can be nil.
-- pointed_thing.type is nil if nothing is there, node if it is a node and
-- object if it is an object.
if pointed_thing.under then
local dir = pointed_thing.under.param2
-- Whatever you want to happen here.
end
end,
wcwyes wrote:not exactly sure of the argument that facedir is doing in paramtype2 to be able to fill in the blanks
sorry I'm kind of new at lua
LionsDen wrote:wcwyes wrote:not exactly sure of the argument that facedir is doing in paramtype2 to be able to fill in the blanks
sorry I'm kind of new at lua
The param2 is the node's facedir. So whatever you want to do with it is what you must do. Since I have no idea what you meant by applying it to the tool I can't really help any further than that.
LionsDen wrote:Did you make sure that you used a node type that uses the param2 as a facedir? If you look at the docs, it shouldn't be too hard to figure out what ones you can use.
wcwyes wrote:Yes my node does use facedir and it works on the node, I just need it to work when the tool places the node
I'm sure I could figure it out if I looked at the screwdriver mod but when I downloaded it and installed it I got an eof error.
I would rather be looking at working files.
....docs???
PilzAdam wrote:
This link is outdated, use https://github.com/minetest/minetest/blob/master/doc/lua_api.txt.
wcwyes wrote:this was quite useful in where I'm trying to go with this mod but doesn't seem to help with the specific question I asked.
LionsDen wrote:wcwyes wrote:this was quite useful in where I'm trying to go with this mod but doesn't seem to help with the specific question I asked.
Did you see where I mentioned that the screwdriver mod was a part of the minetest_game now. And also the part where I mentioned that Technic has a Sonic Screwdriver in it. Since I don't know where you want to go with this mod that is all the help I can give because you mentioned that you wanted to look at the code for the screwdriver.
wcwyes wrote:LionsDen wrote:wcwyes wrote:this was quite useful in where I'm trying to go with this mod but doesn't seem to help with the specific question I asked.
Did you see where I mentioned that the screwdriver mod was a part of the minetest_game now. And also the part where I mentioned that Technic has a Sonic Screwdriver in it. Since I don't know where you want to go with this mod that is all the help I can give because you mentioned that you wanted to look at the code for the screwdriver.
I've been looking at the screwdriver for it's rotating function ability I want to emulate it with different functions. It's a little harder than expected but I'm slowly progressing.
Users browsing this forum: Bing [Bot] and 10 guests