Need help with a mod limiting the number of cities

PawelS

Ancient Druid
Joined
Dec 11, 2003
Messages
2,811
Location
Poland
Hello, I'm new to Civ6 modding, I did some Civ5 modding though. I need help with making a mod that limits the number of cities you can have.

The limit, let's call it L, should be equal to E + 5, where E is the current era number (1 to 9). The following rules should apply to all players (human and AI):

1. At the start of a turn, if you have less than L - 2 cities, and you don't have any settlers, you get a settler for free in the capital.
2. You can only build a settler if you have exactly L - 2 cities, and don't have any other settlers active or in production. (So the last city can only be acquired by different means, like conquest, assimilation, or getting a free settler.)
3. At the start of a turn, if you have more than L cities, one of your cities is automatically razed. (I don't really care how the city is picked, it can be the one with the least population, least culture, least loyal, the last one you acquired etc. Whatever is easiest to code in LUA.)

It would be best if someone can make this mod for me, as I don't really know where to start. (Also I don't have the Steam version of the game so I don't have access to the development tools). It shouldn't be hard for an experienced Civ6 modder. Then I can tweak it myself if needed.
 
Last edited:

PawelS

Ancient Druid
Joined
Dec 11, 2003
Messages
2,811
Location
Poland
I partially figured it out myself, now I only need help with doing two things using LUA code:

1. How to control if a unit can be built or not? (I want to make the settler buildable only when specific conditions are met, as explained above.)
2. How to raze/destroy a city? (I just want to make it disappear from the map, without any warmonger penalties or things like that.)
 

raen

Coat of Arms
Joined
May 12, 2003
Messages
2,580
Location
Portugal
Top Bottom