Required Resources (Units)

Riker13

King
Joined
Nov 9, 2001
Messages
853
Location
UK
Unless I have missed it somewhere, could someone please tell me how you set certain resources to your unique unit as a prerequisite in XML?

Many Regards

Riker13 :crazyeye:
 
look at how other unique units that require resources are done?
 
Code:
<Unit_ResourceQuantityRequirements>
        <Row>
            <UnitType>UNIT_CHARIOT_ARCHER</UnitType>
            <ResourceType>RESOURCE_HORSE</ResourceType>
        </Row>
        <Row>
            <UnitType>UNIT_SWORDSMAN</UnitType>
            <ResourceType>RESOURCE_IRON</ResourceType>
        </Row>
        <Row>
            <UnitType>UNIT_BARBARIAN_SWORDSMAN</UnitType>
            <ResourceType>RESOURCE_IRON</ResourceType>
        </Row>
        <Row>
            <UnitType>UNIT_IROQUOIAN_MOHAWKWARRIOR</UnitType>
            <ResourceType>RESOURCE_IRON</ResourceType>
        </Row>

...

</Unit_ResourceQuantityRequirements>

That's how it's done with vanilla units. Just add to that table for your custom units.
 
I forget, can you make a unit require two resource types?

how does that code look?
 
I forget, can you make a unit require two resource types?
how does that code look?
Code:
<Unit_ResourceQuantityRequirements>
        <Row>
            <UnitType>UNIT_CHARIOT_ARCHER</UnitType>
            <ResourceType>RESOURCE_HORSE</ResourceType>
        </Row>
        <Row>
            <UnitType>UNIT_CHARIOT_ARCHER</UnitType>
            <ResourceType>RESOURCE_IRON</ResourceType>
        </Row>

...

</Unit_ResourceQuantityRequirements>

Methinks it would look like that. Two entries for a unit, one for each of the different resources.
 
Top Bottom