I have a new building (a water well) that I want to make available in a city production list but only if the city is NOT built on a river OR does not have a river available within it's production zone AND is not on the coast. How can this be done?
I don't believe there is an XML command that will allow you to do this. What I would do is make the Well mutually exclusive to the Watermill OR create a free building that requires a river in the city center that is mutually exclusive to the well. Just don't give the free building any benefits.I have a new building (a water well) that I want to make available in a city production list but only if the city is NOT built on a river OR does not have a river available within it's production zone AND is not on the coast. How can this be done?
Be careful with adding checks on the UI part of the code, as the AI could totally ignore it.The only way I know to currently do all that is with an edit to the production lua to check for it. If you really want to have all those parameters, I would be glad to try to help you with the lua edit.
You can check for adjacent resources but not resources in city radius like Forge or Stoneworks in civ5What I would like is to have resources as a prerequisite for constructing buildings.
Adjacent resources only works for Wonders right now not buildings. Firaxis put a note in there stating this. Not everything in the buildings table works for buildings.Be careful with adding checks on the UI part of the code, as the AI could totally ignore it.
gyogen2, did you test this in-game to see whether the AI would still build it? It would be great if we can just code requirements in Lua but for Civ5 it required custom events modded into the dll before we could do this.
You can check for adjacent resources but not resources in city radius like Forge or Stoneworks in civ5
The hidden dummy building was a tried and trusted way of modding otherwise impossible effects in Civ5 and i expect it to come back to Civ6.
<Row>
<RequirementId>REQUIRES_PLOT_IS_NOT_OWNER_CAPITAL_CONTINENT</RequirementId>
<RequirementType>REQUIREMENT_PLOT_IS_OWNER_CAPITAL_CONTINENT</RequirementType>
<Inverse>true</Inverse>
</Row>
I don't think buildings use the Requirements table. It looks like they still uses old fixed requirements rather than the new more flexible Requirements and RequirementSets tables.I haven't really tested this out yet, but maybe you could have a look at the <Inverse> command, like this one for example (Improvements.xml):
Code:<Row> <RequirementId>REQUIRES_PLOT_IS_NOT_OWNER_CAPITAL_CONTINENT</RequirementId> <RequirementType>REQUIREMENT_PLOT_IS_OWNER_CAPITAL_CONTINENT</RequirementType> <Inverse>true</Inverse> </Row>
I don't believe there is an XML command that will allow you to do this. What I would do is make the Well mutually exclusive to the Watermill OR create a free building that requires a river in the city center that is mutually exclusive to the well. Just don't give the free building any benefits.