Unique Improvements require policy

ComradeKristov

Warlord
Joined
Dec 30, 2009
Messages
170
Location
Chicago,Il
Is it possible to make a unique improvement require a policy? I want to make the Moai Statues improvement require tradition and the tipi to require liberty.

Moderator Action: Moved to main C&C forum.
 
Yes its possible, we use this mechanic in CCTP.

This lua code grants a technology when you adopt a policy.

Code:
------Provides a Technology when the named Policy is adopted------

GameEvents.PlayerAdoptPolicy.Add(
function(iPlayer, policyID)
local player = Players[iPlayer];
local pTeam = Teams[player:GetTeam()];
local iTechIndex = GameInfoTypes["TECH_CTTPDUMMYTECH1"];
if policyID == GameInfo.Policies["POLICY_CCTP174"].ID then
pTeam:SetHasTech(iTechIndex, true)
end
end)

So all you need is to link the improvement to the new technology (i suggest a technology that cant be researched).
 
So I just make a few dummy techs and put them off screen on the x/y coordinates on the tech screen. Thanks Gilga
 
Top Bottom