Units upkeep cost in strategic resources

PabloX

Chieftain
Joined
Sep 29, 2018
Messages
48
Hi guys!!!

So hi everyone, I am new at this forum but Im making a very HUGE mod for Civ5 and I am curious is it possible to make units upkeep cost in strategic resources instead gold??? cause Im wanted to add buildings that will produce resources etc. Plz guys help, Im will be very grateful. Oh and sorry for my english btw, have a nice day for all of you ;)
 
For the Gold Maintenance costs, in a unit's definition in table <Units>
Code:
<NoMaintenance>true</NoMaintenance>
The game will not remove units that are over the limit in strategic resources. It will merely penalize all units that need that resource during combat.
 
Thx @LeeS for informations :) and if you have such a great knowledge can you show me some example of units that upkeep cost is 1 gold and... two irons in definition table??? it will be great. Im just must look on it and I will know.
 
Units don't have a way to directly state the amount of maintenance per turn a unit needs in terms of Gold. There is only the ability to make the unit free of maintenance. Gold maintenance costs scale by era, and the base gold costs per turn of all of a player's units is defined in the gamespeeds, difficulty levels, and the like. Certain policies and leader traits also can reduce the gold costs of unit maintenance. At lower difficulty levels, for example, a certain number of units are free of gold maintenance costs.

The cost in resources to build or purchase a unit is defined in table <Unit_ResourceQuantityRequirements>, as in this snippet taken from the base game files:
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_ROMAN_LEGION</UnitType>
			<ResourceType>RESOURCE_IRON</ResourceType>
		</Row>
		<Row>
			<UnitType>UNIT_HORSEMAN</UnitType>
			<ResourceType>RESOURCE_HORSE</ResourceType>
		</Row>
		<Row>
			<UnitType>UNIT_GREEK_COMPANIONCAVALRY</UnitType>
			<ResourceType>RESOURCE_HORSE</ResourceType>
		</Row>
		<Row>
			<UnitType>UNIT_KNIGHT</UnitType>
			<ResourceType>RESOURCE_HORSE</ResourceType>
		</Row>
		<Row>
			<UnitType>UNIT_BOMBER</UnitType>
			<ResourceType>RESOURCE_OIL</ResourceType>
		</Row>
		<Row>
			<UnitType>UNIT_AMERICAN_B17</UnitType>
			<ResourceType>RESOURCE_OIL</ResourceType>
		</Row>
		<Row>
			<UnitType>UNIT_ATOMIC_BOMB</UnitType>
			<ResourceType>RESOURCE_URANIUM</ResourceType>
		</Row>
		<Row>
			<UnitType>UNIT_ROCKET_ARTILLERY</UnitType>
			<ResourceType>RESOURCE_ALUMINUM</ResourceType>
		</Row>
	</Unit_ResourceQuantityRequirements>
The definition of the table as provided by Firaxis is:
Code:
	<Table name="Unit_ResourceQuantityRequirements">
		<Column name="UnitType" type="text" reference="Units(Type)"/>
		<Column name="ResourceType" type="text" reference="Resources(Type)"/>
		<Column name="Cost" type="integer" default="1"/>
	</Table>
So if I want to make the Rocket Artillery unit use 2 Aluminum instead of the default "1", I would make an update to the table as:
Code:
	<Unit_ResourceQuantityRequirements>
		<Update>
			<Where UnitType="UNIT_ROCKET_ARTILLERY" />
			<Set Cost="2" />
		</Update>
	</Unit_ResourceQuantityRequirements>
 
Ok many thx again:) I have last question: Is it possible to make for example unit that costs 2 horse resources and if I have 3 that resources after buying that unit now I will have 1 resource of horse beacouse that unit cost 2 horse is it possible to done something like this Mr. @LeeS???
 
That's exactly how the game works. You won't be able to build any more of the unit requiring two horses until you've acquired more horses, or an existing horse unit dies. What you are describing is the exact same behaviour as the standard Atomic Bomb and Nuclear Missile units (the former requires one uranium, the latter two), so suggest you take a look at those units.
 
Ok many thx @whoward69, my mainly idea is to make units upkeep cost not only in gold but in resources too and create buildings that produces resources, basically make civ more strategicly :) thx again
 
Back
Top Bottom