Skip to content

Upgrade

XML Elements

The following elements can be used within this component:

Upgrade

Entity

Entity to upgrade to

Type: text

Path: Upgrade/Entity

Icon

Icon to show in the GUI

Type: text

Path: Upgrade/Icon

Variant

The name of the variant to switch to when upgrading

Type: text

Path: Upgrade/Variant

Tooltip

This will be added to the tooltip to help the player choose why to upgrade.

Type: text

Path: Upgrade/Tooltip

Time

Time required to upgrade this entity, in seconds

Type: non-negative integer (e.g. 0 or 5)

Path: Upgrade/Time

Cost

Resource cost to upgrade this unit

Path: Upgrade/Cost

food

Type: non-negative integer (e.g. 0 or 5)

Path: Upgrade/Cost/food

wood

Type: non-negative integer (e.g. 0 or 5)

Path: Upgrade/Cost/wood

stone

Type: non-negative integer (e.g. 0 or 5)

Path: Upgrade/Cost/stone

metal

Type: non-negative integer (e.g. 0 or 5)

Path: Upgrade/Cost/metal

Requirements

The requirements that ought to be met before this entity can be produced.

Path: Upgrade/Requirements

All

Requires all of the conditions to be met.

Path: Upgrade/Requirements/All

Entities

Entities that need to be controlled.

Path: Upgrade/Requirements/All/Entities

{EntitiesType}

Class of entity that needs to be controlled.

Path: Upgrade/Requirements/All/Entities/{EntitiesType}

Count

Number of entities required.

Type: non-negative integer (e.g. 0 or 5)

Path: Upgrade/Requirements/All/Entities/{EntitiesType}/Count

Variants

Number of different entities of this class required.

Type: non-negative integer (e.g. 0 or 5)

Path: Upgrade/Requirements/All/Entities/{EntitiesType}/Variants

Techs

White-space separated list of technologies that need to be researched. ! negates a tech.

Type: text

Path: Upgrade/Requirements/All/Techs

Any

Requires at least one of the following conditions met.

Path: Upgrade/Requirements/Any

Entities

Entities that need to be controlled.

Path: Upgrade/Requirements/Any/Entities

{EntitiesType}

Class of entity that needs to be controlled.

Path: Upgrade/Requirements/Any/Entities/{EntitiesType}

Count

Number of entities required.

Type: non-negative integer (e.g. 0 or 5)

Path: Upgrade/Requirements/Any/Entities/{EntitiesType}/Count

Variants

Number of different entities of this class required.

Type: non-negative integer (e.g. 0 or 5)

Path: Upgrade/Requirements/Any/Entities/{EntitiesType}/Variants

Techs

White-space separated list of technologies that need to be researched. ! negates a tech.

Type: text

Path: Upgrade/Requirements/Any/Techs

Entities

Entities that need to be controlled.

Path: Upgrade/Requirements/Entities

{EntitiesType}

Class of entity that needs to be controlled.

Path: Upgrade/Requirements/Entities/{EntitiesType}

Count

Number of entities required.

Type: non-negative integer (e.g. 0 or 5)

Path: Upgrade/Requirements/Entities/{EntitiesType}/Count

Variants

Number of different entities of this class required.

Type: non-negative integer (e.g. 0 or 5)

Path: Upgrade/Requirements/Entities/{EntitiesType}/Variants

Techs

White-space separated list of technologies that need to be researched. ! negates a tech.

Type: text

Path: Upgrade/Requirements/Techs

Tooltip

A tooltip explaining the requirements.

Type: text

Path: Upgrade/Requirements/Tooltip

CheckPlacementRestrictions

Upgrading will check for placement restrictions (nb:GUI only)

Path: Upgrade/CheckPlacementRestrictions

RELAX NG Grammar

<define name="component.Upgrade">
  <element name="Upgrade">
    <interleave>
      <oneOrMore>
        <element>
          <anyName/>
          <interleave>
            <element name="Entity"/>
            <optional>
              <element name="Icon"/>
            </optional>
            <optional>
              <element name="Variant"/>
            </optional>
            <optional>
              <element name="Tooltip"/>
            </optional>
            <optional>
              <element name="Time">
                <data type="nonNegativeInteger"/>
              </element>
            </optional>
            <optional>
              <element name="Cost">
                <oneOrMore>
                  <choice>
                    <interleave>
                      <optional>
                        <element name="food">
                          <data type="nonNegativeInteger"/>
                        </element>
                      </optional>
                      <optional>
                        <element name="wood">
                          <data type="nonNegativeInteger"/>
                        </element>
                      </optional>
                      <optional>
                        <element name="stone">
                          <data type="nonNegativeInteger"/>
                        </element>
                      </optional>
                      <optional>
                        <element name="metal">
                          <data type="nonNegativeInteger"/>
                        </element>
                      </optional>
                    </interleave>
                  </choice>
                </oneOrMore>
              </element>
            </optional>
            <optional>
              <element name="Requirements">
                <optional>
                  <choice>
                    <element name="All">
                      <oneOrMore>
                        <choice>
                          <element name="Entities">
                            <oneOrMore>
                              <element>
                                <anyName/>
                                <oneOrMore>
                                  <choice>
                                    <element name="Count">
                                      <data type="nonNegativeInteger"/>
                                    </element>
                                    <element name="Variants">
                                      <data type="nonNegativeInteger"/>
                                    </element>
                                  </choice>
                                </oneOrMore>
                              </element>
                            </oneOrMore>
                          </element>
                          <element name="Techs">
                            <attribute name="datatype">
                              <value>
                              </value>
                            </attribute>
                            <text/>
                          </element>
                        </choice>
                      </oneOrMore>
                    </element>
                    <element name="Any">
                      <oneOrMore>
                        <choice>
                          <element name="Entities">
                            <oneOrMore>
                              <element>
                                <anyName/>
                                <oneOrMore>
                                  <choice>
                                    <element name="Count">
                                      <data type="nonNegativeInteger"/>
                                    </element>
                                    <element name="Variants">
                                      <data type="nonNegativeInteger"/>
                                    </element>
                                  </choice>
                                </oneOrMore>
                              </element>
                            </oneOrMore>
                          </element>
                          <element name="Techs">
                            <attribute name="datatype">
                              <value>
                              </value>
                            </attribute>
                            <text/>
                          </element>
                        </choice>
                      </oneOrMore>
                    </element>
                    <element name="Entities">
                      <oneOrMore>
                        <element>
                          <anyName/>
                          <oneOrMore>
                            <choice>
                              <element name="Count">
                                <data type="nonNegativeInteger"/>
                              </element>
                              <element name="Variants">
                                <data type="nonNegativeInteger"/>
                              </element>
                            </choice>
                          </oneOrMore>
                        </element>
                      </oneOrMore>
                    </element>
                    <element name="Techs">
                      <attribute name="datatype">
                        <value>
                        </value>
                      </attribute>
                      <text/>
                    </element>
                  </choice>
                </optional>
                <optional>
                  <element name="Tooltip"/>
                </optional>
              </element>
            </optional>
            <optional>
              <element name="CheckPlacementRestrictions">
                <empty/>
              </element>
            </optional>
          </interleave>
        </element>
      </oneOrMore>
    </interleave>
  </element>
</define>