[BNW] Unit Production Cost

Proto_Noob

Chieftain
Joined
Jan 11, 2016
Messages
42
This might be kind of a stupid question, but I am having troubles finding something that seems pretty basic to me. Where the hell do we find/edit how much units cost in production? Can't find it anywhere! I want to make a unique unit cheap to build as one of its strengths. Thanks.

EDIT: OK, I see where in the xml MOST units get the cost from. Where do SETTLERS get their production cost from? I want to make an expansionist civ with slightly cheaper settlers that can go anywhere.
 
Last edited:
Code:
		<Row>
			<Class>UNITCLASS_WORKER</Class>
			<Type>UNIT_WORKER</Type>
			<Cost>70</Cost>
			<Moves>2</Moves>
			<Capture>UNITCLASS_WORKER</Capture>
			<CivilianAttackPriority>CIVILIAN_ATTACK_PRIORITY_LOW</CivilianAttackPriority>
			<Domain>DOMAIN_LAND</Domain>
			<DefaultUnitAI>UNITAI_WORKER</DefaultUnitAI>
			<Description>TXT_KEY_UNIT_WORKER</Description>
			<Civilopedia>TXT_KEY_CIV5_ANTIQUITY_WORKER_TEXT</Civilopedia>
			<Strategy>TXT_KEY_UNIT_WORKER_STRATEGY</Strategy>
			<Help>TXT_KEY_UNIT_HELP_WORKER</Help>
			<AdvancedStartCost>20</AdvancedStartCost>
			<WorkRate>100</WorkRate>
			<CombatLimit>0</CombatLimit>
			<UnitArtInfo>ART_DEF_UNIT__WORKER</UnitArtInfo>
			<UnitArtInfoEraVariation>true</UnitArtInfoEraVariation>
			<UnitFlagIconOffset>1</UnitFlagIconOffset>
			<PortraitIndex>1</PortraitIndex>
			<IconAtlas>UNIT_ATLAS_1</IconAtlas>
		</Row>
Table <Units> Column <Cost>. The cost for the worker is 70 hammers on standard game-speed at prince difficulty level.
 
Sorry, didn't expect such a fast reply. I edited my original question, but here is the jist. Where is the production cost of settlers set/determined? It doesn't seem to be in the same place as all the other units.
 
Of course it does. Thanks. I guess I could switch gears and try it another way. Since you cannot reduce the cost of civilian units through a civ's trait, the only way I can think of of giving a civ cheaper settlers is to create a mock policy and grant it for free at the beginning of the game. Would something like that work, or can you think of a better way?
 
@LeeS I found your code for adding a policy at the start of a game here.

local iAbilityEffectDummy = GameInfoTypes.POLICY_BE_FRUITFUL_AND_MULTIPLY
local iRequiredCivilization = GameInfoTypes.CIVILIZATION_ATLANTIS

function AddPolicyOnInit()
for playerID = 0, GameDefines.MAX_MAJOR_CIVS - 1 do
local pPlayer = Players[playerID]
if pPlayer:IsEverAlive() and (pPlayer:GetCivilizationType() == iRequiredCivilization) then
if not pPlayer:HasPolicy(iAbilityEffectDummy) then
pPlayer:SetNumFreePolicies(1)
pPlayer:SetNumFreePolicies(0)
pPlayer:SetHasPolicy(iAbilityEffectDummy, true)
end
end
end
end

Events.SequenceGameInitComplete.Add(AddPolicyOnInit)

So, it works, kind of. It gives me the policy, but then if I look in the policy window it says 999 turns till I can purchase my next policy. However, when I DO earn enough culture to get a new policy it actually allows me to buy one. Then all the policies say it will take an appropriate amount of time for my 2nd(3th with be_fruitful) policy. But when I get there and select one it then says I have enough culture to buy every single policy and have more that half my culture left to spend after doing so. Other than MY mod, I am running vox populi.

Can you think of any reason this is happening? I can't imagine that this hasn't happened before.

P.S.: How does one create a code block in this forum?
 
wrap your code with [.code] and [./code] except without the period characters. If I don't add the period characters to my response the forum just treats it as if I were trying to make a code block and does not show the text needed.

That issue has to be inherent in the current version of the CP DLL, then. It doesn't happen when not using Vox Populi (which requires you use the CP DLL).
 
Back
Top Bottom