What I'm doing is replacing the civilization specific unique units, sort of. Perhaps it's best described as removing them from the civilization definitions and having each unique unit require a unique building that is created when you found a city. This means several things will happen over the course of the game; First, you will be unable to produce your civilization's unique units at a city you didn't build (although this may be addressed by allowing some units to create the building if I can get the AI to build them). Second, you might be able to build the unique units from another civilization if the building survives when you conquer or "flip" the city. Third, you can produce both the "standard" unit (e.g. Spearman) and your unique unit (e.g. Phalanx). And finally, you may loose the ability to produce your unique unit if your city is conquered and you retake it since the building may be destroyed in the fighting. Essentially, it adds a little depth to conquests and gives you something new to play with if you destroy another civilization or conquer a number of their cities.
Right now I have all of the buildings, they are simple names like "BUILDINGCLASS_AMERICA" and "BUILDING_AMERICA" for one example. I also have removed the unique units from the civilization definitions and change the unique units so they can be built as long as the new building exists in the city. I have also done some minor adjustments to make the unique units slightly better and cost slightly more since you have the option of creating them now, they aren't forced on you.
So far everything works except the building will only be created automatically when you found your first city and then only if it is defined in your civilization definition. It basically works like the palace and creates one free building for you but only in your first city. Making the buildings "free era buildings" puts them in everybodies cities, not just for the appropriate civilization. This isn't a problem for the player if I allow the actual unique units to create the building in any city that doesn't already have it (like the great scientists' academies). Unfortunately, the AI won't build them, or at least not that I've seen so far in testing. I think I've also stumbled upon the ability to define unique buildings much like the current unique units, so basically I could have this new special building replace barracks and each civ would produce their own special barracks. It's a viable option but I'd have to test it more to see if it actually works and then it defeats part of my objective in that it would allow you to build your UUs in conquered cities and may not allow you to build the UUs from another civ.
So anyway, on to the request...
I'd like some help in creating the script to insert a building into each new city based on which civilization founded the city. Is it possible? I've only done some copy & paste merging in python so I have no idea where to start. Any help would be greatly appreciated.
Right now I have all of the buildings, they are simple names like "BUILDINGCLASS_AMERICA" and "BUILDING_AMERICA" for one example. I also have removed the unique units from the civilization definitions and change the unique units so they can be built as long as the new building exists in the city. I have also done some minor adjustments to make the unique units slightly better and cost slightly more since you have the option of creating them now, they aren't forced on you.
So far everything works except the building will only be created automatically when you found your first city and then only if it is defined in your civilization definition. It basically works like the palace and creates one free building for you but only in your first city. Making the buildings "free era buildings" puts them in everybodies cities, not just for the appropriate civilization. This isn't a problem for the player if I allow the actual unique units to create the building in any city that doesn't already have it (like the great scientists' academies). Unfortunately, the AI won't build them, or at least not that I've seen so far in testing. I think I've also stumbled upon the ability to define unique buildings much like the current unique units, so basically I could have this new special building replace barracks and each civ would produce their own special barracks. It's a viable option but I'd have to test it more to see if it actually works and then it defeats part of my objective in that it would allow you to build your UUs in conquered cities and may not allow you to build the UUs from another civ.
So anyway, on to the request...
I'd like some help in creating the script to insert a building into each new city based on which civilization founded the city. Is it possible? I've only done some copy & paste merging in python so I have no idea where to start. Any help would be greatly appreciated.