Ludeon Forums

RimWorld => Mods => Help => Topic started by: quadroman1 on March 25, 2017, 11:19:12 PM

Title: Setting raid strategy of IncidentParms
Post by: quadroman1 on March 25, 2017, 11:19:12 PM
I'm trying to set the raid strategy of an IncidentParms instance for a raid I'm manually calling in my raid.  I want to set "raidStrategy" to Immediate Attack but it doesn't seem to be working as I still get raids that are set to wait and then attack.

Here's a snippet of my code where I'm trying to set the raid strategy.


while (!raidFaction.HostileTo(Faction.OfPlayer))
{
Find.FactionManager.TryGetRandomNonColonyHumanlikeFaction(out raidFaction, true, false);
        parms.faction = raidFaction;
}

parms.raidArrivalMode = PawnsArriveMode.CenterDrop;
parms.raidStrategy = new RaidStrategyWorker_ImmediateAttack().def;


EDIT: Go figure, I figure it out right after I make a post.  I had to do "parms.raidStrategy = RaidStrategyDefOf.ImmediateAttack;" instead.
Title: Re: Setting raid strategy of IncidentParms
Post by: RawCode on March 26, 2017, 03:38:49 AM
i see no trace output
is your code actually fire?
Title: Re: Setting raid strategy of IncidentParms
Post by: quadroman1 on March 26, 2017, 12:40:22 PM
Quote from: RawCode on March 26, 2017, 03:38:49 AM
i see no trace output
is your code actually fire?

I didn't paste the entire cs file, just the part that was supposed to set the raid strategy.