Jump to content

Request for Advice on How to Approach Specific Mod Concept


Recommended Posts

Hello,

I've been tweaking various ONI mods from source, know how to compile, decompile, and have read various files from Assembly, and Assembly-firstpass. I have made a couple for my own entertainment, but they are all very basic.

I have a specific mod in mind: I would like to make a heat exchanger that works in the space biome in lieue of the ridiculous drop of liquid techniques. While I'm open to other suggestions, what I am thinking is something that goes to the background layer (like a thermal shift plate), but is active, and has two plumbing connections (it would be a liquid cooling block). I would then make the heat exchanger aware of objects "in front of it,"  and exchange heat with them directly (the idea is the exchanger is "attached" to things in front of it). 

What I am looking for is the best/most efficient way of placing an object on the backplane, running coolant through it, and having that object exchange heat with other objects and the coolant. I was actually thinking of starting with a resized version of the liquid reservoir code, and adding sufficient glue to give it the behaviors I need. Any advice on the best appoach here?

Is there some way to do this without generating my own ticks? Or should I generate my own ticks, periodically query the adjacent objects, and just recalc new temperatures and call it a day? If so, can you point me to some basic concepts and code to check out in the core, or some mod that has some code that would show me how to to invoke the API calls?

Thank you in advance...

EDIT:

Update for the search farms, as I had to work this out myself. Answer to 2 questions:

Q, what';s a good way to tick?

A: Derive a class from ISim100ms (or variant), and implement Sim1000ms method, and then in your ConfigureBuildingTemplate for your building, do GameObject.AddOrGet<>, with the argument being the name of your class.

Q, what's a good way to find an object you may be behind?

A: Something like this:

        private GameObject AttachedBuilding()
        {
            var thisCell = Grid.PosToCell(this);

            return Grid.Objects[thisCell, (int) ObjectLayer.Building];
                   
        }

My next little project is to figure out how to make the liquid reservoir only dispense when full... I know how to do that with a automation components in the game, but I really want a modified liquid reservoir with a built in feature to only begin letting liquid out once full or something. Still experimenting.

 

 

 

Link to comment
Share on other sites

Not sure what you are envisioning. You can probably use two storage components, set one as input and set the other one as output. Then you can precisely control when and how stuff goes through. An example of this is the Ice-E-Fan.

Link to comment
Share on other sites

Look at recent mods list to see the Heat Exchanger for Space Based Applications. It works differently than a simple radiator. The exchanger exchange heat with the building it's attached to (moving heat from the building --> exchanger --> fluid in reservoir). I'm sure you could combine it with this other mod if you wanted, but it's not the same thing at all.

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...