Protroid
Chieftain
If this wouldn't be too much of a bother, could someone write some LUA code that would place a building in a civ's capitol after it researched a certain technology?
Just some code that is needed for the Upcoming Vietnam release:
Defensive structures within a city increases the spawn rate of Great Writers, Artists and Musicians.
So essentially Walls, Castles, Arsenals and Military Bases increases the spawn rate of GWAMs by 10% Each.
Also -
Receive +5% Culture and +5% Food in each city for each Social Policy adopted in the Honor Tree.
Each policy (not the opener).
We'd be forever indebted to whoever can do this. Cheers.
A UI for Afghanistan:
Can be built on any land tile and provides +1 Gold and +1 Food, with their tile yields doubled if built adjacent to a mountain. Trade Routes that pass over a tile with a Dida generate points towards Great Writers in the Capital. Units stationed on a Dida receive also receive a 15% bonus defensive combat bonus.
Quick request: Is it possible to make a UI provide a source of fresh water to all the tiles around (i.e. touching) it through lua? If so, I'm requesting that
No and yes.
Directly in XML/Lua - no
Indirectly by putting an oasis like feature under the UI when it is built - yes. But that will depend on if it's acceptable for the UI to remove any existing feature on the tile.
Is it possible to have a script add all buildings to a city in a custom scenario on startup?
The only bit that actually requires Lua is the Trade Routes passing over Didas generating Great Writer points!
Alright then, I hereby request just this!
For the Unique Ability:
A script/promotion that gives +1 Movement and the ability to withdraw before being captured/destroyed to Workers, Settlers, and Great People. If we can't get the withdraw, I suppose some other method that prevents them from being captured or destroyed would work. We have the +1 movement for the Workers and Settlers already, but I dunno how we could get the +1 movement for ALL BNW great people (excluding maybe the Admiral), and keep it civ-specific. We tried to give the "withdraw before melee" promotion to some civilian units, but I suppose it only triggers on a melee battle, and not a straightforward capture.
For the Unique Building:
This building (BUILDING_BOERSTAATSMUSEUM) needs 2 attributes: 25% of the city's Tourism output is converted into Growth. So for example, if your city is providing 20 Tourism per turn, the city's food growth rate is increased by 5%. The other attribute: Every Farm worked by this city provides points towards a Golden Age. This would probably apply to the civ-specific Farm replacement (IMPROVEMENT_BOERFARM), as opposed to the normal Farm. Though, if it's possible, both could work. As for the specific number of golden age points per farm, 1 or 2 sounds fair considering how many farms you're bound to have by then.
local iBoers = GameInfoTypes.CIVILIZATION_BOERS
local iUB = GameInfoTypes.BUILDING_BOERSTAATSMUSEUM
local iGrowthDummy = GameInfoTypes.BUILDING_BOER_GROWTHDUMMY
local iImprovement = GameInfoTypes.IMPROVEMENT_BOERFARM
function BoerUniqueBuilding(iPlayer)
if iPlayer < GameDefines.MAX_MAJOR_CIVS then
local pPlayer = Players[iPlayer]
if pPlayer:GetCivilizationType() == iBoers then
for pCity in pPlayer:Cities() do
--Growth Bonus
local iGrowthMod = math.floor(pCity:GetBaseTourism() / 4)
pCity:SetNumRealBuilding(iGrowthDummy, iGrowthMod)
--Golden Age from Farm
local iNumPlots = pCity:GetNumCityPlots()
local iTotalFarms = 0;
for iPlot = 0, iNumPlots - 1 do
local pPlot = pCity:GetCityIndexPlot(iPlot)
if pPlot and pPlot:GetOwner() == iPlayer and pPlot:GetImprovementType() == iImprovement then
iTotalFarms = iTotalFarms + 1
end
end
pPlayer:ChangeGoldenAgeProgressMeter(iTotalFarms)
end
end
end
end
GameEvents.PlayerDoTurn.Add(BoerUniqueBuilding)
And, for the Unique Unit, shouldn't require a degree in Rocket Science like the other 2:
A promotion that gives a 25% defensive bonus when stationed on a Farm. (Normal farm or Boer farm, though probably the Boer farm first and foremost.)
local iUU = GameInfoTypes.BUILDING_BOER_UU
local iPromotion = GameInfoTypes.PROMOTION_BOER_UU_PROMOTION
local iImprovement = GameInfoTypes.IMPROVEMENT_BOERFARM
function BoerUniqueUnit(iPlayer, iUnitID)
if iPlayer < GameDefines.MAX_MAJOR_CIVS then
local pPlayer = Players[iPlayer]
local pUnit = pPlayer:GetUnitByID(iUnitID)
if pUnit:GetUnitType() == iUU then
local pPlot = pUnit:GetPlot()
if pPlot:GetImprovementType() == iImprovement then
pUnit:SetHasPromotion(iPromotion, true)
return
end
end
pUnit:SetHasPromotion(iPromotion, false)
end
end
GameEvents.UnitSetXY.Add(BoerUniqueUnit)
A. Create a "combat" version of Settlers/Workers/GPs, and have them automatically replace the default versions when the Civ creates them. And by "combat," I mean they have 1 Strength and a promotion to give them 100% withdrawal chance.
The civ will then only be playable by a human, as the AI is incapable of using secondary found/work abilities for combat units.