Courageous

Request for Advice on How to Approach Specific Mod Concept

Recommended Posts

Courageous    0

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.

 

 

 

Edited by Courageous

Share this post


Link to post
Share on other sites
Candide    16

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now