Dummy building/special resource rule: how to code?

isnorden

Amnesiac Modder
Joined
Jul 6, 2012
Messages
608
Location
Madison, Wisconsin, USA
I got an idea for part of my food-and-drink mod; is this rule codable in plain XML, or would I need a Lua script supporting it?

  • If the player has a Bakery and the Oktoberfest wonder in the same city...improve that one Bakery with a dummy upgrade which produces Pretzels.

I know that plain XML allows checking for other buildings as prerequisites, but requiring two is a bit more complicated. If someone could please help me here, I'd be extremely grateful. :worship:
 
You'll need to use Lua - check out the CityConstructed event (one of the ones Firaxis borrowed from my DLL).

Is the Oktoberfest wonder dependant on their being a Bakery in every city? If so, you'll only need to check when the Oktoberfest is constructed and "upgrade" the Bakery, otherwise you'll need to check for both being constructed, and when one is finished, check if the other is also present in the city and if so, do the upgrade.

You'll also need to make the upgrade building disallow the Bakery (or the city could re-construct the Bakery after it's upgraded)
 
Top Bottom