Ludeon Forums

RimWorld => Mods => Help => Topic started by: warlocke on July 29, 2015, 08:44:52 PM

Title: Change temperature based on how deep in a mountain you are?
Post by: warlocke on July 29, 2015, 08:44:52 PM
I noticed in parts of my mountain base that are DEEP in the mountain, the temp is still the same as outside (Misc hallways I carved to get to silver and have not used those areas yet.) IRL Caves stay around 60-80F year round. Is there a way to mimic this or is it even doable? I am willing to try to learn how to make it, just not sure where to start with a temperature change.

Thanks.
Title: Re: Change temperature based on how deep in a mountain you are?
Post by: Tynan on August 01, 2015, 12:28:07 AM
Temperatures are stored in the room. To get the room from a cell, use GetRoom(). To change the temperature, set room.Temperature.

As for determining how and when to cool the deep rooms, and how to determine which rooms are deep and how deep they are, that's a tough problem I leave to you :) You probably want to make a MapComponent and run it from there though.
Title: Re: Change temperature based on how deep in a mountain you are?
Post by: warlocke on August 01, 2015, 12:32:33 AM
Thank you for your reply sir. May I ask, what file has some default room defs that I may look at and see how its formatted? If I can see a file layout/commands I can more than likely string something together, just need to see the basics first. (have not coded stuff in a long time, since RunUO came out for ultima online lol) Thanks again.
Title: Re: Change temperature based on how deep in a mountain you are?
Post by: Tynan on August 01, 2015, 12:39:01 AM
You need to decompile the code and start reading and searching through it yourself.
Title: Re: Change temperature based on how deep in a mountain you are?
Post by: warlocke on August 01, 2015, 12:42:22 AM
Ok, wasnt sure if it was xml or in code. I will do that. Thanks sir.
Title: Re: Change temperature based on how deep in a mountain you are?
Post by: warlocke on August 05, 2015, 01:21:15 AM
Ok, I have a partially working script thanks to 1000101 on the slack chat who is helping me get this going. Right now the script detects heaters, camp fires, and such in the rooms and will disable the cave temp. however we cannot find a way to search adjacent cells for coolers and such since they are technically not in the room. Does anyone know of a way to do this?

Title: Re: Change temperature based on how deep in a mountain you are?
Post by: 1000101 on August 06, 2015, 12:36:34 PM
After talking with skullywag on slack, I have an idea to get the list of coolers then check room adjacency.  I'll try when I get home later.
Title: Re: Change temperature based on how deep in a mountain you are?
Post by: TheGentlmen on August 07, 2015, 05:48:09 PM
Quote from: Tynan on August 01, 2015, 12:39:01 AM
You need to decompile the code and start reading and searching through it yourself.
How do you decompile code?
Title: Re: Change temperature based on how deep in a mountain you are?
Post by: 1000101 on August 07, 2015, 11:08:33 PM
With tools such as ILSpy (http://ilspy.net/) or jetBrains dotPeek (https://www.jetbrains.com/decompiler/).  Personally I prefer dotPeek over ILSpy, but they do the same job.

Also, Haplo wrote an excellent tutorial for modding in this thread (https://ludeon.com/forums/index.php?topic=3408.0).  Don't be put off by how complex it may seem.  Things are always more difficult when looking in from the outside, once you start playing around (and don't be afraid to!), they become much easier.
Title: Re: Change temperature based on how deep in a mountain you are?
Post by: TheGentlmen on August 08, 2015, 12:32:02 AM
Thanks  :)