LeeS
Imperator
OK. I misunderstood. I thought you were asking what allowed the building of Renaissance Walls and you wanted to delay them becoming available until later in the game.
I see 2 options: you can create a simple lua code which will calculate and add additional gold on turn start but there may be problems with calculating next turn income you may need to check this thing or you can create new city modifier and bound it to new civilization ability (I don't know how exectly it should be done maybe someone who is more experienced in modifiers could help).Is there a way to make a civilization that has the unique ability to have +x amount of gold in each city per turn?
local pPlayer = Players[ playerID ];
pPlayer:GetTreasury():ChangeGoldBalance( iGoldGained );
local pPlayer = Players[ eplayerID ];
for n, pCity in pPlayer:GetCities():Members() do
n = n + 1;
local iGoldGained = n * X_AMOUNT_OF_GOLD_PER CITY;
pPlayer:GetTreasury():ChangeGoldBalance( iGoldGained );
I insert the iGoldGained calculation:
Note: ChangeGoldBalance is available only in gameplay script contextCode:local pPlayer = Players[ eplayerID ]; for n, pCity in pPlayer:GetCities():Members() do n = n + 1; local iGoldGained = n * X_AMOUNT_OF_GOLD_PER CITY; pPlayer:GetTreasury():ChangeGoldBalance( iGoldGained );
I suppose, this is easier to do in XML, SQL. But I have little experience with either, and in doubt: Lua works all the time - somehow.
edit: Does Players:GetCities():GetCount return the number of cities directly?
<ModifierType>MODIFIER_SINGLE_CITY_ADJUST_YIELD_CHANGE</ModifierType>Is there a way to make a civilization that has the unique ability to have +x amount of gold in each city per turn?
ESPIONAGE_MAX_LEVEL
There's a hard-coded limit to how high that can be, or at least there was some time ago (I raised it to 6 but could only get a max of 3 (4?) promotions).
I was able to promote spy so it had all available promotion perks (i don't remember but i think it get 18 lvls) using my mod Cheat Menu for Units. So I think there is no hardcoded lvl limit or it is implemented in some unnatural way.
I was able to promote spy so it had all available promotion perks (i don't remember but i think it get 18 lvls) using my mod Cheat Menu for Units. So I think there is no hardcoded lvl limit or it is implemented in some unnatural way.
I want to run some of my code in UI context so I put a ReplaceUIScript with InGame context. However, my other mod (Cheat Panel) which also uses that Context stopped working. Why is that? Only one allowed? Is there anyway I can create an UI context? My script just need access to some methods, but do not provide any real UI.
Code:<ReplaceUIScript id="SpyPromotionTreeUI"> <Properties> <LoadOrder>150</LoadOrder> <LuaContext>InGame</LuaContext> <LuaReplace>spypromotiontreeUI.lua</LuaReplace> </Properties> </ReplaceUIScript>
How do I properly inject spypromotiontreeUI.lua to any UI context without breaking other mod?
EDIT: seem not problem with the Context, I tried using another context (UnitPanel), Cheat Panel still stops working. Now I wonder what I break. Here is the script:
Code:print("Loaded Spy UI"); spyPromotingUnits = {}; ... Events.UnitAddedToMap.Add(SPT_UnitCreated); Events.UnitPromoted.Add(SPT_CheckSpyPromotion);