Explaination on how to interface with circuit network

Place to get help with not working mods / modding interface.
DrConsole
Manual Inserter
Manual Inserter
Posts: 4
Joined: Thu Oct 19, 2017 2:38 pm
Contact:

Explaination on how to interface with circuit network

Post by DrConsole »

Hey guys,

I'm quite new to factorio modding and just writing my first mod.

At the moment I have a working entity with corresponding item which loads fine.
Now I'm at the control stage, and struggeling....

I can't find any tutorial or documentation on how to add the dialog to set the circuit network activation condition and doing calls to other functions on activation or deactivation condition.

Could someone explain it to me or give me a hint where to find more info?

About my mod: I want to implement a pipe valve which can be controlled by the circuit network for connecting / disconnecting parts of the fluid network.

As now my functions look like this:

Code: Select all

function closeValve(entity)
    fb = entity.fluidbox[1]
    fb.base_level = 500
    entity.fluidbox[1] = fb
end

function openValve(entity)
    fb = entity.fluidbox[1]
    fb.base_level = 0
    entity.fluidbox[1] = fb
end

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

Re: Explaination on how to interface with circuit network

Post by DaveMcW »

It is very difficult.

There are no circuit network events, so you must update everything in on_tick.

You must build your own gui out of LuaGuiElements.

I tried to build a simple version of this in Recursive Blueprints, but it is still a mess.

DrConsole
Manual Inserter
Manual Inserter
Posts: 4
Joined: Thu Oct 19, 2017 2:38 pm
Contact:

Re: Explaination on how to interface with circuit network

Post by DrConsole »

Thanks for the reply.

Is there no other way than building an custom GUI?
I only need the normal dialog like inserters have to set a X > Y condition for activation / deactivation....

I hoped that it wouldn't dive me that deep inside the code... :roll:

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

Re: Explaination on how to interface with circuit network

Post by DaveMcW »

For your specific case, it sounds like you can use a modded pump.

Post Reply

Return to “Modding help”