faulty arguments passed via remote.call(...)[0.12.29]

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 880
Joined: Sun Mar 20, 2016 2:51 am
Contact:

faulty arguments passed via remote.call(...)[0.12.29]

Post by Impatient »

hi !

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
			}
this is the call:

Code: Select all

		local monitor = remote.call("DVM","create_monitor","myLabel")
the remote function call itself works.

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")
where "dear reader" would be the argument passed to the function.

is it a bug, or is it my faulty code?

thanks!

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3699
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: faulty arguments passed via remote.call(...)[0.12.29]

Post by DaveMcW »

why can't you use:

Code: Select all

local monitor = create_monitor("myLabel")

User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 880
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: faulty arguments passed via remote.call(...)[0.12.29]

Post by Impatient »

DaveMcW wrote:why can't you use:

Code: Select all

local monitor = create_monitor("myLabel")
i can, but i was testing the remote interface. imo the interface should also work properly, when called by the mod, that registers it.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13175
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: faulty arguments passed via remote.call(...)[0.12.29]

Post by Rseding91 »

Thanks for the report. This is now fixed for the next version.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”