philipbenr wrote:Okay. If you want everyone to be able to use, edit and distribute the mod, then use GPLv3. If you want any other license, you might try LGPL or some other one. CC licenses aren't really for code...
Yes!
Get to work!
:D
philipbenr wrote:Okay. If you want everyone to be able to use, edit and distribute the mod, then use GPLv3. If you want any other license, you might try LGPL or some other one. CC licenses aren't really for code...

minetest.register_craftitem("morestuff:apple_soda", {
description = "Apple Soda",
inventory_image = "apple_soda.png",
on_use = minetest.item_eat(3),
replacements = { {"morestuff:apple_soda", "vessels:glass_bottle"} },
})Nightshade wrote:Ok, so I'm putting together a mod for personal use, and I added a food item. But on use of this food item, I want part of it to return back to the inventory (it's soda, I want an empty bottle back). I have no coding experience, so I'm just going on what I see in minetest_game mods and other mods. I have 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
minetest.register_craftitem("morestuff:apple_soda", {
description = "Apple Soda",
inventory_image = "apple_soda.png",
on_use = minetest.item_eat(3),
replacements = { {"morestuff:apple_soda", "vessels:glass_bottle"} },
})
Can someone tell me where I'm going wrong?
... replacements = { { ...-- Food recipes!
minetest.register_craftitem("moretrees:coconut_milk", {
description = "Coconut Milk",
inventory_image = "moretrees_coconut_milk_inv.png",
wield_image = "moretrees_coconut_milk.png",
on_use = minetest.item_eat(2),
})on_use = function(itemstack, user, pointed_thing)
-- Dig if pointed on node
if pointed_thing.type == "node" then
return
end
minetest.item_eat(3)
return ItemStack({name = "vessels:glass_bottle"})
end,Krock wrote:EDIT:
you could do it like the bucket mod: (modifed)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)
-- Dig if pointed on node
if pointed_thing.type == "node" then
return
end
minetest.item_eat(3)
return ItemStack({name = "vessels:glass_bottle"})
end,
Krock wrote:Topic: Are things like this here possible? (A scrollbar in chests)
http://i.imgur.com/ohpm62H.png
Reason: Mods
More Info: Could be interesting to work with that
Nightshade wrote:This worked perfectly, thanks!
LionsDen wrote:To do something like that I would suggest you study the code for unified inventory which is part of the [unified infentory mod]
Nightshade wrote:This worked perfectly, thanks!
minetest.register_craftitem("morestuff:apple_soda", {
description = "Apple Soda",
inventory_image = "apple_soda.png",
stack_max = 1,
on_use = minetest.item_eat(4),
on_use = function(itemstack, user, pointed_thing)
-- Dig if pointed on node
if pointed_thing.type == "node" then
return
end
minetest.item_eat(4)
return ItemStack({name = "vessels:glass_bottle"})
end,
})function get_prochest_formspec(number) -- returns string with formspec:
"invsize[12,10;]"..
"label[0,0;ProChest]"..
"label[1,0.5;Your grid:]"..
"list[current_name;cust_ow;1,1;2,2;]"..
"button[3,1.5;2,1;exchange;Exchange]"..
"label[6,3;You get:]"..
"list[current_name;cust_og;6,3.5;2,2;]"..
"list[current_player;main;2,6;8,4;]")
on_rightclick = function(pos, node, clicker, itemstack)
local meta = minetest.env:get_meta(pos)
if clicker:get_player_name() == meta:get_string("owner") then
minetest.show_formspec(clicker:get_player_name(),"testing:prochest_formspec",get_prochest_formspec(1))
else
minetest.show_formspec(clicker:get_player_name(),"testing:prochest_formspec",get_prochest_formspec(1))
end
end, meta:set_string("formspec",
"size[8,9]"..
"textarea[0,0;8,8;Texto;Aventura de Minerador (O Troféu);Para conseguir o troféu de minerador você deverá encontrar o livro de receiras 'Corpo de Troféo' e 'Base de Troféu', depois faça os itens e unaos para obter o belo troféu]"
)
return formspecbrunob.santos wrote:I do not know how to skip lines.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
meta:set_string("formspec",
"size[8,9]"..
"textarea[0,0;8,8;Texto;Book of bla;Bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla]"
)
return formspec
brunob.santos wrote:brunob.santos wrote:I do not know how to skip lines.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
meta:set_string("formspec",
"size[8,9]"..
"textarea[0,0;8,8;Texto;Book of bla;Bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla]"
)
return formspec
HELP!
:(
meta:set_string("formspec",
"size[8,9]"..
"textarea[0,0;8,8;Texto;Book of bla;Bla bla bla bla bla bla bla bla bla bla"..
" bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla"..
" bla bla bla bla bla bla bla]"
)
return formspecPilzAdam wrote: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
meta:set_string("formspec",
"size[8,9]"..
"textarea[0,0;8,8;Texto;Book of bla;Bla bla bla bla bla bla bla bla bla bla"..
" bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla"..
" bla bla bla bla bla bla bla]"
)
return formspec
[/spoiler]brunob.santos wrote:PilzAdam wrote: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
meta:set_string("formspec",
"size[8,9]"..
"textarea[0,0;8,8;Texto;Book of bla;Bla bla bla bla bla bla bla bla bla bla"..
" bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla"..
" bla bla bla bla bla bla bla]"
)
return formspec
Does not work!
[spoiler]http://img823.imageshack.us/img823/7295/5g4u.png[/spoiler]
minetest.register_tool("player_radar:radar_hud",{
description="radar hud",
inventory_image = ("portable_receiver.png"),
tool_capabilities = {
groupcaps={
snappy = {times={[2]=0.95}, uses=20, maxlevel=1},
--fleshy = {times={[3]=1.6}, uses=10, maxlevel=1}
}
},
on_use=function(itemstack,user)
player_radar_hud[user:get_player_name()] = user:hud_add({
hud_elem_type = "image",
position = {x=0.5,y=0.5},
scale = {x=0.1, y=0.1},
text = "radar13cmp2.png",
number = 1,
alignment = {x=0,y=0},
offset = {
x = 0;
y = 0;
},
})
end,
on_place=function(itemstack,placer)
placer:hud_change(player_radar_hud[placer:get_player_name()],"position",{x=0.1,y=0.1})
print(dump(placer:hud_get(player_radar_hud[placer:get_player_name()])))
end,
})
kaeza wrote:Pandaro: seems like a typo in the Lua HUD. I have submitted a patch for it.
For now, you can use "pos" instead of "position".
player_bubbles[name] = player:hud_add({
hud_elem_type = "statbar",
text = "bubble.png",
number = 20,
direction = 1,
position = {x=0.5,y=0.9},
offset = {x=0, y=19},
})
couldn't I make a .js file to use theplayer profile to automatically log the player into the new server?Casimir wrote:Depending on what you want, there are two things I can think of. Both would be possible in Lua.
1. With some portal thing when entered the player file is copied to the second world, in one file there is saved that the player left the world. Then the player is kicked out of the server and can not connect until the "player is not in this world" file is changed from an other world. You would have to manually connect to the new server.
2. A shared build area. When ever a node is altered in the defined area, it is saved in a worldedit file and sent to the second server/world together with a timestamp and then loaded into the second world.
//for the 3D-coords
struct Position {
public int x, y, z;
}
//node
struct Node {
public int param2;
}
//nplayer
class Player {
//just pointing to the existence of this
}
//now the codes
void testing(Position pos, Node node, Player player) {
for(int x = pos.x - 1, x <= pos.x + 1, x++) {
for(int y = pos.y - 1, y <= pos.y + 1, y++) {
for(int z = pos.z - 1, z <= pos.z + 1, z++) {
Position xpos = new Position();
xpos.x = x;
xpos.y = y;
xpos.z = z;
minetest.env:remove_node(xpos);
}
}
}
}
Hybrid Dog wrote:function dig3(pos)
for i = -1,1 do
for j = -1,1 do
for k = -1,1 do
minetest.remove_node({x=pos.x+i, y=pos.y+j, z=pos.z+k})
end
end
end
end
Users browsing this forum: No registered users and 6 guests