Jump to content

Mod Request, CO2 Scrubber


Recommended Posts

Ive tried for a few days to build this mod myself, but it keeps failing and ive no idea why. All I want to do was make CO2 Scrubbers act as they do IRL, as their current behavior is silly. IRL, CO2 can be split into CO and O by using catalysts. CO isnt in the game, and ive no interest in adding it, so ive decided to go one of two routes. The first is to make it simple, and just change the Scrubber to create Refined Carbon and Oxygen in proportion to the amount of CO2 consumed.

Currently;
0.3f of CO2 + 1f of Water = 1f of Polluted Water.
Makes no sense really. Carbon is deleted, which is handy, but both unrealistic and creates nothing useful(aside from a bit of Polluted Dirt). 

My simple version would attempt to change it so that;
0.3f of CO2 + 1f of Water = 1f of Polluted Water, 0.1f of Refined Carbon, and 0.2f of Oxygen.
Ive also doubled the power requirement to 240w for a bit of balance.

This is the current version ive decided to go with, as its super simple(at least until I try to build it), stays reasonably balanced(requires playtesting to confirm), and allows CO2 to not be next to useless. 

The second version ill address later would be much more complex, probably having to need a separate building, but more closely modeling an actual IRL conversion process of turning CO2 into something useful. After splitting CO2 into CO and O, addition of a hydrogen source, power, and an additional copper catalyst to CO can convert it into a hydrocarbon. The only hydrocarbon modeled in vanilla at the moment is Ethanol{C2H6O}, though Propane {C3H8} would be the target IRL(I know its in the game files, but its not used in vanilla, so id like to avoid using it). 

CO2 + Hydrogen/Water* + Copper/Lime* = Oxygen, Refined Carbon, and Ethanol.
*The usage/ratios of which would depend on balance/efficiency and/or the molecular math, for the realism nerds lol

Anyway, posting a copy of the CO2ScrubberConfig.cs that I modified, as well as a pic of my changes(for viewing for those who dont want to DL the .cs). Any help is much appreciated. 

Thanks

Capture.PNG

CO2ScrubberConfig.cs

Link to comment
Share on other sites

        [HarmonyPatch(typeof(CO2ScrubberConfig), "ConfigureBuildingTemplate")]
        public class ConfigureBuildingTemplate_Patch
        {
            private static void Postfix(GameObject go, Tag prefab_tag)
            {
                ElementConverter elementConverter = go.AddOrGet<ElementConverter>();
                elementConverter.consumedElements = new ElementConverter.ConsumedElement[2]
                {
                  new ElementConverter.ConsumedElement(GameTagExtensions.Create(SimHashes.Water), 1f),
                  new ElementConverter.ConsumedElement(GameTagExtensions.Create(SimHashes.CarbonDioxide), 0.3f)
                };
                elementConverter.outputElements = new ElementConverter.OutputElement[3]
                {
                  new ElementConverter.OutputElement(1f, SimHashes.DirtyWater, 0.0f, storeOutput: true),
                  new ElementConverter.OutputElement(0.1f, SimHashes.RefinedCarbon, 0.0f, storeOutput: true),
                  new ElementConverter.OutputElement(0.2f, SimHashes.Oxygen, 0.0f, outputElementOffsety: 0.0f, diseaseWeight: 0.75f)
                };

                ElementDropper elementDropper = go.AddComponent<ElementDropper>();
                elementDropper.emitMass = 10f;
                elementDropper.emitTag = new Tag("RefinedCarbon");
                elementDropper.emitOffset = new Vector3(0.0f, 1f, 0.0f);
            }
        }

 

Link to comment
Share on other sites

Hey, thanks for the reply, but honestly im not sure what im meant to do with that. Ive no idea how to create mods for this game or code, despite my best attempts to learn, thats why I decided to take my idea and progress and create a mod request instead lol. I figure id get farther if I left it up to someone who knows what they are doing, rather than continuing to muddle around with something I barely understand.

Forgot to say, but if anyone takes my idea and makes a mod, feel entirely free to upload it to Steam as your own. I just want it to exist lol.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...