Genghis.Khan
Person
Basically, for the Armenian Civilization to be included in the UnOfficial Expansion: Rise and Fall of Empires Project, the Trait idea was to add Culture and Faith Based on Trade Routes.
I have chosen to add Culture and Faith depending on the Gold generated by Trade Routes, as it takes in account various factors, such as Population or Distance.
My knowdlege of Lua is very limited, but I can follow most of Lua logic, and I can probably do this, if I can undesetand how to do what I want to do.
My Progress
1. It is clear that. the first step is to only execute the Code if the Civilization is Armenia, requiring the Player:GetCivilizationType() Method.
2. Obviously, the second step would be to Calculate the Gold from Trade Routes. After some research on the CivFanatics Modiki I found how that can be accomplished via Player:GetCityConnectionGold().
3. Finnaly, I would have to Add Culture and Faith based on the Gold Per Turn Generation of Trade Routes.
Current Code:
An Example of the Use of Something Similiar can be found in DLC/Expansion/Scenarios/FallOfRomeScenario/TurnsRemaining.lua
Main Questions:
1. Is this possible with Faith?
2. What else do I have to do for Adding Culture based on that iSomething?
Please, post full code, because as I said my knowdlege of Lua is very limited
Sorry fot bothering
- Genghis.Khan
I have chosen to add Culture and Faith depending on the Gold generated by Trade Routes, as it takes in account various factors, such as Population or Distance.
My knowdlege of Lua is very limited, but I can follow most of Lua logic, and I can probably do this, if I can undesetand how to do what I want to do.
My Progress
1. It is clear that. the first step is to only execute the Code if the Civilization is Armenia, requiring the Player:GetCivilizationType() Method.
2. Obviously, the second step would be to Calculate the Gold from Trade Routes. After some research on the CivFanatics Modiki I found how that can be accomplished via Player:GetCityConnectionGold().
3. Finnaly, I would have to Add Culture and Faith based on the Gold Per Turn Generation of Trade Routes.
Current Code:
Code:
[COLOR="DarkSlateBlue"]if[/COLOR] (pPlayer:GetCivilizationType() == GameInfoTypes["CIVILIZATION_ARMENIA"]) [COLOR="DarkSlateBlue"]then[/COLOR]
Player:GetCityConnectionGold()
[COLOR="DarkSlateBlue"]if[/COLOR] Player:GetCityConnectionGold() > 1 [COLOR="DarkSlateBlue"]then[/COLOR]
[COLOR="SeaGreen"]-- Player:ChangeJONSCulture(0.25 * iGoldFromTradeRoutes)
--Player:ChangeFaith(0.10* iGoldFromTradeRoutes)[/COLOR]
[COLOR="DarkSlateBlue"]end
end[/COLOR]
An Example of the Use of Something Similiar can be found in DLC/Expansion/Scenarios/FallOfRomeScenario/TurnsRemaining.lua
Spoiler :
Code:
GameEvents.PlayerDoTurn.Add(function(iPlayer)
--if (iPlayer ~= nil) then
-- print("GameEvents.PlayerDoTurn.Add, iPlayer: " .. iPlayer);
--else
-- print("GameEvents.PlayerDoTurn.Add, iPlayer: nil");
--end
local savedData = Modding.OpenSaveData();
local iCitiesCaptured = 0;
if (IsWesternRoman(iPlayer)) then
iCitiesCaptured = savedData.GetValue("WesternRomeCitiesCaptured");
savedData.SetValue("WesternRomeCitiesCaptured", 0);
elseif (IsEasternRoman(iPlayer)) then
iCitiesCaptured = savedData.GetValue("EasternRomeCitiesCaptured")
savedData.SetValue("EasternRomeCitiesCaptured", 0);
end
print("GameEvents.PlayerDoTurn.Add, iCitiesCaptured: " .. iCitiesCaptured);
if (iCitiesCaptured > 0) then
print("GameEvents.PlayerDoTurn.Add, rewarding culture");
Players[iPlayer]:ChangeJONSCulture(20 * iCitiesCaptured);
end
Main Questions:
1. Is this possible with Faith?
2. What else do I have to do for Adding Culture based on that iSomething?
Please, post full code, because as I said my knowdlege of Lua is very limited
Sorry fot bothering
- Genghis.Khan