Post your modding questions here
I've been trying to figure out how to get this one to work. I am trying to show another nodes inventory through another node's formspec. I get it to retrieve the inventory properly but I'm not sure how to set its size to display the grid.
Code: Select all
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec",
"size[8,9]"..
"list[nodemeta:"..meta:get_int("x")..","..meta:get_int("y")..","..meta:get_int("z")..";source;0,0;8,4;]"..
"list[current_player;main;0,5;8,4;]")
meta:set_string("infotext", "Stockpile")
--I'm not sure which list I'm supposed to set to get this to work
end,
Youtube Channel: http://www.youtube.com/user/ashenkster69
- Likwid H-Craft
- Member
- Posts: 1113
- Joined: Sun Jan 06, 2013 14:20
- Location: Lost in Crypt
Ok you see the paper at, well that where I would like have the craft, 9 boxs at, but it didn't work so how do I make it work?
My Domain's/others:
http://likwidtest.hj.cx/ (Not Done)
http://likwidtest.hj.cx/ (Not Done)
-
- Member
- Posts: 218
- Joined: Tue Jan 22, 2013 01:39
- Location: mars
So... can someone post a Utube vid on how to make items move from one chest to another in the tecnic mod.
My Awesome Map please try:
http://forum.minetest.net/viewtopic.php?id=5028
I've played minetest since 0.3.1 came out!
Mostly when on forums I'm using a uniden tablet!
http://forum.minetest.net/viewtopic.php?id=5028
I've played minetest since 0.3.1 came out!
Mostly when on forums I'm using a uniden tablet!
In which way I can get pseudo random number in minetest. I know method next() but if I do this:
I have error.
Code: Select all
local i = next(0,100)
- Calinou
- Moderator
- Posts: 3169
- Joined: Mon Aug 01, 2011 14:26
- GitHub: Calinou
- IRC: Calinou
- In-game: Calinou
- Location: Troyes, France
- Contact:
Code: Select all
my_random_number = math.random(10, 100)
- quick.dudley
- Member
- Posts: 19
- Joined: Fri Apr 12, 2013 09:35
-
- Member
- Posts: 4290
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Newly generated map chunks will be generated with the mod in effect. Already existing map chunks will remain the same. Depending on how large your world is, you may have to go far out for the new mod to take effect.
A list of my mods can be found here.
- Evergreen
- Member
- Posts: 2135
- Joined: Sun Jan 06, 2013 01:22
- GitHub: 4Evergreen4
- IRC: EvergreenTree
- In-game: Evergreen
- Location: A forest in the midwest
- Contact:
Hi, I'm back to this topic again. I'm making quartz from minecraft, and I want to know how to register ores, and how to make it as rare as iron. Also, I wanted to know what license the textures from minecraft are under.
Last edited by Evergreen on Wed Apr 17, 2013 19:59, edited 1 time in total.
Back from the dead!
Evergreen wrote:Hi, I'm back to this topic again. I'm making quartz from minecraft, and I want to know how to register ores, and how to make it as rare as iron. Also, I wanted to know what license the textures from minecraft are under.
the code to register an ore in order for it to spawn at -*** or what ever you set it to and it's very lanthy one of the more complex codes in minetest
In game names:LAD,captainLAD,LionLAD
This is a signature virus. Add me to your signature so that I can multiply.
This is a signature virus. Add me to your signature so that I can multiply.
- Evergreen
- Member
- Posts: 2135
- Joined: Sun Jan 06, 2013 01:22
- GitHub: 4Evergreen4
- IRC: EvergreenTree
- In-game: Evergreen
- Location: A forest in the midwest
- Contact:
I need help.
I need to take away coal from all 18box but I can from only 1st one.
code:
part with taking coal is
I need this for my forcefield mod
I need to take away coal from all 18box but I can from only 1st one.
code:
Code: Select all
local function placeNode(pos)
local n = minetest.env:get_node(pos).name
if (n == "air") then
minetest.env:add_node(pos, {name="forcefield:forcefield"})
end
end
local function placeCubicShell(pos, sideLen)
local s = math.floor(sideLen/2)
for dx = -s, s do
for dy = -s, s do
placeNode({ x = pos.x + dx, y = pos.y + dy, z = pos.z - s })
placeNode({ x = pos.x + dx, y = pos.y + dy, z = pos.z + s })
end
end
for dy = -s, s do
for dz = -s, s do
placeNode({ x = pos.x - s, y = pos.y + dy, z = pos.z + dz })
placeNode({ x = pos.x + s, y = pos.y + dy, z = pos.z + dz })
end
end
for dz = -s, s do
for dx = -s, s do
placeNode({ x = pos.x + dx, y = pos.y - s, z = pos.z + dz })
placeNode({ x = pos.x + dx, y = pos.y + s, z = pos.z + dz })
end
end
end
local function removeNode(pos)
local n = minetest.env:get_node(pos).name
if (n == "forcefield:forcefield") then
minetest.env:add_node(pos, {name="air"})
end
end
local function removeCubicShell(pos, sideLen)
local s = math.floor(sideLen/2)
for dx = -s, s do
for dy = -s, s do
removeNode({ x = pos.x + dx, y = pos.y + dy, z = pos.z - s })
removeNode({ x = pos.x + dx, y = pos.y + dy, z = pos.z + s })
end
end
for dy = -s, s do
for dz = -s, s do
removeNode({ x = pos.x - s, y = pos.y + dy, z = pos.z + dz })
removeNode({ x = pos.x + s, y = pos.y + dy, z = pos.z + dz })
end
end
for dz = -s, s do
for dx = -s, s do
removeNode({ x = pos.x + dx, y = pos.y - s, z = pos.z + dz })
removeNode({ x = pos.x + dx, y = pos.y + s, z = pos.z + dz })
end
end
end
minetest.register_node("forcefield:forcefield", {
tiles = {"forcefield_forcefield.png"},
drawtype = glasslike,
sunlight_propagates = true,
walkable = true,
diggable = false,
damage_per_second = 4,
on_punch = function(pos, node, puncher)
punch = 1
end,
on_construct = function(pos)
fpos = minetest.env:find_node_near(pos, 10, "forcefield:fmaker")
local meta1 = minetest.env:get_meta(pos)
local meta2 = minetest.env:get_meta(fpos)
local fgen = 1
end,
})
minetest.register_abm({
nodenames = {"forcefield:forcefield"},
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
if minetest.env:find_node_near(pos, 6, "forcefield:fmaker") == nil then
minetest.env:add_node(pos, {name="air"})
end
end,
})
default.forcefield_formspec =
"size[8,9]"..
"list[current_name;coal;2,1;6,3;]"..
"list[current_player;main;0,5;8,4;]"..
"field[0,3;2,1;range;range;4]"..
"button_exit[0,1;2,1;exit;exit]"
minetest.register_node("forcefield:fmaker", {
description = "Forcefield Generator",
tiles = {"forcefield_sides.png","forcefield_sides.png","forcefield_front.png","forcefield_sides.png","forcefield_sides.png","forcefield_sides.png"},
groups = {snappy=2, choppy=2},
after_place_node = function(pos, placer)
local meta = minetest.env:get_meta(pos)
if fgens then
table.insert (fgens , 0)
meta:set_string("fgen", table.getn (fgens) )
else
fgens = {0}
table.insert (fgens , 0)
meta:set_string("fgen", table.getn (fgens))
end
meta:set_string("owner", placer:get_player_name() or "")
meta:set_string("infotext", "Locked Chest (owned by "..meta:get_string("owner").." #"..meta:get_string("fgen")..")")
end,
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec", default.forcefield_formspec)
meta:set_string("infotext", "forcefield generator")
local inv = meta:get_inventory()
inv:set_size("coal", 18)
end,
can_dig = function(pos,player)
local meta = minetest.env:get_meta(pos);
local inv = meta:get_inventory()
if not inv:is_empty("coal", 18) then
return false
end
return true
end,
})
minetest.register_abm({
nodenames = {"forcefield:fmaker"},
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local meta = minetest.env:get_meta(pos)
local inv = meta:get_inventory()
local coallist = inv:get_list("coal")
if inv:contains_item("coal", "default:coal_lump") then
coalstack = inv:get_stack("coal", 1)
coalstack:take_item()
inv:set_stack("coal", 1, coalstack)
placeCubicShell(pos, 10)
else
removeCubicShell(pos, 10)
end
if fgens[meta:get_string("fgen")] >= 1 then
coalstack = inv:get_stack("coal", 1)
coalstack:take_item()
inv:set_stack("coal", 1, coalstack)
fgens[meta:get_string("fgen")] = 0
end
end,
})
minetest.register_craft({
output = 'forcefield:fmaker',
recipe = {
{'default:mese', 'default:mese', 'default:mese'},
{'default:mese', 'default:furnace', 'default:mese'},
{'default:mese', 'default:mese', 'default:mese'},
}
})
Code: Select all
coalstack = inv:get_stack("coal", 1)
coalstack:take_item()
inv:set_stack("coal", 1, coalstack)
Last edited by ch98 on Thu Apr 18, 2013 04:49, edited 1 time in total.
I have stopped playing minetest, and may not come back to it again. I would like to thank everyone that made the amazing time I had playing it. This account is not in use anymore, and the email has been linked to a unused account. If any administrator reading this has time, feel free to delete my account. Thank you very much for the great experience.
also, is it possible to save table like data after server restart?
I have stopped playing minetest, and may not come back to it again. I would like to thank everyone that made the amazing time I had playing it. This account is not in use anymore, and the email has been linked to a unused account. If any administrator reading this has time, feel free to delete my account. Thank you very much for the great experience.
write it to a file^
My Essential Server Modpack: ServerExtended
Maintainer of the Minitest Game
[0.4.6-git] SunriseTest Minecraft-Like Hardcore Server
My Kindle broke... Online time will drop significantly.
Maintainer of the Minitest Game
[0.4.6-git] SunriseTest Minecraft-Like Hardcore Server
My Kindle broke... Online time will drop significantly.
- Evergreen
- Member
- Posts: 2135
- Joined: Sun Jan 06, 2013 01:22
- GitHub: 4Evergreen4
- IRC: EvergreenTree
- In-game: Evergreen
- Location: A forest in the midwest
- Contact:
how?Traxie21 wrote:write it to a file^
I have stopped playing minetest, and may not come back to it again. I would like to thank everyone that made the amazing time I had playing it. This account is not in use anymore, and the email has been linked to a unused account. If any administrator reading this has time, feel free to delete my account. Thank you very much for the great experience.
I could use some help with a timer for a HUD. I need to be able to remove one thing each second,
but I always get ERROR: Nil value, with no code indicator or anything. All variables seem valid.
HELP!
but I always get ERROR: Nil value, with no code indicator or anything. All variables seem valid.
HELP!
Code: Select all
local player = user
local function timer(player, str)
if cntdown < 1 then
user:hud_remove(0)
user:hud_remove(1)
user:hud_remove(2)
user:hud_remove(3)
else
cntdown = cntdown-1
length1 = cntdown+str:len()
player:hud_change(0, number, length1*2+1)
local tbl = {player, str}
minetest.after(1, function(param)
timer(param.player, param.str)
end, tbl)
end
end
timer(user, iname)
My Essential Server Modpack: ServerExtended
Maintainer of the Minitest Game
[0.4.6-git] SunriseTest Minecraft-Like Hardcore Server
My Kindle broke... Online time will drop significantly.
Maintainer of the Minitest Game
[0.4.6-git] SunriseTest Minecraft-Like Hardcore Server
My Kindle broke... Online time will drop significantly.
- RealBadAngel
- Member
- Posts: 557
- Joined: Wed Jul 18, 2012 16:30
so where is cntdown initialized?Traxie21 wrote:I could use some help with a timer for a HUD. I need to be able to remove one thing each second,
but I always get ERROR: Nil value, with no code indicator or anything. All variables seem valid.
HELP!
Code: Select all
local player = user local function timer(player, str) if cntdown < 1 then user:hud_remove(0) user:hud_remove(1) user:hud_remove(2) user:hud_remove(3) else cntdown = cntdown-1 length1 = cntdown+str:len() player:hud_change(0, number, length1*2+1) local tbl = {player, str} minetest.after(1, function(param) timer(param.player, param.str) end, tbl) end end timer(user, iname)
- ShadowNinja
- Developer
- Posts: 200
- Joined: Tue Jan 22, 2013 22:35
- GitHub: ShadowNinja
- IRC: ShadowNinja
- In-game: ShadowNinja
Untested:ch98 wrote:how?Traxie21 wrote:write it to a file^
Code: Select all
function save(mytable, filename)
file, error = io.open(filename, "w")
if error then return error end
file:write(minetest.serialize(mytable))
file:close()
end
function load(filename)
file, error = io.open(filename, "r")
if error then return error end
local mytable = minetest.deserialize(file:read("*a"))
file:close()
return mytable
end
Last edited by ShadowNinja on Sat Apr 20, 2013 22:10, edited 1 time in total.
Traxie21 wrote:I could use some help with a timer for a HUD. I need to be able to remove one thing each second,
but I always get ERROR: Nil value, with no code indicator or anything. All variables seem valid.
HELP!
Code: Select all
local max = 8 --max items to remove
local function timer(cnt, player)
if cnt <= max then
minetest.chat_send_all("remove hud item " .. cnt.. " from " ..player:get_player_name()) --removing
minetest.after(1, timer, cnt+1, player)
else
minetest.chat_send_all("all " ..max.. "items are removed. now do want ever you want :P")
end
end
Code: Select all
timer(0, player) --or another number
Will test blockmen.
RBA: its a local just above that code. it's usually equal to 60
RBA: its a local just above that code. it's usually equal to 60
My Essential Server Modpack: ServerExtended
Maintainer of the Minitest Game
[0.4.6-git] SunriseTest Minecraft-Like Hardcore Server
My Kindle broke... Online time will drop significantly.
Maintainer of the Minitest Game
[0.4.6-git] SunriseTest Minecraft-Like Hardcore Server
My Kindle broke... Online time will drop significantly.
- Evergreen
- Member
- Posts: 2135
- Joined: Sun Jan 06, 2013 01:22
- GitHub: 4Evergreen4
- IRC: EvergreenTree
- In-game: Evergreen
- Location: A forest in the midwest
- Contact:
Shadow wrote:Untested:ch98 wrote:how?Traxie21 wrote:write it to a file^Edit: added arguments, avoided overwriting the Lua "table" table.Code: Select all
function save(mytable, filename) file, error = io.open(filename, "w") if error then return error end file:write(minetest.serialize(mytable)) file:close() end function load(filename) file, error = io.open(filename, "r") if error then return error end local mytable = minetest.deserialize(file:read("*a")) file:close() return mytable end
Thank you. I will try that.
I have stopped playing minetest, and may not come back to it again. I would like to thank everyone that made the amazing time I had playing it. This account is not in use anymore, and the email has been linked to a unused account. If any administrator reading this has time, feel free to delete my account. Thank you very much for the great experience.
-
- Member
- Posts: 180
- Joined: Sun Dec 18, 2011 18:07
- GitHub: YellowberryHN
- IRC: YellowberryHN
- In-game: YellowberryHN
- Location: Utah, USA
- Contact:
Hey, How Do You Define An Entity?
Check Out Moontest! http://hnss.gq/moontest
Buddies: Likwid H-Craft, 0gb.us, Death, Starfellow, asie, and many more!
Buddies: Likwid H-Craft, 0gb.us, Death, Starfellow, asie, and many more!
Who is online
Users browsing this forum: No registered users and 10 guests