How do you...

J_Period

gone :(
Joined
Feb 8, 2006
Messages
385
Location
Denver, CO, USA
Is there any xml-only or does anyone have a python script that makes it so that you can only have one "type" of a building in a city. Like, in Rome: Total War, you can only have a temple of Jupitor OR a temple of Mercury. It's quite relevant to me since I'm working on a mod that has 6 religions with 4 gods with 4 levels of buildings. (That's right I made 6x4x4=96 new buildings :twitch: took me two freaking days to program just the basics of them in....even copy and pasting) I haven't explored the python scripts much yet, since 1st I'm trying to to make the units/buildings/etc... then do their functions.

Thanks for any help
j
 
I'm pretty sure there is a script function that sets construction availability for units/buildings/etc. I did a quick search without finding it, don't know the name off the top of my head.

If it's a city-level function (might be for the player), you can check whenever one of those buildings is constructed, and then disable the availability for the others.
 
cvgameutils has methods for canconstruct and cannotconstruct. Among the args passed in are the building and the city so you can add code to just check the city for building or buildingclass and then return value to allow or disallow as you wish.
 
I just looked up everything and it turns out that canconstruct/cannotconstruct methods test if a city can (or cannot) construct a particular building.

But I did figure that out that I should be able to make it so that if you build another building of the same type, the new building would replace the old. This works out to effectivly the same thing anyways.

But if anyone does know of a method to prevent a certain city from constructing a certain building, let me know...

j
 
I guess I wasn't clear. Dont call them to test but instead add your code into one of them and do a check if the buildingtype allready exists in that city and return approriate true or false to tell the system to allow or disallow the building.
 
Back
Top Bottom