Can you make a worktable dependant on a facility?

Started by henryheyhey123, August 26, 2015, 12:14:37 PM

Previous topic - Next topic

henryheyhey123

Hi peeps! I've been wondering: is there a way to make a worktable not work if it isn't connected to a facility (i.e. multi-analyzer)? Would I need C# code in a dll or a manipulation factor or something?

Jaxxa

I haven't looked into it but you may be able to use C# to have the tick / ticklong shut-down the power if it does not have the facility connected, this should effectively disable it.

henryheyhey123

Quote from: Jaxxa on August 26, 2015, 07:28:57 PM
I haven't looked into it but you may be able to use C# to have the tick / ticklong shut-down the power if it does not have the facility connected, this should effectively disable it.

Yeah, I've been looking into the code and there's no real way to check if its connected to a facility... i still have to look into the def tree for C# so there's still hope  :)

1000101

BuildableDef does contain something along those lines (untested):

public List<ThingDef> buildingPrerequisites;

You could look into that and see if it's what you need.
(2*b)||!(2*b) - That is the question.
There are 10 kinds of people in this world - those that understand binary and those that don't.

Powered By

henryheyhey123

Quote from: 1000101 on August 30, 2015, 10:19:55 AM
BuildableDef does contain something along those lines (untested):

public List<ThingDef> buildingPrerequisites;

You could look into that and see if it's what you need.

Thanks again 1000101!