Tables change id when going through remote.call

Place to get help with not working mods / modding interface.
User avatar
cpeosphoros
Inserter
Inserter
Posts: 40
Joined: Fri Dec 23, 2016 10:57 pm
Contact:

Tables change id when going through remote.call

Post by cpeosphoros »

It seems obvious in hindsight, since they probably must undergo some sort of copy/deepcopy when being passed around, but I only figured it out after trying to use them as indexes on the other side of the remote call.

I'm saying it here just as a kind of documentation.

Code: Select all

89:01:52.39: Registered job table: 0x00007f611c003ec0 with name Concreteer and priority 10
89:01:54.00: Reading workerCount for job table: 0x00007f611cb21610 with name Concreteer and priority 10
89:01:56.00: Reading workerCount for job table: 0x00007f611ea2f900 with name Concreteer and priority 10
Strings work just fine, though.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15997
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Tables change id when going through remote.call

Post by Rseding91 »

Each mod is run under a different lua instance and as such doesn't share anything data wise - anything passed between them is copied.

Any remote call done to yourself is a simple function call.
If you want to get ahold of me I'm almost always on Discord.
User avatar
cpeosphoros
Inserter
Inserter
Posts: 40
Joined: Fri Dec 23, 2016 10:57 pm
Contact:

Re: Tables change id when going through remote.call

Post by cpeosphoros »

Yes, I pretty much figured it out.

I had scaffolded everything neatly in one single mod, passing all info through remote.call and it was working fine.

It "broke" when I separated each part into its own mod.

As I said above, it's obvious in hindsight. :D
Post Reply

Return to “Modding help”