Skip to content

BuildWeapons

Changed in 0.2.0

The war factories a computer house resolves a generic factory prerequisite to, in order of preference.

Specification
Applies to
global rules
File
rules.ini
Section
[AI]
Value
typelist
When omitted
(empty)

BuildWeapons lists the structures the game treats as war factories, in order of preference. A house’s preferred war factory is the first entry its country may own. The country is the one the house acts as. Owning any entry counts as owning a war factory.

A computer house uses the list in these decisions:

  • Base plan. While the base plan is assembled, a Prerequisite=FACTORY is met only by the house’s preferred war factory. That structure also moves to second place in the order the plan considers structures. If the country may own no entry, no type that needs FACTORY enters the plan.

  • Whether it can still earn. A house that owns a refinery but no harvester can still earn money if any of these holds:

    • it owns a war factory and can afford a harvester;
    • it can afford a harvester and a war factory together;
    • it can afford a refinery.

    The war factory in the second case is priced as the preferred one, as the first entry when the country may own none, and at nothing when the list is empty. A house that cannot earn may sell its base.

  • What a sale pays for. A house selling its base raises money for a harvester if it owns a refinery and a war factory, and for a refinery otherwise.

  • Production while short of credits. Outside a campaign, a house whose credits are below AIAlternateProductionCreditCutoff and that owns no war factory switches back to structures after each vehicle, infantryman or aircraft it produces.

The list also affects the deploy cursor. For a vehicle whose DeploysInto names a listed structure, the cursor tests the site one cell northwest of the vehicle, which is where the structure is placed when the vehicle deploys. For a structure in neither this list nor BuildConst, the cursor tests the vehicle’s own cell instead.

See also — ai-base-building

History

  1. Changed0.2.0In development

    Count every listed refinery and harvester

  2. Changed0.2.0In development

    Ask the whole war factory list who owns one

  3. Changed0.2.0In development

    Resolve every role list against the country a house acts as