TaskForce

A TaskForce is a grouping of units used to enact a plan. It is controlled by the TaskForce table in the Definitions function of a Plan script. A TaskForce is produced by:

If the time cost is less than the goal's build time delay tolerance, then the TaskForce is considered valid and is queued up for production or assembly. As TaskForce can be defined with: However, the default definitions of all TaskForce variables are in PGTaskForce.lua located in Data/Scripts/Library Contrast I mentioned Contrast earlier. Contrast is the relative AI Combat Power of the TaskForce compared to the Target. This can be unit vs unit as well. It can be adjusted with MinContrastScale and MaxContrastScale, which set the minimum and maximum relative combat power, respectively. There is also GlobalContrastScale, which multiplies all contrast modifiers by that amount. Contrast scaling can also be adjusted in the DifficultyAdjustments XML file.
 * Enumerating every unit the AI can build or has in the FreeStore that matches the TaskForce categories/unit names
 * Choosing units that match the contrast with the target or otherwise fulfill the goal
 * Determining the best place to build the units and how long they will take
 * A name, such as MainForce, SpaceForce, or whatever
 * DenyHeroAttach, DenySpecialWeaponAttach prevents heroes or special weapons from being used as part of the task force unless explicitly listed (see hero attachment section for more information)
 * MinimumTotalSize (to control the minimum count of units)
 * MinimumTotalForce (to control the minimum combat power of the TaskForce
 * A set of unit categories (as per unit category masks) that are followed by:
 * A range of numbers e.g. "Fighter = 0, 2" so build between 0 and 2 fighter-class units OR
 * A percentage e.g. "Fighter|Corvette = 100%" so there can be any number of the different unit types but they must constitute the whole TaskForce
 * Specific unit types, e.g. "Corellian_Corvette = 0,1". You can also prevent specific units or unit categories from being used in plans using the - symbol e.g. "-F9TZ_Cloaking_Transport_Company" (the negative doesn't seem to work with percentage based TaskForces)
 * RequiredCategories, a separate table to TaskForce that defines the unit types that MUST be included for the plan to activate
 * TaskForceRequired is used to setup a non-specific TaskForce when you want to have the TaskForce thread build the TaskForce manually using e.g. Collect_All_Free_Units function.