How do I use this function:
OpenRangedAttackModifier()
the wiki doesn't help in the slightest on what it even does; I'm looking for ways to dynamically increase a unit's ranged attack
So, I'm trying to get this statement to work:
pUnit:SetHasPromotion(GameInfoTypes["PPROMOTION_MENTAL_RANGEDBOOST_LEVEl"..iSlot],true)
but it doesn't seem to be working, can I not use brackets for this?
print("PPROMOTION_MENTAL_RANGEDBOOST_LEVEl"..iSlot)
GameInfoTypes["PPROMOTION_MENTAL_RANGEDBOOST_LEVEl"..iSlot]
Not directly. In fact, there is no direct Lua API for any type of management of great works (create, delete, remove, add, etc) - why would modders possibly want to do anything over and above what Firaxis needed for the base gameIs there, by chance, a way to delete a great work?
Not directly. In fact, there is no direct Lua API for any type of management of great works (create, delete, remove, add, etc) - why would modders possibly want to do anything over and above what Firaxis needed for the base game
The only way to delete a great work is to delete the building it's in - via SetNumRealBuildings() or whatever the method is called.
But that's only a small part of the problem. As you've discovered, you can only move GWs between the same player's cities/buildings, and you can only swap GWs on a one-for-one basis. So, to steal a GW you're going to have to create a fake GW (via a hidden building) for the player doing the stealing and then swap with the GW of the player you're stealing from. So far, so good. You now need to find the fake GW and delete it - but to do this you have to delete the building it's in, so you'll need another hidden building with a single empty GW slot, give that to the target player's city, swap the GW into it and then delete the building. Still not a major problem. But IIRC once a GW is gone you can't get it back, so for every GW you can steal you'll need both a fake GW and a hidden building to put it in. Assuming the player could steal every possibly GW in the base game, that's a heck of a lot of fake GW and hidden buildings. You could limit the number by saying the ability to steal GWs can only be used X times, but you'll still need X fake GWs and X hidden buildings to put them in and the extra (reusable) building to move them to to effect the delete.
This ties into the bullet item about "After a Civilization discovers Metallurgy..."
- When a mine is constructed in the territory of CIVILIZATION_SENSHI_CORNWALL, it has a 10% chance of spawning 2 of the Strategic Resource RESOURCE_SENSHI_TIN if Cornwall hasn't discovered Metallurgy, and a copy of the Luxury Resource RESOURCE_SENSHI_TIN_LUX if they have on the tile.
I also assume you mean "next to" when you say "within one tile of"
- When UNIT_SENSHI_DROLL begins a turn within one tile of a city, its owner is provided with +1 Gold and +1 Faith.
- When UNIT_SENSHI_DROLL begins a turn within one tile of a city without the building BUILDING_SENSHI_VISITED, its owner is provided with +25 Gold and +25 Faith, and BUILDING_SENSHI_VISITED is added to the city.
BUILDING_SENSHI_SEA_GOLD
BUILDING_SENSHI_LAND_GOLD
They shouldn't be able to normally, but if they capture or otherwise come into possession of a city where Tin has already been spawned, then they would.
- Can any civilization besides CIVILIZATION_SENSHI_CORNWALL get copies of RESOURCE_SENSHI_TIN via this sort of mechanic: This ties into the bullet item about "After a Civilization discovers Metallurgy..."
by "its owner" I meant the owner of the Droll Teller, not the City. Sorry, that was a big error on my part.[*]Who do you mean when you say "its":
Next to or within a city, preferably, but next to is fine.I also assume you mean "next to" when you say "within one tile of"
They're both generic dummy buildings, with SEA_GOLD having a TradeRouteSeaGoldBonus value of 100 (a la the Harbour), and LAND_GOLD having a TradeRouteLandGoldBonus value of 200 (a la the Caravansary)[*]How are these two buildings defined in the xml/sql?Code:BUILDING_SENSHI_SEA_GOLD BUILDING_SENSHI_LAND_GOLD
Yes indeed[*]I assume BNW only (yes/no)
I may be able to have time to look at it tomorrow.They shouldn't be able to normally, but if they capture or otherwise come into possession of a city where Tin has already been spawned, then they would. by "its owner" I meant the owner of the Droll Teller, not the City. Sorry, that was a big error on my part. Next to or within a city, preferably, but next to is fine. They're both generic dummy buildings, with SEA_GOLD having a TradeRouteSeaGoldBonus value of 100 (a la the Harbour), and LAND_GOLD having a TradeRouteLandGoldBonus value of 200 (a la the Caravansary)
Yes indeed
For the building then why cannot the same building merely have both commands (land and sea) ?
--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-- DATA VARIABLES
--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
local iCornwallCiv = GameInfoTypes.CIVILIZATION_SENSHI_CORNWALL
local iMetallugyTech = GameInfoTypes.TECH_METALLURGY
local iMineImprovement = GameInfoTypes.IMPROVEMENT_MINE
local iResourcePlacementChancePercentage = 10 -- (10 = 10% chance)
local iResourceStrategicAmountToGive = 2
local iTinStrategic, iTinLuxury = GameInfoTypes.RESOURCE_SENSHI_TIN, GameInfoTypes.RESOURCE_SENSHI_TIN_LUX
local iUnitCornwallDroll, iBuildingDrollHasVisitedCity = GameInfoTypes.UNIT_SENSHI_DROLL, GameInfoTypes.BUILDING_SENSHI_VISITED
local iBuildingCornwallStannary = GameInfoTypes.BUILDING_SENSHI_STANNARY
local iBuildingCornwallSeaGold, iBuildingCornwallLandGold = GameInfoTypes.BUILDING_SENSHI_SEA_GOLD, GameInfoTypes.BUILDING_SENSHI_LAND_GOLD
local iDrollFirstVisitGold, iDrollFirstVisitFaith = 25, 25
local iDrollLaterVisitGold, iDrollLaterVisitFaith = 1, 1
--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-- BEHAVIOR CONTROL VARIABLES
--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
local bDrollEffectOnlyFromForiegnCities = true
-- should the Droll Teller effect be given only from visiting foriegn cities
local bDrollEffectFromEnemyCities = false
-- should the Droll Teller effect be given from visiting cities the Cornwall player is at war with
local bDrollEffectFromCityStateCities = true
-- should the Droll Teller effect be given from visiting city-states
local bTinCannotReplaceOtherResources = true
-- should 'tin' replace an existing resource
local bMineMustBeInPlayerTerritory = true
-- does a mine need to be in the territory of a Cornwall player
local bDoDrollEffectFromPassingByCity = false
--this will turn on a UnitSetXY event for the Droll Teller 'passing by' a city
--if you turn this on there will be perceptible processing lag when moving a Droll Teller
--if you turn this on there is a possibility the same Droll Teller will give '1' gold and faith from the same city twice on the same turn