Wonder conditions

adan_eslavo

Archmage of all Pixels
Supporter
Joined
Apr 23, 2017
Messages
3,488
Location
Łódź, Poland
I want to make wonder that require mine in city borders. I do check in lua using CityCanConstruct GameEvent and it works, but... I would like to create something like:
  • if in the city cannot be built any mine, DON'T SHOW WONDER,
  • if city has resource that can have mine on it, but there's no mine currently in the borders, SHOW WONDER, BUT BLOCK IT, like in the picture "terracota_grayed",
  • if city has mine in borders, SHOW WONDER, AND ALLOW TO BUILD, like in the picture "terracota_full".
CityCanConstruct can only add two options: "Don't show"/"Show and can build".

Such an effect is currently aquired, when you lack policies or do not have improvement on resource using "Building_LocalResourceOrs" function.

How can I program such an effect using lua code? Or maybe I missed sql table?

I also noticed that similar problem now exists if you are allowed to build Stone Works (or other required building), but do not have one. You should be informed (with grayed wonder), that if you built such building then you will be able to create a wonder in that city. Now you need to rmemeber all those things.
 

Attachments

  • terracota_grayed.png
    terracota_grayed.png
    239.7 KB · Views: 46
  • terracota_full.png
    terracota_full.png
    252.1 KB · Views: 81
If the city only requires a mine, literally any nearby hill would make the wonder valid, right? Or does the mine have to be on a resource?
 
I thought about mine as an improvement on any tile. I forgot they can be placed on any hill, so that's why I wrote about resources in 1st post. Such an unique requirement, easy to achieve, but it would be better to see in city menu grayed wonder to know that only mine is required to have it available to build.
 
If you only want the wonder to be buildable near an improved mine resource, then it sounds like you already have the code that you need, but you just don't like that the wonder is only visible if you improve the resource. This is therefore a more general UI complaint, since you can just set the wonder to only be buildable near an improved source of iron/coal/gold/silver/etc.
 
Yup. When you lack policies you can see wonder, but with info in tooltip that you need 2 more policies to fully unlock it in the city. I would like to do the same with improvements. Such ui thing already works with resource requirement.
 
Top Bottom