Just wanting to see if the coding on the decisions for Wallachia are solid:
http://pastebin.com/DVX1PWWG
My only questions are if the part about using Piety and Prestige means it HAS to be on, or if Wallachia can still be played without it, and with the part in the first decision where I attempt to give all cities one of the four defensive buildings. The idea was to have the function see if the city had walls and give it some if it didn't; if it did, it would move on to the castle building. I'm hoping it's not set to give ALL the defensive buildings, really.
Oh, and I forgot to put the "1" after the Arsenal and Military Base, but it's after each in the lua file.
Code:
Decisions_OrderDragon.Desc = Locale.ConvertTextKey("TXT_KEY_DECISIONS_WALLACHIA_ORDER_OF_THE_DRAGON_DESC", religionType, goldCost, reward, yield)
The problem here is that you've got three empty variables: religionType, reward, and yield. You need to define them above that line. Presumably you're switching faith for piety, in which case add in:
Code:
local reward = mathCeil(70 * iMod)
local yield = "[ICON_PEACE] Faith"
local religionType = "majority religion"
if isUsingPietyPrestige then
religionType = "State Religion"
yield = "[ICON_JFD_PIETY] Piety"
reward = mathCeil(25 * iMod)
end
The line about the "local magistrateCost = 2" is not needed, as you don't use it. There's also a discrepancy - you say the player needs 2, but it only removes 1 in the function below it. The "local magistrateCost = 1" variable is not needed either as, again, you check for the number directly when you remove the magistrates with ChangeNumResourceTotal.
Code:
player:ChangeFaith=math.ceil(30 * pPlayer:GetNumCities() * iMod)
Rogue "=" sign. Destroy it before it destroys you!
Your defensive buildings part will not work as pPlayer doesn't exist (the player object is called "player," as can be seen in the " function(player)" part. I also don't think it's doing what you want it to do, so it should be:
Code:
for city in player:Cities() do
if not (city:IsHasBuilding(GameInfoTypes.BUILDING_WALLS)) then
city:GetNumFreeBuilding(GameInfoTypes.BUILDING_WALLS, 1)
elseif not (city:IsHasBuilding(GameInfoTypes.BUILDING_CASTLE)) then
city:GetNumFreeBuilding(GameInfoTypes.BUILDING_CASTLE, 1)
elseif not (city:IsHasBuilding(GameInfoTypes.BUILDING_ARSENAL)) then
city:GetNumFreeBuilding(GameInfoTypes.BUILDING_ARSENAL, 1)
elseif not (city:IsHasBuilding(GameInfoTypes.BUILDING_MILITARY_BASE)) then
city:GetNumFreeBuilding(GameInfoTypes.BUILDING_MILITARY_BASE, 1)
end
end
pCity to city is just a style choice, but there may only be one "else" clause in a declarative statement. Use elseif to setup additional conditions.
Everything else seems to be in order with the first decision, though you'll want to use:
Code:
Decisions_AddCivilisationSpecific(civilisationID, "Decisions_OrderDragon", Decisions_OrderDragon)
Instead of
Code:
tDecisions["Decisions_OrderDragon"] = Decisions_OrderDragon
That way, the decision won't be added unless Wallachia is actually in the game - saving precious processing power.
The second decision has a few of the same errors. See if you can fix them up given what I've highlighted above.
Oh, and yes, P&P support will switch on naturally, but if one is not using P&P, then it'll revert to default (in the case of the first decision, requiring the majority religion and giving faith).