Radial, range-based, temperature generator

Started by Faryzal2020, October 25, 2018, 02:51:26 AM

Previous topic - Next topic

Faryzal2020

A simple question, is it possible to implement a radial temperature generator mod in rimworld? so its like the temperature is t1 from the center to r1 range, and then from that point the temperature fall down to the ambient temperature t2 at r2 range. and these t1, t2, r1, and r2 are configurable parameters. i haven't touched the assembly and C# stuff in rimworld modding so i don't really know if its actually possible or not.

Check out my mod: Definitely More Cannons

Mehni

Anything is possible with C#.

It's a question of having the time/skill/motivation to do it. All three of those is best, having just two of those will work.

You have the full power of .NET 3.5 available. RimWorld sets no limitations to what you can do.

AileTheAlien

Is your plan to have this thing heat multiple rooms? Right now, each room is heated as a block, so having a high temperature generated in the center of the room and no heat at the corners (for example) would be effectively useless, since rooms only have one single temperature. Walls block heaters from working across rooms, so you'd have to change how that works too.

What's your actual goal with this? There might be something similar you could do,with less effort.

Iamkriil

Take a look at GenTemperature.cs

The method  PushHeat(IntVec3 c, Map map, float energy) pushes heat into a RoomGroup which is created by inspecting neighboring cells.  You could change that to push heat only into cells with lesser effect as you move further from the source. This and a few other similar methods dictate how all of the heat flows (GenTemperature.EqualizeTemperaturesThroughBuilding - which is called by door and vent objects.).

You'd have to hijack this class and inject your own, but you'd have to be careful because this class's methods are called by a lot of other classes, so it would require a lot of rewriting.  So you'd be writing a pretty hefty conversion mod.