Ludeon Forums

RimWorld => Mods => Help => Topic started by: q308744928 on November 01, 2021, 03:25:42 PM

Title: how to call a method?
Post by: q308744928 on November 01, 2021, 03:25:42 PM
Hi everyone. This is a trigger for a super weapon(Droner, WeatherControlor, SunBlocker etc.) in the mech cluster, when the countdown this.ticksToInsanityPulse reaches 0, the function this.DoDronerInsanityField() works.
As we know sometime when the super weapon landed, the game gives it an Initialization timer, usually 7 to 15 days. My problem is !a.Active does not work, it always give a true value even when the Initialization timer is not 0.
How can i properly get this Active feedback?
public override void CompTick()
{
CompCauseGameCondition a = new CompCauseGameCondition();
if (!this.parent.Spawned || !a.Active)
{
return;
}
this.ticksToInsanityPulse--;
if (this.ticksToInsanityPulse <= 0)
{
this.DoDronerInsanityField();
this.ticksToInsanityPulse = this.Props.pulseInterval.RandomInRange;
}
}