Has anyone been able to create a building in a city from a lua script? I would like to create a building when a certain set of criteria is triggered by the player or ai opponent. I have seen a few possible options:
1) CityManager().CreateBuilding(city, buildingType, constructionCost, plot);
This option always seems to throw an error expected function not table. I have been unable to determine what part of the call is incorrect. I discovered this function call in one of the WorldBuilder scripts for Firetuner.
2) city:GetBuildQueue():CreateBuilding(city, buildingType, constructionCost, plot);
As with option 1 I run into the expected function not table error.
3) CityManager.RequestCommand(city, CityCommandTypes.PURCHASE, params);
This call does not error out, but does not purchase the building for the city either. It just doesn't seem to do anything
If anyone has had any luck using any of these function calls in Civ 6 or has another way of creating a building in a city on the fly in a lua script then any assistance you can provide would be appreciated.
Cheers
1) CityManager().CreateBuilding(city, buildingType, constructionCost, plot);
This option always seems to throw an error expected function not table. I have been unable to determine what part of the call is incorrect. I discovered this function call in one of the WorldBuilder scripts for Firetuner.
2) city:GetBuildQueue():CreateBuilding(city, buildingType, constructionCost, plot);
As with option 1 I run into the expected function not table error.
3) CityManager.RequestCommand(city, CityCommandTypes.PURCHASE, params);
This call does not error out, but does not purchase the building for the city either. It just doesn't seem to do anything
If anyone has had any luck using any of these function calls in Civ 6 or has another way of creating a building in a city on the fly in a lua script then any assistance you can provide would be appreciated.
Cheers