Nyjene
Chieftain
- Joined
- Feb 13, 2018
- Messages
- 9
Greetings !
I'm struggling ,since three days to create a UA for a Civilization.
The effect is to give local happiness to a city which have a mountain within its border (adjacent, nearby or at range, I don't know yet).
LUA
I guess it's very feasible with LUA but while I'm doing ok to understand and modify existing LUA, I just can't manage to make my own from scratch. The problem is many mods use mountains to give a yield effect (food, faith, culture etc.) and for each mountain.
XML
Here it starts to be complicated. The easy way would be to simply put <NearbyMountainRequired> on a dummy building (given by <FreeBuilding>). The problem is that the effect only occurs when the city is founded or conquered. So if you do not directly put your city adjacent to a mountain (and so directly in your borders), the dummy building will never appear. It is a big problem, mostly for the AI, and it's too much restrictive and not properly balanced.
I then thought of another UA in the same style. Giving a small happiness bonus for a city founded on hills. And a better bonus (still happiness) if the city is adjacent to a mountain. This way I eliminate the problem of borders while still prevent the UA to be too much restrictive (but for the gameplay and roleplay it has to be a UA that encourages to build a compact civilization around mountains). However... <Traits> do not allow for twice <FreeBuilding>, and knowing how XML works I guess <FreeBuilding> can't be used twice in a dummy Palace. So I simply can't apply it.
Consequently, anyone has an idea on how to make it works ? If by LUA, I will need help. If through XML (or SQL?), do I miss a workaround ?
In the end, I might keep the bonus for hills, but in this case I can set it independently with XML. But I absolutely want it to works for mountains and here I struggle.
I'm struggling ,since three days to create a UA for a Civilization.
The effect is to give local happiness to a city which have a mountain within its border (adjacent, nearby or at range, I don't know yet).
LUA
I guess it's very feasible with LUA but while I'm doing ok to understand and modify existing LUA, I just can't manage to make my own from scratch. The problem is many mods use mountains to give a yield effect (food, faith, culture etc.) and for each mountain.
XML
Here it starts to be complicated. The easy way would be to simply put <NearbyMountainRequired> on a dummy building (given by <FreeBuilding>). The problem is that the effect only occurs when the city is founded or conquered. So if you do not directly put your city adjacent to a mountain (and so directly in your borders), the dummy building will never appear. It is a big problem, mostly for the AI, and it's too much restrictive and not properly balanced.
I then thought of another UA in the same style. Giving a small happiness bonus for a city founded on hills. And a better bonus (still happiness) if the city is adjacent to a mountain. This way I eliminate the problem of borders while still prevent the UA to be too much restrictive (but for the gameplay and roleplay it has to be a UA that encourages to build a compact civilization around mountains). However... <Traits> do not allow for twice <FreeBuilding>, and knowing how XML works I guess <FreeBuilding> can't be used twice in a dummy Palace. So I simply can't apply it.
Consequently, anyone has an idea on how to make it works ? If by LUA, I will need help. If through XML (or SQL?), do I miss a workaround ?
In the end, I might keep the bonus for hills, but in this case I can set it independently with XML. But I absolutely want it to works for mountains and here I struggle.