Don wrote:Are you trying to do it when the map loads or could you use an abm or lbm to make it place?
I use registre_on_generated but the não not work.
Don wrote:Are you trying to do it when the map loads or could you use an abm or lbm to make it place?
minetest.register_on_generated(function(minp, maxp, seed)
--[[
places a special tree that I created. (near jungles)
]]
-- verifies that this is the desired ground track
if maxp.y < 10 then return end
if minp.y > 90 then return end
-- lead map in memory (is this necessary?)
minetest.get_voxel_manip():read_from_map(minp, mapx)
-- search jungletree
if minetest.find_node_near({x=minp.x+40, y=minp.y+40, z=minp.y+40}, 40, {"default:jungletree"}) == nil then
minetest.chat_send_all(dump(minetest.get_node({x=minp.x+40, y=minp.y+40, z=minp.y+40})))
return
end
-- picks up a block of dirt with grass
local pos = minetest.find_node_near({x=minp.x+40, y=minp.y+40, z=minp.y+40}, 40, {"default:dirt_with_grass"})
if pos == nil then return end
-- tree
sovagxas.montar_arvore(pos)
minetest.chat_send_all("My tree mounted")
end)
minetest.chat_send_all(dump(minetest.get_node({x=minp.x+40, y=minp.y+40, z=minp.y+40})))local verify_area = function(minp, maxp)
-- load blocks
minetest.get_voxel_manip():read_from_map({x=minp.x+40, y=minp.y+40, z=minp.y+40}, {x=minp.x+40, y=minp.y+40, z=minp.y+40})
-- verify
minetest.chat_send_all(dump(minetest.get_node({x=minp.x+40, y=minp.y+40, z=minp.y+40})))
end
minetest.register_on_generated(function(minp, maxp, seed)
if maxp.y < 10 then return end
if minp.y > 90 then return end
minetest.after(4, verify_area, minp, maxp)
end)
local verify_area = function(minp, maxp)
-- load blocks
local lp = vector.add(minp, 40)
minetest.get_voxel_manip():read_from_map(lp, lp)
-- verify
minetest.chat_send_all(dump(minetest.get_node(lp)))
end
minetest.register_on_generated(function(minp, maxp, seed)
if maxp.y < 10 then return end
if minp.y > 90 then return end
minetest.after(4, verify_area, minp, maxp)
end)
thegreatone wrote:just a quick, kinda doppie question.
I have a mod which just adds some new building blocks, do I need to submit it somewhere before I can post it up for others to download? Or is it just a free-for-all sort of deal?
TumeniNodes wrote:I notice that the http://unlicense.org/ is not mentioned in the guidelines section. Is there any opposition to my using it? I want to make sure so as not to create any problems.
TumeniNodes wrote: I have also always used CC share alike non-commercial for artwork/images I create. Is this an issue here? I only ask as this too is not mentioned.
celeron55 wrote:Disallowed licenses
Any mod that disallows derivatives cannot be published on this forum. These include CC NoDerivs and pretty much any closed source licenses.
More about licenses
If a mod is to be included in the main game, it's code needs to be relicensable under LGPLv2.1+, and textures/sounds under CC BY-SA 3.0 Unported, as the main game is released under those licenses. ...
... Public domain is not allowed as a license because jurisdiction about what "public domain" means varies between countries.
TumeniNodes wrote:I see where I got confused now, reading it again...
The section which mentions: "If a mod is to be included in the main game, it's code needs to be relicensable under LGPLv2.1+, and textures/sounds under CC BY-SA 3.0 Unported, as the main game is released under those licenses."
for some reason I did not notice the part about if the mod is to be included in the main game. My bad, I'm sorry.
I have not been ontop of my game lately and have been misreading and misunderstanding things.
minetest.register_alias("wood", "default:wood")DontTouchTheClock wrote:With minetest.register_alias() you can add another name for a block:
For example "default:wood" is also known as "wood". This is handy in the world-edit commands and the /give command. to do this in a mod you would do: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
minetest.register_alias("wood", "default:wood")
minetest.register_alias("candy:sugar", "mtfoods:sugar")minetest.register_alias("mtfoods:sugar", "candy:sugar")if minetest.get_modpath("mtfood") then
minetest.override_item("mtfood:sugar", {
groups = { food_sugar = 1 }
})
else
minetest.register_craftitem("candy:sugar", {
---
groups = { food_sugar = 1 }
---
})
minetest.register_craft({
output = "candy:sugar",
recipe = {}
})
end
minetest.register_craft({
output = "candy:bar",
recipe = {
{"group:food_sugar"}
}
})
food.support("sugar", {
"jkfarming:sugar",
"bushes:sugar",
"mtfoods:sugar"
})
food.module("sugar", function()
minetest.register_craftitem("food:sugar", {
description = "Sugar",
inventory_image = "food_sugar.png",
groups = {food_sugar=1}
})
minetest.register_craft({
output = "food:sugar 20",
recipe = {
{"default:papyrus"},
}
})
end, true)
food.module("cake_carrot", function()
minetest.register_node(":food:cake_carrot", {
description = S("Carrot Cake"),
on_use = food.item_eat(4),
groups={food=3,crumbly=3},
walkable = false,
sunlight_propagates = true,
tiles = {
"food_cake_carrot_texture.png",
"food_cake_carrot_texture.png",
"food_cake_carrot_texture_side.png",
"food_cake_carrot_texture_side.png",
"food_cake_carrot_texture_side.png",
"food_cake_carrot_texture_side.png"
},
drawtype="nodebox",
paramtype = "light",
node_box = food.cake_box
})
food.craft({
type = "cooking",
output = "food:cake_carrot",
recipe = "food:cakemix_carrot",
cooktime = 10,
})
minetest.register_craftitem(":food:cakemix_carrot",{
description = S("Carrot Cake Mix"),
inventory_image = "food_cakemix_carrot.png",
})
food.craft({
output = "food:cakemix_carrot",
recipe = {
{"","group:food_carrot",""},
{"group:food_flour","group:food_sugar","group:food_egg"},
}
})
end)
bobomb wrote:oh yeah of course. that all works now. where is this documented? the new lua api txt file doesn't mention this...
The form
functioncall ::= prefixexp `:´ Name args
can be used to call "methods". A call v:name(args) is syntactic sugar for v.name(v,args), except that v is evaluated only once.
Users browsing this forum: Bing [Bot] and 4 guests