Oxygen Not Included

Oxygen Not Included

30 ratings
Lamp The Darkness
   
Award
Favorite
Favorited
Unfavorite
Mods: Tweaks
Compatibility: Base Game, Spaced Out!
File Size
Posted
339.733 KB
Dec 30, 2023 @ 4:23am
1 Change Note ( view )

Subscribe to download
Lamp The Darkness

Description
After getting deep into strange places I don't belong, such as Visual Studio 2022, I've managed to create a mod that does the following:

- ceiling lights now use 1 watt of power and produce 100 DTU/s
- lamps now use 1 watt of power and produce 100 DTU/s

This mod was inspired by the mod Darkness Not Included, if you can't tell by the title plate, but is in no way affliated with that mod.

Its purpose is to ease the passage of duplicants from beyond the wall of night, and to what terrible dawn none can say, while not costing hundreds of billions of watts in the process. It is also extremely simple. It uses the postfix method to make the above changes to these items. I sound like I may know what I'm talking about, but I don't.

Commiserate with that revelation; should you encounter bugs, irregularities, astounding or abnormal acts, distemper, vitriol, ham on ham combat, insane declarations or general catastrophe due to usage of this mod, you should unsubscribe. I will not be debugging anything. It is amazing that I decided to make this a few hours ago, knowing nothing of such things as code or syntax or frameworks, and then watched it magically compile just as I had abandoned hope. Hi five, enjoy.

Oh, I should add it has been tested by putting Nails to work above. Keep peddling Nails! Your dog is out there somewhere! It works fine, and has zero chance of ruining anything except some other mod that tries to do its same job.

------------------------------------------------------------------------------------------------------------------------------------------------------------

I've been advised that it's wise to post my source stuff. Since I don't yet have any understanding of GitHub or its ways, here it is just cut and pasted in. This is what is compiled into the .dll in this mod. Using Visual Studio (and C#) (ty TC-1000 for correcting this from "Visual Basic 2022") is not actually very difficult - if you decide that 1 watt is too good for the average starving dupe. At some point there will hopefully be a normal repository link for anyone to check out - ty Sgt_Imalas for clarifiying for me.


using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LightAndLamp
{
public class Class1
{
[HarmonyPatch(typeof(CeilingLightConfig), "CreateBuildingDef")]
public static class CeilingLightConfig_CreateBuildingDef_Patch
{
public static void Postfix(BuildingDef __result)
{
__result.EnergyConsumptionWhenActive = 1f;
__result.SelfHeatKilowattsWhenActive = 0.1f;
}
}
[HarmonyPatch(typeof(FloorLampConfig), "CreateBuildingDef")]
public static class FloorLampConfig_CreateBuildingDef_Patch
{
public static void Postfix(BuildingDef __result)
{
__result.EnergyConsumptionWhenActive = 1f;
__result.SelfHeatKilowattsWhenActive = 0.1f;
}
}
}
}

16 Comments
Xenomorphic Tendencies  [author] Apr 21 @ 8:39am 
I thought so too.
Neron-RK Apr 21 @ 7:11am 
works, didn't notice any glitches, with a mod for darkness it's simply irreplaceable
Kriosiss Apr 29, 2024 @ 11:08am 
it loads but at the same point after the save it errors and does that
Xenomorphic Tendencies  [author] Apr 29, 2024 @ 4:13am 
No idea. if you don't notice anything in the save then ignore it.. it looks like maybe another mod is doing something DNI doesn't expect, but thats a total guess. seems pretty benign though if everything loads ok.

there might be a mod forum somewhere, but I don't know any off the top of my head
Kriosiss Apr 27, 2024 @ 9:27am 
NullReferenceException: Object reference not set to an instance of an object

DarknessNotIncluded.UnitOrientation.GetCurrentOrientation () (at <df9a2e106d0d4a108252ff11a0dccff3>:0)
DarknessNotIncluded.UnitOrientation.Sim33ms (System.Single dt) (at <df9a2e106d0d4a108252ff11a0dccff3>:0)
SimAndRenderScheduler+Sim33msUpdater.Update (ISim33ms updater, System.Single dt) (at <3ca21dc18eae422d87255277091f8593>:0)
UpdateBucketWithUpdater`1[DataType].Update (System.Single dt) (at <3ca21dc18eae422d87255277091f8593>:0)
StateMachineUpdater+BucketGroup.AdvanceOneSubTick (System.Single dt) (at <3ca21dc18eae422d87255277091f8593>:0)
StateMachineUpdater.AdvanceOneSimSubTick () (at <3ca21dc18eae422d87255277091f8593>:0)
Game.SimEveryTick (System.Single dt) (at <3d436e4ec1d5455793674ec559b0cc77>:0)
Game.Update () (at <3d436e4ec1d5455793674ec559b0cc77>:0)

Build: U51-600112-V
Kriosiss Apr 27, 2024 @ 9:27am 
also im getting this error log cuz of DNI^ any thing i can do to stop it?
Xenomorphic Tendencies  [author] Apr 27, 2024 @ 9:24am 
wait a second.. it's been too long since I played. I used DNI myself with this mod. It works fine! lol, sorry for the confusion
Xenomorphic Tendencies  [author] Apr 27, 2024 @ 9:23am 
It modifies ceiling lights and lamps only with a patch. I think it should work with DNI, but load DNI after this. I you notice that lamps and lights are not working as I say then it means DNI is changing the same items - then you could try loading this after DNI to see if it causes any issues with that mod.

I think it should work fine with DNI though if you just want to load them both in whatever order they wind up in.
Kriosiss Apr 27, 2024 @ 9:10am 
Does this work with DNI or is it need DNI off?
Xenomorphic Tendencies  [author] Jan 3, 2024 @ 7:55am 
tyty :) same to you