changing roof type to glass (transparent roofing)

Started by keylocke, July 08, 2015, 04:54:09 AM

Previous topic - Next topic

keylocke

basically i want to create a greenhouse type structure, without needing to use a sunlamp and just click an option to toggle the "roof" of a room between "opaque" and "transparent".

both opaque and transparent roofs are considered as "indoors". but the transparent roof allows sunlight in.

skullywag

#1
hmmm not sure how feasible that is, given the games mechanism for roofs, youd have to get pretty deep into the core code and somehow make the check for is roofed take into account your new roof type, or make the plants themselves know about your new roof.

Also roofdefs only have:

public class RoofDef : Def
{
public bool isNatural;
public bool isThickRoof;
public ThingDef collapseLeavingThingDef;
public ThingDef filthLeaving;
public SoundDef soundPunchThrough;
}


available. So you would need to not only extend that to have some kind of transparent flag but also the mechanism for actually building the roof/changing roof types. Not an easy task.

Just checking the plant part to see if its feasible from that direction, but i know ive had issues in the past when trying to override the plant class.

edit - hmm could you make a roof cell glow with the same level as daylight therefore would let plants grow under it....that....might work.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

keylocke

Quote from: skullywag on July 08, 2015, 05:17:06 AM
hmmm not sure how feasible that is, given the games mechanism for roofs, youd have to get pretty deep into the core code and somehow make the check for is roofed take into account your new roof type, or make the plants themselves know about your new roof.

Also roofdefs only have:

public class RoofDef : Def
{
public bool isNatural;
public bool isThickRoof;
public ThingDef collapseLeavingThingDef;
public ThingDef filthLeaving;
public SoundDef soundPunchThrough;
}


available. So you would need to not only extend that to have some kind of transparent flag but also the mechanism for actually building the roof/changing roof types. Not an easy task.

Just checking the plant part to see if its feasible from that direction, but i know ive had issues in the past when trying to override the plant class.

edit - hmm could you make a roof cell glow with the same level as daylight therefore would let plants grow under it....that....might work.

but then wouldn't a glowing roof still glow at night instead of following the usual day/night cycle?

skullywag

Thats the point of making its glow match the daylight (or "psyche" glow) each tick. Only issue would be the roof would need to tick (shouldnt be too bad you wont have many roofs and hey grass ticks) and youd have to work out a way of constructing it.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Lonely Rogue

Just have it power itself off of the solar panel config. Maybe it could even have a power run-off that would *HELP* power things under it, maybe adding a TINY amount of power per roof cell, after taking in the fact that it glows.
Rimworld: A game where you're kept as entertainment for thousand year old robots, and you just don't know it yet.
Any mod requests?