Compare commits

...

7 Commits

Author SHA1 Message Date
DonBatman 42d5a8b835 Added bat_blocks? to depends.txt in mesecons_compatibility 2014-11-04 07:06:29 -08:00
Vanessa Ezekowitz d325292291 use the right mesecon:receptor_* call for on/off blinkyplant 2014-09-01 21:12:11 -04:00
Vanessa Ezekowitz 1ebd50ac75 use one ABM for blinkyplant instead of two.
using two ABMs allows the engine to desynchronize them, which makes the
duty cycle unpredictable.
2014-09-01 21:01:35 -04:00
Anthony Zhang 0c62545a3a Merge pull request #168 from ShadowNinja/fix-commandblock-quit
Fix the commandblock's check for quiting the formspec
2014-07-12 16:39:06 -04:00
Vanessa Ezekowitz e88e213183 Merge branch 'master' of github.com:Novatux/minetest-mod-mesecons 2014-06-08 13:06:45 -04:00
Novatux 63998fd7e7 Localize a few variables, add "GET" command to node detector. 2014-06-08 19:02:15 +02:00
ShadowNinja 041429c985 Fix the commandblock's check for quiting the formspec
The submit button also sends a quit field.
2014-06-06 11:24:24 -04:00
4 changed files with 28 additions and 22 deletions

View File

@ -77,26 +77,22 @@ minetest.register_craft({
}
})
minetest.register_abm(
{nodenames = {"mesecons_blinkyplant:blinky_plant_off"},
minetest.register_abm({
nodenames = {
"mesecons_blinkyplant:blinky_plant_off",
"mesecons_blinkyplant:blinky_plant_on"
},
interval = BLINKY_PLANT_INTERVAL,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
--minetest.remove_node(pos)
minetest.add_node(pos, {name="mesecons_blinkyplant:blinky_plant_on"})
if node.name == "mesecons_blinkyplant:blinky_plant_off" then
minetest.add_node(pos, {name="mesecons_blinkyplant:blinky_plant_on"})
mesecon:receptor_on(pos)
else
minetest.add_node(pos, {name="mesecons_blinkyplant:blinky_plant_off"})
mesecon:receptor_off(pos)
end
nodeupdate(pos)
mesecon:receptor_on(pos)
end,
})
minetest.register_abm({
nodenames = {"mesecons_blinkyplant:blinky_plant_on"},
interval = BLINKY_PLANT_INTERVAL,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
--minetest.remove_node(pos)
minetest.add_node(pos, {name="mesecons_blinkyplant:blinky_plant_off"})
nodeupdate(pos)
mesecon:receptor_off(pos)
end,
})

View File

@ -79,7 +79,7 @@ local function after_place(pos, placer)
end
local function receive_fields(pos, formname, fields, sender)
if fields.quit then
if not fields.submit then
return
end
local meta = minetest.get_meta(pos)

View File

@ -1,2 +1,3 @@
mesecons
doors
bat_blocks?

View File

@ -1,3 +1,5 @@
local GET_COMMAND = "GET"
-- Object detector
-- Detects players in a certain radius
-- The radius can be specified in mesecons/settings.lua
@ -33,7 +35,7 @@ local object_detector_scan = function (pos)
end
-- set player name when receiving a digiline signal on a specific channel
object_detector_digiline = {
local object_detector_digiline = {
effector = {
action = function (pos, node, channel, msg)
local meta = minetest.get_meta(pos)
@ -140,17 +142,24 @@ local node_detector_scan = function (pos)
end
-- set player name when receiving a digiline signal on a specific channel
node_detector_digiline = {
local node_detector_digiline = {
effector = {
action = function (pos, node, channel, msg)
local meta = minetest.get_meta(pos)
local active_channel = meta:get_string("digiline_channel")
if channel == active_channel then
meta:set_string("scanname", msg)
node_detector_make_formspec(pos)
if msg == GET_COMMAND then
local frontpos = vector.subtract(pos, minetest.facedir_to_dir(node.param2))
local name = minetest.get_node(frontpos).name
digiline:receptor_send(pos, digiline.rules.default, channel, name)
else
meta:set_string("scanname", msg)
node_detector_make_formspec(pos)
end
end
end,
}
},
receptor = {}
}
minetest.register_node("mesecons_detector:node_detector_off", {