How do I interact with a circuit network?

Place to get help with not working mods / modding interface.
bluMyst
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sun May 15, 2016 3:53 am
Contact:

How do I interact with a circuit network?

Post by bluMyst »

I've been looking around the wiki and the API documentation, and even Googling but I can't find an answer to this. What I want to do is create an entity that has read/write access to the circuit network(s) it's hooked up to. And not just in a combinator sort of way where it can only do a limited number of things. I want to actually import the values into my lua code, crunch some numbers, and export them back into the circuit network again.

So that, for example, I can write some Lua code to emulate a PID controller, or find the square root of the number of inserters. Maybe even take arbitrary player-written Lua code and run it in a sandbox, ComputerCraft-style.

Any help would be appreciated. I'm an experienced programmer, but totally new to Factorio modding.
In my infinite ambivalence.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15914
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: How do I interact with a circuit network?

Post by Rseding91 »

The circuit network doesn't operate in a way that you could do this without an entity.

All of the contents of the circuit network are based off entities inputting those numbers each game tick. Without the entity there's no number so you can't "send a number" into the circuit network and expect it to stay.

Read access to the signals is coming in 0.13, write access can be done using constant combinators.
If you want to get ahold of me I'm almost always on Discord.
bluMyst
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sun May 15, 2016 3:53 am
Contact:

Re: How do I interact with a circuit network?

Post by bluMyst »

Rseding91 wrote:The circuit network doesn't operate in a way that you could do this without an entity.

All of the contents of the circuit network are based off entities inputting those numbers each game tick. Without the entity there's no number so you can't "send a number" into the circuit network and expect it to stay.

Read access to the signals is coming in 0.13, write access can be done using constant combinators.
Interesting! Thanks a lot for the reply. When you say that read access is coming in 0.13, could you be more specific? It's okay if you guys just can't talk about that yet, but I'd love to be pointed in the right direction. Maybe to a blog post mentioning a new item or something? But either way, thanks a lot! :)
In my infinite ambivalence.
User avatar
brunzenstein
Smart Inserter
Smart Inserter
Posts: 1155
Joined: Tue Mar 01, 2016 2:27 pm
Contact:

Re: How do I interact with a circuit network?

Post by brunzenstein »

bluMyst wrote: Interesting! Thanks a lot for the reply. When you say that read access is coming in 0.13, could you be more specific? It's okay if you guys just can't talk about that yet, but I'd love to be pointed in the right direction. Maybe to a blog post mentioning a new item or something? But either way, thanks a lot! :)
Also the chests are not clear in the announcement. Are all all of them in .13 "intelligent" eg. connected to the local circuit and can all be later "researched" to become network compatible?
Post Reply

Return to “Modding help”