Setting raid strategy of IncidentParms

Started by quadroman1, March 25, 2017, 11:19:12 PM

Previous topic - Next topic

quadroman1

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.

RawCode

i see no trace output
is your code actually fire?

quadroman1

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.