Any way to make building project-dependent?

Yard1

Chieftain
Joined
Apr 22, 2012
Messages
30
So, I'd like to make a building that is aviable after completing Apollo Program. It it possible? If I put <ProjectPrereq>PROJECT_APOLLO_PROGRAM</ProjectPrereq> in building's xml, it doesn't load.

Thanks!
 
If I put <ProjectPrereq>PROJECT_APOLLO_PROGRAM</ProjectPrereq> in building's xml, it doesn't load.

If an XML table doesn't already have an entry for something, like ProjectPrereq, then you can't just add one. That's not how XML works. Because of this, there's no way to do what you're asking in XML.

There IS a way to do it in Lua, using the CityCanConstruct GameEvent to manually restrict construction of a building to only those civs that have a certain Project. Actually, there are several ways I can think of, all involving Lua. None of these are too difficult if you're familiar with basic Lua modding, but if you're not, then you're out of luck.
 
Well, that sucks. Anyway, I don't need it now. Thanks!

Oh, and is it possible to make a building aviable when any civilization builds one specific wonder? For ex. Civ1 build wonder and now Civ1 and all other civs can build a building. If yes, and if it isn't hard, can somebody post a code? I'd be eternally grateful.
 
Same answer as before. Unless the core game or a DLC includes the ability to do something, you're not going to find any XML stubs to let you do it for yourself. The devs did NOT put in much in the way of extra functionality; the few stubs that aren't directly used for Civ5 functions are usually relics of Civ4, many of which don't work any more.

You can make a building require another building to be in the same city, and for most purposes Wonders are just a different type of building. But there's no way to expand this to letting OTHER cities in your empire build something once a Wonder is complete, let alone letting other players build something.

But yet again, you CAN do this, and pretty much anything else you think of, in Lua by manipulating the CityCanConstruct gameevent.
 
Thanks for answer. I thought about doing that in LUA, but after 3 hours of tutorials I think that LUA programming is not for me. Well, enough chatting, I have to test my 9 new buildings ingame!
 
Back
Top Bottom