Hiho,
i just want to present another economy script - erm Carl! Itīs easy to adjust and can do a couple of things. It has a lot of monitors due to the additional features, but i didnīt notice any change in performance. I saw another resource about the kings purse out there, but that was about the initial value. The example further on in that thread doesnīt make sure that the purse will stay the same in the long run.
What can Carl do for AIīs economy?
1. He can ensure that the AI never really goes bankrupt and the treasury get freezed at Your favourite amount.
2. He can freeze the recruitment for the AI without editing other files.
3. He can tell You how much upkeep an AI faction has too much.
What could be additional uses?
1. You can adjust the building costs to 1 for the AI and then the factions could develop their settlements while beeing "bankrupt".
2. You can compare the value of that "too much" upkeep over some turns and then kill unused units so that the AI faction donīt has more than wanted.
...
In the following i will split an example script for venice into the different parts and explain a bit. Your variant could be much shorter. At the end i will upload a samplescript that You can use with the fabulous script replicator.
If You just use the kings purse part itīs possible that the factions will end up in very high purses - if You donīt stop them to recruit anything in any other way. If You want to make the game harder this is an option - but in the end itīs giving them endless money.
1. The Counter: This one is necessary that the kings purse wouldnīt fall below the initial value. It also can tell You how much upkeep the AI faction has too much (Bankruptcy for the AI is in the end a matter of upkeep costs)
2. Then I start with taking away the additional purse if a faction has a treasury of 50 (isnīt bankrupt any more) This section fortunatly works with if and isnīt that long. This way it will react real fast - could be shortened.
3. Here we start with rasing the purse at certain points. Had to split that into that many monitors because "if" condition wouldnīt work with treasury. Again itīs made for a fast reaction - could be shortened.
4. The next sections is made for factions which come with a very high value of upkeep to 0 Treasury - such as emergent factions or if the faction was been to rich before and had much time to spend their money on units. Again this could be shortened - but this will make sure that those factions wonīt run to much into dept. In this example they end up in having a positive treasury, because the next section adjusts the treasury to the favorite value.
5. In the last part the treasury will be adjusted to Your liking. This part can be used to freeze the recruitment if they end up in a treasury which is lower than the cheapest unit (agents, mercenaries too) costs. The AI faction wonīt be able to recruit any more, but could retrain sometimes. If You set building costs to 1 for the AI they will be able to develop their settlements. This is a rather long part with many monitors - unfortunately, but in this example they will end up in a treasury between 1 and 50 - very fine tuned. Perhaps some of the first monitors could be taken away, but i wanted to make sure that even the mongols wonīt have money if they loose 3 fullstacks in a turn. If you donīt want to adjust the treasury to that certain amount You can of course delete a lot of monitors. You could even freeze the treasury at e.g. 7 if You are brave enough to add some monitors.
The effect of freezed treasury will end as soon as the purse is on the initial level again and the AI can develop normally again.
This is my first script so please correct me if i am wrong at some point.
Have Fun!