Need some weight/factor curve help. Thx.

Started by togfox, March 10, 2019, 06:26:38 AM

Previous topic - Next topic

togfox

Anyone worked out how the weight curves/probabilities/rng works in the xml? The example is from the vanilla XML. Would like to know the correct way to adjust weight curve and factor curve.


    <selectionWeightCurve>
      <points>
        <li>(250, 0)</li>
        <li>(800, 50)</li>
        <li>(2000, 80)</li>
      </points>
    </selectionWeightCurve>
    <pointsFactorCurve>
      <points>
        <li>0, 0.5</li>
        <li>5000, 0.3</li>
      </points>
    </pointsFactorCurve>

togfox

Not sure if this helps - it reads like french to me:


if (!(from d in DefDatabase<PawnsArrivalModeDef>.AllDefs
where d.forQuickMilitaryAid
select d).Any((PawnsArrivalModeDef d) => d.Worker.GetSelectionWeight(parms) > 0f))
{
parms.raidArrivalMode = ((Rand.Value >= 0.6f) ? PawnsArrivalModeDefOf.CenterDrop : PawnsArrivalModeDefOf.EdgeDrop);
return;
}



I'm pretty sure the secret is in there somewhere.