ozkur wrote:[...]
i'm having troubles with get_node() Please help
if tank == "rocket:tankfull" and ...
if tank.name == "rocket:tankfull" and ...
minetest.show_formspec(username, formname, formspec)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", formspec)
zorman2000 wrote:Hello,
I would like to know how to use minetest.register_on_player_receive_fields() when it is a node's formspec.
What would be the name of that form?
I know that with: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.show_formspec(username, formname, formspec)
you specify a "formname" which usually is the way to detect on the callback. But how to do it when the formspec is set to a node? Like the following: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
local meta = minetest.get_meta(pos)
meta:set_string("formspec", formspec)
Does this formspec has a name?
Thanks,
zorman2000
BrunoMine wrote:Block I said goodbye.
Two major projects will be discontinued:
I use these mods on my server, but I need to change them. What are the best options to replace?
local start_screen =
"size[8,7;]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
"field[1,1;100,100;formtext;lol;default]"..
default.get_hotbar_bg(0,2.85)
minetest.register_on_newplayer (function(player)
minetest.show_formspec(player:get_player_name(), "start_screen", formspec)
end)
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)
azekill_DIABLO 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
-- ...
minetest.show_formspec(player:get_player_name(), "start_screen", formspec)
-- ...
Can someone help me? it is supposed to make a formspec pop on first join, but it makes the game crashes.
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)
local start_screen =
"size[8,7;]"..
default.gui_bg..
"field[1,1;100,100;formtext;lol;default]"
minetest.register_on_newplayer (function(player)
minetest.show_formspec(player:get_player_name(), "start_screen", formspec)
end
minetest.register_on_newplayer (function(player)
minetest.show_formspec(name, "start_screen",
"size[8,7;]"..
default.gui_bg..
"field[1,1;100,100;formtext;lol;default]")
end
end)
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)
Hybrid Dog wrote:kaeza, maybe formspec is defined somewhere before that code and the crash is caused by a missing default mod
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)
print"hello"
minetest.show_formspec(name, "start_screen", "size[8,7;]")
print"hello"
end
local a = function()
print"hello"
end
minetest.register_on_newplayer(function(player)
print"hello"
end)
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)
local def = {
name = "grenade:explosion",
description = "Grenade Explosion (you hacker you!)",
radius = 3,
tiles = {
side = "default_dirt.png",
top = "default_dirt.png",
bottom = "default_dirt.png",
burning = "default_dirt.png"
},
}
tnt.register_tnt(def)
minetest.register_craftitem("grenade:grenade", {
description = "Grenade",
inventory_image = "default_coal_lump.png",
on_use = function(itemstack, user, pointed_thing)
local v = user:get_look_dir()
local pos = user:getpos()
pos.y = pos.y + 1.2
local obj = minetest.add_entity(pos, "grenade:grenade_flight")
obj:setvelocity({x = v.x * 4, y = v.y * 2 + 2, z = v.z * 4})
obj:setacceleration({x = v.x / 4, y = v.y / 2 - 4, z = v.z / 4})
itemstack:take_item()
return itemstack
end,
})
minetest.register_entity("grenade:grenade_flight", {
physical = true,
collide_with_objects = true,
weight = 5,
textures = {"default_coal_lump.png"},
on_activate = function(self, staticdata)
self.timer = 2
end,
on_step = function(self, dtime)
local acc = self.object:getacceleration()
self.object:setacceleration({x = acc.x * 2 / 4, y = acc.y, z = acc.z * 2 / 4})
self.timer = self.timer + dtime
if self.timer > 4 then
tnt.boom(self.object:getpos(), def)
end
end,
})
minetest.register_craft({
output = "grenade:grenade",
recipe = {
{"", "group:stick", ""},
{"group:wood", "default:coal_lump", "group:wood"},
{"", "group:wood", ""}
}
})
ABJ 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
local def = {
name = "grenade:explosion",
description = "Grenade Explosion (you hacker you!)",
radius = 3,
tiles = {
side = "default_dirt.png",
top = "default_dirt.png",
bottom = "default_dirt.png",
burning = "default_dirt.png"
},
}
tnt.register_tnt(def)
minetest.register_craftitem("grenade:grenade", {
description = "Grenade",
inventory_image = "default_coal_lump.png",
on_use = function(itemstack, user, pointed_thing)
local v = user:get_look_dir()
local pos = user:getpos()
pos.y = pos.y + 1.2
local obj = minetest.add_entity(pos, "grenade:grenade_flight")
obj:setvelocity({x = v.x * 4, y = v.y * 2 + 2, z = v.z * 4})
obj:setacceleration({x = v.x / 4, y = v.y / 2 - 4, z = v.z / 4})
itemstack:take_item()
return itemstack
end,
})
minetest.register_entity("grenade:grenade_flight", {
physical = true,
collide_with_objects = true,
weight = 5,
textures = {"default_coal_lump.png"},
on_activate = function(self, staticdata)
self.timer = 2
end,
on_step = function(self, dtime)
local acc = self.object:getacceleration()
self.object:setacceleration({x = acc.x * 2 / 4, y = acc.y, z = acc.z * 2 / 4})
self.timer = self.timer + dtime
if self.timer > 4 then
tnt.boom(self.object:getpos(), def)
end
end,
})
minetest.register_craft({
output = "grenade:grenade",
recipe = {
{"", "group:stick", ""},
{"group:wood", "default:coal_lump", "group:wood"},
{"", "group:wood", ""}
}
})
My attempt at helping with everamzah's coal grenade mod.
Copy the code into an init.lua and open up minetest with mod enabled, type /giveme grenade:grenade 3. The first two grenades will work perfectly, but the last one, (in each stack) doesn't. It's mysterious and beyond me. How even is such a ridiculous bug possible?
ABJ 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
local def = {
name = "grenade:explosion",
description = "Grenade Explosion (you hacker you!)",
radius = 3,
tiles = {
side = "default_dirt.png",
top = "default_dirt.png",
bottom = "default_dirt.png",
burning = "default_dirt.png"
},
}
tnt.register_tnt(def)
minetest.register_craftitem("grenade:grenade", {
description = "Grenade",
inventory_image = "default_coal_lump.png",
on_use = function(itemstack, user, pointed_thing)
local v = user:get_look_dir()
local pos = user:getpos()
pos.y = pos.y + 1.2
local obj = minetest.add_entity(pos, "grenade:grenade_flight")
obj:setvelocity({x = v.x * 4, y = v.y * 2 + 2, z = v.z * 4})
obj:setacceleration({x = v.x / 4, y = v.y / 2 - 4, z = v.z / 4})
itemstack:take_item()
return itemstack
end,
})
minetest.register_entity("grenade:grenade_flight", {
physical = true,
collide_with_objects = true,
weight = 5,
textures = {"default_coal_lump.png"},
on_activate = function(self, staticdata)
self.timer = 2
end,
on_step = function(self, dtime)
local acc = self.object:getacceleration()
self.object:setacceleration({x = acc.x * 2 / 4, y = acc.y, z = acc.z * 2 / 4})
self.timer = self.timer + dtime
if self.timer > 4 then
tnt.boom(self.object:getpos(), def)
end
end,
})
minetest.register_craft({
output = "grenade:grenade",
recipe = {
{"", "group:stick", ""},
{"group:wood", "default:coal_lump", "group:wood"},
{"", "group:wood", ""}
}
})
My attempt at helping with everamzah's coal grenade mod.
Copy the code into an init.lua and open up minetest with mod enabled, type /giveme grenade:grenade 3. The first two grenades will work perfectly, but the last one, (in each stack) doesn't. It's mysterious and beyond me. How even is such a ridiculous bug possible?
2016-08-17 06:57:07: INFO[Main]: OpenALSoundManager: Creating playing sound
2016-08-17 06:57:08: INFO[Main]: Left button released (stopped digging)
2016-08-17 06:57:08: INFO[Main]: Client::addUpdateMeshTaskForNode(): (5,5,32)
2016-08-17 06:57:10: INFO[Main]: collisionMoveSimple: maximum step interval exceeded, lost movement details!
zorman2000 wrote:Hi all,
Anyone who knows this information will help me a lot!
Is there a limit to the "interval" property when registering an Active Block Modifier? I have registered an ABM and would like it to run every 0.2 seconds or similar with a chance of 1 (I know this could be laggy but the blocks are very limited) and replace a block and set another. However, when I test, I see that blocks are being set at an aprox. 1 second interval.
Is there an internal limit to the ABM interval?
Thanks,
zorman2000
pithy wrote:Yes ABMs have a 1 second interval limit. You can use LBMs and globalsteps to get around this.
See my wireworld mod for an example.
Users browsing this forum: No registered users and 14 guests