i encouinterd a problem with a remote interface call in version 0.12.29 . IMPORTANT'! the problem only occures when the interface is called from the same mod, that adds the interface. when called from another mod, this problem does not occure.
this is the interface:
Code: Select all
remote.add_interface("DVM",
{
create_monitor = function (label)
game.player.print(tostring(label))
-- other code here
end
}
Code: Select all
local monitor = remote.call("DVM","create_monitor","myLabel")
question: what should the variable "label" in the function "create_monitor" contain, when the function is called?
the string "myLabel"
, right?but it doesn't. it holds a function reference.
the api doc says ( http://lua-api.factorio.com/0.12.29/LuaRemote.html#call ) all the values after the 2nd string in the function call are "Arguments to pass to the called function."
the code example in the api doc is
Code: Select all
remote.call("human interactor", "bye", "dear reader")
is it a bug, or is it my faulty code?
thanks!