Helping with understanding events code

Started by TomaszA2, April 05, 2018, 03:26:05 PM

Previous topic - Next topic

TomaszA2

Hey.
Fast note before ask: If you're moderator, delete my last thread in ,,help" please.
I want to make much stronger vanilla events. (and longer, for example half year 200C heatwave)
That's all what I've found (2x dll, 1x def):


First of all, I dont know what exactly here is making that temperature rise.
Second, I have problems with connecting my def to dll.
My def code: (those texts are temporally, im using it for testing, later I'll make it sensibly)
<?xml version="1.0" encoding="utf-8"?>
<Defs>

<IncidentDef>
<defName>UltimateHeatWave</defName>
<label>ultimate heat wave</label>
<category>Misc</category>
<targetTypes>
  <li>MapPlayerHome</li>
</targetTypes>
<workerClass>IncidentWorker_HeatWave</workerClass>
<gameCondition>Apocalypse.OverHeatWave</gameCondition>
<letterLabel>Heat apocalypse</letterLabel>
<letterText>hello world</letterText>
<letterDef>ThreatSmall</letterDef>
<baseChance>100</baseChance>
<minRefireDays>0</minRefireDays>
<durationDays>
<min>15</min>
<max>35</max>
</durationDays>
</IncidentDef>

</Defs>


My dll code: (it's nearly the same like first dll from image)

using System;
using RimWorld;

namespace Apocalypse
{
public class OverHeatWave : GameCondition
{
private const int LerpTicks = 12000;

private const float MaxTempOffset = 17f;

public override float TemperatureOffset()
{
return GameConditionUtility.LerpInOutValue(this, 48000f, 68f);
}
}
}





It's something like adding some temperature per tick or something with speed descripted in LerpInOutValue()? If yes, nice, I know what's doing it, but still I don't know how and what is third parameter of this.

Actually I have made only crash of every other event by a mistake.

TomaszA2