Immortal Plants

Started by Hague, October 16, 2015, 02:16:15 AM

Previous topic - Next topic

Hague

How do I alter the lifespan of plants? I've looked through the XML files and I cannot find a property that modifies it. Anyone know? I'm trying to alter the lifespan of fruit-bearing trees.

1000101

Look in ThingDefs, specifically the plants.

<dieIfLeafless> means the plant will die once harvested
<growDays> indicates how long it takes the plant to become mature enough to be harvested

The wild raspberry plant (PlantRaspberry) is a good example of a continuous yield fruit plant (bush).
(2*b)||!(2*b) - That is the question.
There are 10 kinds of people in this world - those that understand binary and those that don't.

Powered By

Hague

Yes. But the bush will eventually die once it reaches its life expectancy. What I want to do is make a plant that won't die of old age. If I lengthen growth days, it will make the plant live longer but it will not change the no. of potential harvests between life expectancy. It appears that all plants have a potential lifespan of 3 times the growth period after examining in-game info from core and other mods. I can't find an XML tag that dictates how much its growth period affects its life expectancy. With the static nature of the number in vanilla, I believe there might be a unused tag that dictates it.

I'm using SK modpack and it has seeds for growable fruit trees. Problem is the trees themselves do not produce seeds, you have to gather them from the fruit via a lengthy process. Other crops drop seeds upon harvest but fruit trees do not. The problem is that you can only get 2 or 3 harvests before the trees die of old age, which is rather unrealistic. I was rather dismayed to find my trees die before the end of one year.

skullywag

#3
Think you can change the lifespanFraction:

// RimWorld.PlantProperties
public bool LimitedLifespan
{
get
{
return this.lifespanFraction > 0f;
}
}


Its defaulted to:
public float lifespanFraction = 3f;

So try adding:

<lifespanFraction>5f</lifespanFraction>
or whatever and see if it effects your plants.

Or based on the above the "limitedlifespan" bool might be editable, ill see what this does and report back, not played with that bit.

Looks like it reads the above float and if it more than 0 it is true
public bool LimitedLifespan
{
get
{
return this.lifespanFraction > 0f;
}
}


So set it to 0f for undying plants???
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Hague

I got it! Turns out I was modifying the wrong plant def file. Thanks for the help! Now my apple trees will live approx. 100 years.