Page 1 of 2 12 LastLast
Results 1 to 20 of 21

Thread: Carl - the Taxman (economy script)

  1. #1
    Fred Putz's Avatar Ordinarius
    Join Date
    Mar 2010
    Location
    Germany
    Posts
    722

    Default Carl - the Taxman (economy script)

    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)
    Spoiler Alert, click show to read: 
    declare_counter HasAdditionalPurse_venice


    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.
    Spoiler Alert, click show to read: 
    Code:
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
        and Treasury > 50
            if I_CompareCounter HasAdditionalPurse_venice > 9
                inc_counter HasAdditionalPurse_venice -10
                increment_kings_purse venice -10000
        end_if
            if I_CompareCounter HasAdditionalPurse_venice > 8
                inc_counter HasAdditionalPurse_venice -9
                increment_kings_purse venice -9000
        end_if
            if I_CompareCounter HasAdditionalPurse_venice > 7
                inc_counter HasAdditionalPurse_venice -8
                increment_kings_purse venice -8000
        end_if
            if I_CompareCounter HasAdditionalPurse_venice > 6
                inc_counter HasAdditionalPurse_venice -7
                increment_kings_purse venice -7000
        end_if
            if I_CompareCounter HasAdditionalPurse_venice > 5
                inc_counter HasAdditionalPurse_venice -6
                increment_kings_purse venice -6000
        end_if
            if I_CompareCounter HasAdditionalPurse_venice > 4
                inc_counter HasAdditionalPurse_venice -5
                increment_kings_purse venice -5000
        end_if
            if I_CompareCounter HasAdditionalPurse_venice > 3
                inc_counter HasAdditionalPurse_venice -4
                increment_kings_purse venice -4000
        end_if
            if I_CompareCounter HasAdditionalPurse_venice > 2
                inc_counter HasAdditionalPurse_venice -3
                increment_kings_purse venice -3000
        end_if
            if I_CompareCounter HasAdditionalPurse_venice > 1
                inc_counter HasAdditionalPurse_venice -2
                increment_kings_purse venice -2000
        end_if
            if I_CompareCounter HasAdditionalPurse_venice > 0
                inc_counter HasAdditionalPurse_venice -1
                increment_kings_purse venice -1000
        end_if
    end_monitor


    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.
    Spoiler Alert, click show to read: 
    Code:
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and Treasury < 10
                inc_counter HasAdditionalPurse_venice 1
                increment_kings_purse venice 1000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and Treasury < -1000
                inc_counter HasAdditionalPurse_venice 1
                increment_kings_purse venice 1000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and Treasury < -2000
                inc_counter HasAdditionalPurse_venice 1
                increment_kings_purse venice 1000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and Treasury < -3000
                inc_counter HasAdditionalPurse_venice 1
                increment_kings_purse venice 1000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and Treasury < -4000
                inc_counter HasAdditionalPurse_venice 1
                increment_kings_purse venice 1000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and Treasury < -5000
                inc_counter HasAdditionalPurse_venice 1
                increment_kings_purse venice 1000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and Treasury < -6000
                inc_counter HasAdditionalPurse_venice 1
                increment_kings_purse venice 1000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and Treasury < -7000
                inc_counter HasAdditionalPurse_venice 1
                increment_kings_purse venice 1000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and Treasury < -8000
                inc_counter HasAdditionalPurse_venice 1
                increment_kings_purse venice 1000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and Treasury < -9000
                inc_counter HasAdditionalPurse_venice 1
                increment_kings_purse venice 1000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and Treasury < -10000
                inc_counter HasAdditionalPurse_venice 1
                increment_kings_purse venice 1000
    end_monitor


    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.
    Spoiler Alert, click show to read: 
    Code:
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and Treasury < -30000
                add_money venice 40000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and Treasury < -20000
                add_money venice 30000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and Treasury < -10000
                add_money venice 20000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and Treasury < 0
                add_money venice 10000
    end_monitor


    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.
    Spoiler Alert, click show to read: 
    Code:
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and I_CompareCounter HasAdditionalPurse_venice > 0
            and Treasury > 50000
                add_money venice -40000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and I_CompareCounter HasAdditionalPurse_venice > 0
            and Treasury > 40000
                add_money venice -30000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and I_CompareCounter HasAdditionalPurse_venice > 0
            and Treasury > 30000
                add_money venice -20000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and I_CompareCounter HasAdditionalPurse_venice > 0
            and Treasury > 20000
                add_money venice -10000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and I_CompareCounter HasAdditionalPurse_venice > 0
            and Treasury > 10000
                add_money venice -9000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and I_CompareCounter HasAdditionalPurse_venice > 0
            and Treasury > 9000
                add_money venice -8000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and I_CompareCounter HasAdditionalPurse_venice > 0
            and Treasury > 8000
                add_money venice -7000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and I_CompareCounter HasAdditionalPurse_venice > 0
            and Treasury > 7000
                add_money venice -6000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and I_CompareCounter HasAdditionalPurse_venice > 0
            and Treasury > 6000
                add_money venice -5000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and I_CompareCounter HasAdditionalPurse_venice > 0
            and Treasury > 5000
                add_money venice -4000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and I_CompareCounter HasAdditionalPurse_venice > 0
            and Treasury > 4000
                add_money venice -3000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and I_CompareCounter HasAdditionalPurse_venice > 0
            and Treasury > 3000
                add_money venice -2000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and I_CompareCounter HasAdditionalPurse_venice > 0
            and Treasury > 2000
                add_money venice -1000
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and I_CompareCounter HasAdditionalPurse_venice > 0
            and Treasury > 1000
                add_money venice -950
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and I_CompareCounter HasAdditionalPurse_venice > 0
            and Treasury > 900
                add_money venice -850
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and I_CompareCounter HasAdditionalPurse_venice > 0
            and Treasury > 800
                add_money venice -750
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and I_CompareCounter HasAdditionalPurse_venice > 0
            and Treasury > 700
                add_money venice -650
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and I_CompareCounter HasAdditionalPurse_venice > 0
            and Treasury > 600
                add_money venice -550
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and I_CompareCounter HasAdditionalPurse_venice > 0
            and Treasury > 500
                add_money venice -450
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and I_CompareCounter HasAdditionalPurse_venice > 0
            and Treasury > 400
                add_money venice -350
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and I_CompareCounter HasAdditionalPurse_venice > 0
            and Treasury > 300
                add_money venice -250
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and I_CompareCounter HasAdditionalPurse_venice > 0
            and Treasury > 200
                add_money venice -150
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and I_CompareCounter HasAdditionalPurse_venice > 0
            and Treasury > 100
                add_money venice -50
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType venice
        and not FactionIsLocal
            and I_CompareCounter HasAdditionalPurse_venice > 0
            and Treasury > 70
                add_money venice -40
    end_monitor


    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!
    Last edited by Fred Putz; October 19, 2010 at 05:44 AM.
    German Translation for Stainless Steel
    6.2 RR/RC; 6.3, 6.4
    Projects / Submods
    Alternative AI-Economy (money script) StSt 6.2 RR/RC; StSt 6.3, 6.4; TATW; CoW; Resource for Your Mod
    Alternative Recruitment StSt 6.4
    Suggestions
    An apple a day keeps the doctor away!

    Donīt forget to check out these Mods sooner or later:
    Shizoku no Senso - 1648 - Conquer the World


    RockīnīRoll!

  2. #2
    Gigantus's Avatar Women and cats will do as they please, and men and dogs should relax and get used to the idea
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    45,806
    Blog Entries
    22

    Default Re: Carl - the Taxman (economy script)

    Nice work (and here we meet again).



  3. #3
    Addi's Avatar Laetus
    Join Date
    Dec 2008
    Location
    planet earth
    Posts
    4

    Default Re: Carl - the Taxman (economy script)

    ...thankīs my friend. After a long time remember my account here. :-)
    @ gigantus
    ...you have a lot of posts here.
    greetings Addi

  4. #4
    Fred Putz's Avatar Ordinarius
    Join Date
    Mar 2010
    Location
    Germany
    Posts
    722

    Default Re: Carl - the Taxman (economy script)

    Thank You both.

    Mmmh > 10000 posts .... maybe I was wrong when I said that I have to thank Gigantus at the german forums.
    German Translation for Stainless Steel
    6.2 RR/RC; 6.3, 6.4
    Projects / Submods
    Alternative AI-Economy (money script) StSt 6.2 RR/RC; StSt 6.3, 6.4; TATW; CoW; Resource for Your Mod
    Alternative Recruitment StSt 6.4
    Suggestions
    An apple a day keeps the doctor away!

    Donīt forget to check out these Mods sooner or later:
    Shizoku no Senso - 1648 - Conquer the World


    RockīnīRoll!

  5. #5
    Addi's Avatar Laetus
    Join Date
    Dec 2008
    Location
    planet earth
    Posts
    4

    Default Re: Carl - the Taxman (economy script)

    ...there is a other thing you could do to help the AI take care of her money.
    Most of the time the AI have to much agents. Guess 5 diplomats and only 2 citys is to many, because the agents cost money. So I do the same with diplomats, spys and assassins like the priests in game. Work with limits for all agents.
    Itīs not much, but help a little bit to save foreign money.
    agent_limit spy 1
    agent_limit diplomat 1
    agent_limit assassin 1
    So you could sure, the AI never have around 15 diplomats and spy in the beginning.
    Just additional to your idea.
    grettings Addi

  6. #6
    Laetus
    Join Date
    Jun 2009
    Location
    Germany
    Posts
    14

    Default Re: Carl - the Taxman (economy script)

    Thank you, this is very usefull.

  7. #7
    Fred Putz's Avatar Ordinarius
    Join Date
    Mar 2010
    Location
    Germany
    Posts
    722

    Default Re: Carl - the Taxman (economy script)

    Any Idea is welcome.

    Perhaps giving the AI free upkeep for agents/generals/mercenaries could help too.
    In fact I donīt know why the AI is buying more than it can handle in the long run - should be able to calculate better or to dismiss the units/agents (spies/assassins) if needed without modding anything. Seems to me that the AI most of the time is recruiting too much if they are at war - with any other faction than slaves. Even if they have e.g. 1000 gold and a negative balance of 16k they will spend that money on more units.

    Thank You too Tobi - Glad to help You.
    Last edited by Fred Putz; October 17, 2010 at 09:05 AM.
    German Translation for Stainless Steel
    6.2 RR/RC; 6.3, 6.4
    Projects / Submods
    Alternative AI-Economy (money script) StSt 6.2 RR/RC; StSt 6.3, 6.4; TATW; CoW; Resource for Your Mod
    Alternative Recruitment StSt 6.4
    Suggestions
    An apple a day keeps the doctor away!

    Donīt forget to check out these Mods sooner or later:
    Shizoku no Senso - 1648 - Conquer the World


    RockīnīRoll!

  8. #8
    IZob's Avatar Citizen
    Join Date
    Aug 2009
    Location
    Australia
    Posts
    9,829

    Default Re: Carl - the Taxman (economy script)

    Perhaps the AI (in the AI file) has conflicting decisions based on their current income, leading them to bad decisions? For example a fixed rate may have been set to how many units are produced based on the economeny (economeny income compaired to upkeep costs). CA designed the AI (in MII tw) to produce units based on their economeny. Not on a money script that would pull them out of debt. From what I've read this is a money script that will help the AI on different levels, deppending on how much they go into debt. But the problem is how the AI go into debt.

    If the AI go into debt because of War, winning or losing I would say that is of consequence. Its appropiate to go into debt. But if the AI go into debt because of unused units taking up unneccesary upkeep costs, then that is unappropiate for the AI because it leads to a massive disadvantage (especially if they never use those unites). So keep that in mind.

    Although this script is good for players who want a AI faction that will never die! The agent concept described by Addi sounds good and I approve deleting unused units (as a fix to the AI's silly behaviour, but still isnt as effective as making the AI more intelligant).
    Contact me on Steam: steamcommunity.com/id/IZob/ or send a PM.

  9. #9
    Fred Putz's Avatar Ordinarius
    Join Date
    Mar 2010
    Location
    Germany
    Posts
    722

    Default Re: Carl - the Taxman (economy script)

    Quote Originally Posted by Paradigm View Post
    Perhaps the AI (in the AI file) has conflicting decisions based on their current income, leading them to bad decisions? For example a fixed rate may have been set to how many units are produced based on the economeny (economeny income compaired to upkeep costs). CA designed the AI (in MII tw) to produce units based on their economeny. Not on a money script that would pull them out of debt. From what I've read this is a money script that will help the AI on different levels, deppending on how much they go into debt. But the problem is how the AI go into debt.

    If the AI go into debt because of War, winning or losing I would say that is of consequence. Its appropiate to go into debt. But if the AI go into debt because of unused units taking up unneccesary upkeep costs, then that is unappropiate for the AI because it leads to a massive disadvantage (especially if they never use those unites). So keep that in mind.
    Yes first I thought just loosing settlements and loosing the income is the one and only problem, but it isnīt. Even the papal states went bankrupt with one region/no additional family members/no war. E.g. scotland in one test was fine with no war till turn 240. Great treasury and a slighlty negative balance (perhaps because of additional family members).

    Perhaps the AI merchants are the problem. They can earn a lot of money if expierenced enough and with a good resource. AI problems began at turn 50-100 most of the time - when the first merchants die (and in case of papal states the one merchant can make a big difference). Perhaps - but again perhaps giving the merchants a bad trait, that they wonīt generate income through trade, but e.g. a fixed income through raising the purse could help those factions. Maybe thatīs worth a try.

    Loosing settlements and having too much units after ceasing fire is another thing.

    And nonetheless - sometimes the AI takes all the money to buy more units and donīt care that they will be bankrupt (big time) the next turn anyway. And if the AI goes on with that they will never see the light again. (16k negative balance - they will never have that much positive balance, so 2-5 turns are enough to break them the rest of the game - no latest units, underdeveloped settlements)

    Quote Originally Posted by Paradigm View Post
    Although this script is good for players who want a AI faction that will never die!
    Oh - the factions will die as before. Perhaps even more in the long run - in my tests there were less factions than before - but much stronger. But every game is a bit different. Itīs just to prevent them from running so much into dept, that they couldnīt purchase new units the rest of the game and developing their settlements while being bankrupt of course.
    If You want the factions to never die: Iīve got another script that raises the purse when AI is loosing settlements - all factions were still alive in my tests.
    But this one is more flexible - the settlement thing just slows things a bit down.

    ----------------------------------------------------------------------------------------------------

    Edit: One initial Idea was to kill unused units - but itīs
    1. hard to decide which Units are unused (perhaps the AI needs those Units for an attack, for defence or for public order)
    2. hard to decide how many are unused
    3. hard to integrate (harder than this here)
    and 4. not possible to check the income (as far as i know)
    so i decided to sit it out till the AI either has lost those units or gains more income.

    If You compare the counter over letīs say 4 turns - and You know how much upkeep one Unit needs You will be able to kill the right amount at the (perhaps) right time (counter could change for other reasons too - but if it is the same over serveral turns You can be pretty sure that there are too much unused Units).
    e.g. The English are at war with France. They produce in England, are loosing in France and those units wouldnīt get to France before they chease fire. (Had that many times) So if You know that the Counter is at e.g. 6 over 4 turns and You have a Unit that needs e.g. 500 Upkeep You will know that there are 12 (perhaps 13 for the balance) Units to be killed. While doing that You lower the purse by 6k and lower the counter by 6. Itīs even possible to set the counter to 1000 for 1000 purse, so if that Unit needs 347 Upkeep, You lower the counter by 347 and also the purse. Should be doable - but not by me.

    Eidt # 2: Mmmh some more words and we have a book!
    Last edited by Fred Putz; October 19, 2010 at 05:46 AM.
    German Translation for Stainless Steel
    6.2 RR/RC; 6.3, 6.4
    Projects / Submods
    Alternative AI-Economy (money script) StSt 6.2 RR/RC; StSt 6.3, 6.4; TATW; CoW; Resource for Your Mod
    Alternative Recruitment StSt 6.4
    Suggestions
    An apple a day keeps the doctor away!

    Donīt forget to check out these Mods sooner or later:
    Shizoku no Senso - 1648 - Conquer the World


    RockīnīRoll!

  10. #10
    Gorrrrrn's Avatar Citizen
    Join Date
    Jan 2007
    Location
    here
    Posts
    5,546

    Default Re: Carl - the Taxman (economy script)

    Interesting discussion:
    it seems we are subject to the law of unintended consequences a lot of the time -
    virtually every fix causes problems somewhere else.

    all sorts of other factors need to be brought to the table:

    CAI that are too aggressive or passive (if too aggressive catholic factions get hit by ex-communication and trashed), (too passive and they can't expand)
    but if constantly at war they can't trade with neighbours which hurts their economy.

    expanded rosters - FP will be aware what happens to the English in SS with RC/RR where a whole batch of new units appears in the roster and the AI goes mad building them
    because they are clearly superior to what it has already (but doesn't disband the earlier units.)

    destroy_units can be used as a supplement to other measures - I use it to disband crusade/jihad units after the crusade/jihad ends.
    also mercs if the treasury gets too low (but am limited because of AoR recruitment method.)
    difference between upkeep and recruitment costs. latest SS6.3 seems to stop most AI recruitment of mercs as upkeep is too high - AI only recruits mercs when on crusade/jihad.
    but that doesn't apply to what appears in its recruitment browser (and AoR tends to increase the options)
    we can also have scripts that disband obsolete units after 30-40 (or whatever) turns from last recruitment.

    watching AI on hotseat the AI doesn't seem to recruit everything it possibly can.
    we can slow recruitment but that seems to merely delay the inevitable (slow-mo car crash)

    interesting comment on merchant income - it's very true that losing good merchants can make a substantial dent in economies.
    irony is the AI (and scripts) tend to pump out merchants in early game (when AI doesn't need boosting)
    but don't replace after 40-50 years when they die (because the AI economies are then usually well in surplus and so so extra income not required.
    then when the AI economies get short of cash they don't recruit merchants as they're short of cash.
    (Current SS6.3 spawns AI mercs early in game -perhaps we should spawn in mid-game instead?)
    (I can test that easily enough!)

    extra free upkeep can help in one way (reduces costs) but you get a bigger imbalance as soon as units move into countryside.
    Last edited by Gorrrrrn; October 19, 2010 at 06:14 AM.

  11. #11
    Fred Putz's Avatar Ordinarius
    Join Date
    Mar 2010
    Location
    Germany
    Posts
    722

    Default Re: Carl - the Taxman (economy script)

    Quote Originally Posted by Rozanov View Post
    but if constantly at war they can't trade with neighbours which hurts their economy.

    irony is the AI (and scripts) tend to pump out merchants in early game (when AI doesn't need boosting)
    but don't replace after 40-50 years when they die (because the AI economies are then usually well in surplus and so so extra income not required.
    Those two points above could possibly be "fixed" if the AI factions wonīt get any trade income (through traits and buildings) - but e.g. higher taxes (through buildings) or a higher initial purse. Perhaps the more constant the AI income is the better it is to calculate - but some variations will be there anyway - and should be too. Not being able to get rid of unwanted costs is the biggest AI problem - but setting everything to a constant income can be boring.
    Beginning with 9000 purse and adding 100 per turn would be very constant - will the AI ever go bankrupt? (with no additional income - perhaps just through events)

    Quote Originally Posted by Rozanov View Post
    destroy_units can be used as a supplement to other measures - I use it to disband crusade/jihad units after the crusade/jihad ends.
    also mercs if the treasury gets too low (but am limited because of AoR recruitment method.)
    difference between upkeep and recruitment costs. latest SS6.3 seems to stop most AI recruitment of mercs as upkeep is too high - AI only recruits mercs when on crusade/jihad.
    but that doesn't apply to what appears in its recruitment browser (and AoR tends to increase the options)
    we can also have scripts that disband obsolete units after 30-40 (or whatever) turns from last recruitment.
    Didnīt know that - i thought destroy_units (or something like that) could be used on every unit. So one additional feature of Carl is lost.

    Edit: Wait: Isnīt it possible to put them temporary out of the building browser? Perhaps that theyīre only in if thereīs some counter on 0?

    Quote Originally Posted by Rozanov View Post
    watching AI on hotseat the AI doesn't seem to recruit everything it possibly can.
    Noticed that too. Big question is why the AI goes bankrupt in the long run as it seems that the AI can calculate if thereīs a wish to do so.
    Last edited by Fred Putz; October 19, 2010 at 07:29 AM.
    German Translation for Stainless Steel
    6.2 RR/RC; 6.3, 6.4
    Projects / Submods
    Alternative AI-Economy (money script) StSt 6.2 RR/RC; StSt 6.3, 6.4; TATW; CoW; Resource for Your Mod
    Alternative Recruitment StSt 6.4
    Suggestions
    An apple a day keeps the doctor away!

    Donīt forget to check out these Mods sooner or later:
    Shizoku no Senso - 1648 - Conquer the World


    RockīnīRoll!

  12. #12
    Laetus
    Join Date
    Jun 2009
    Location
    Germany
    Posts
    14

    Default Re: Carl - the Taxman (economy script)

    Would it be possible to spawn a merchant, if antoher merchant dies? So the AI faction would have merchants through the whole match and it can't get bankrupt because of dying merchants.

  13. #13

    Default Re: Carl - the Taxman (economy script)

    Quote Originally Posted by Fred Putz View Post

    Edit: Wait: Isnīt it possible to put them temporary out of the building browser? Perhaps that theyīre only in if thereīs some counter on 0?
    One can always Block the recruitment of an entire settlement.

  14. #14

    Icon1

    Quote Originally Posted by Tobi View Post
    Would it be possible to spawn a merchant, if antoher merchant dies? So the AI faction would have merchants through the whole match and it can't get bankrupt because of dying merchants.
    Yeah this is possible I think.
    When a merchant of one nation dies this nation gets a merchant spawnend next to their capital for example.
    I don't know the exact order but it should be in this style I think:
    Code:
    monitor_event merchantdies (No idea whats the name of this is. )
    and faction england
    and IsAiControlled (You know what i mean :D I dont know the exact order :whistling )
    spawn merchant england x123 y123
    end_monitor
    I am a bit out of practice, so this code is surely wrong, but I think there is a condition for a merchant's dead

    And please correct me, if I am totally wrong with my thoughts
    Last edited by Ishan; October 19, 2010 at 08:21 AM. Reason: double post

    Skinner&Modeller of Shizoku no Sensō and East of Rome | My Workshop |

  15. #15
    Fred Putz's Avatar Ordinarius
    Join Date
    Mar 2010
    Location
    Germany
    Posts
    722

    Default Re: Carl - the Taxman (economy script)

    Quote Originally Posted by Ishan View Post
    One can always Block the recruitment of an entire settlement.
    Nice to hear.
    I just clicked on Your turorials and found that:

    recruit_pool "Greek Firethrower" 1 0.7 1 0 requires factions { byzantium, } and event_counter holds_constantinople 1

    So in this case here if we change it to:

    recruit_pool "Greek Firethrower" 1 0.7 1 0 requires factions { byzantium, } and event_counter holds_constantinople 1 and I_CompareCounter HasAdditionalPurse_byzantium = 0

    the Byzantines would only be able to recruit those Firethrowers when they
    1. Hold Constantiople
    2. Have Money and
    3. Donīt have the additional Purse
    plus - the Firethrowers arenīt in the building brower and can be destroyed with destroy_units if the (last) counter is at least at 1?

    But that would be a lot of lines to change (and even to add in as some Units are recruitable by many factions) if one wants to do that for every unit for every faction. Perhaps only doing that for some units could help.

    In the end iīm not sure if You meant it that way - You said something about blocking the recruitment of a settlement. Guess that would be even more lines (198 or 199 settlements - a counter for every faction - omg )
    German Translation for Stainless Steel
    6.2 RR/RC; 6.3, 6.4
    Projects / Submods
    Alternative AI-Economy (money script) StSt 6.2 RR/RC; StSt 6.3, 6.4; TATW; CoW; Resource for Your Mod
    Alternative Recruitment StSt 6.4
    Suggestions
    An apple a day keeps the doctor away!

    Donīt forget to check out these Mods sooner or later:
    Shizoku no Senso - 1648 - Conquer the World


    RockīnīRoll!

  16. #16
    Gigantus's Avatar Women and cats will do as they please, and men and dogs should relax and get used to the idea
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    45,806
    Blog Entries
    22

    Default Re: Carl - the Taxman (economy script)

    - I do not think the EDB works with a counter.
    - you can give multiple units a common custom attribute and then use that attribute to destroy a whole range of units.
    the Byzantines would only be able to recruit those Firethrowers when they
    1. Hold Constantiople
    2. Have Money and
    3. Donīt have the additional Purse
    Simply script this and then trigger an event, that event can then be referenced in the EDB.



  17. #17
    Fred Putz's Avatar Ordinarius
    Join Date
    Mar 2010
    Location
    Germany
    Posts
    722

    Default Re: Carl - the Taxman (economy script)

    Quote Originally Posted by Gigantus View Post
    Simply script this and then trigger an event, that event can then be referenced in the EDB.
    I guess something like
    If I_CompareCounter HasAdditionalPurse_byzantium > 0
    set event_counter byzantiumIsBankrupt = 1
    If I_CompareCounter HasAdditionalPurse_byzantium = 0
    set event_counter byzantiumIsBankrupt = 0

    ... just to be sure , but
    Quote Originally Posted by Gigantus View Post
    you can give multiple units a common custom attribute and then use that attribute to destroy a whole range of units.
    So you can kill Units while they are in the building browser? Then there would be no need for the above - my simple thinking. Or my English is too bad (it is) and i misunderstood Rozanov.

    Spoiler Alert, click show to read: 
    Question: Do I have scripting knowledge?
    Answer:
    Spoiler Alert, click show to read: 
    German Translation for Stainless Steel
    6.2 RR/RC; 6.3, 6.4
    Projects / Submods
    Alternative AI-Economy (money script) StSt 6.2 RR/RC; StSt 6.3, 6.4; TATW; CoW; Resource for Your Mod
    Alternative Recruitment StSt 6.4
    Suggestions
    An apple a day keeps the doctor away!

    Donīt forget to check out these Mods sooner or later:
    Shizoku no Senso - 1648 - Conquer the World


    RockīnīRoll!

  18. #18
    Gorrrrrn's Avatar Citizen
    Join Date
    Jan 2007
    Location
    here
    Posts
    5,546

    Default Re: Carl - the Taxman (economy script)

    So you can kill Units while they are in the building browser? Then there would be no need for the above - my simple thinking. Or my English is too bad (it is) and i misunderstood Rozanov.
    I've never considered that might happen - always assumed it only covered already recruited units.

    destroy_units can be configured to be pretty precise - you could give all units attributes that are only triggered in certain conditions for each faction.
    eg you could give all feudal knights the attribute obsolete_by_1300, but call it on different turns for different factions.
    and give different date attributes for every unit.
    destroy_units is fairly flexible in how you use it.
    more info here:
    http://www.twcenter.net/forums/showt...=destroy_units

    G5's script for SS6.3 freezes the recruitment slots in the EDB if the AI faction has insufficient money.

  19. #19
    Fred Putz's Avatar Ordinarius
    Join Date
    Mar 2010
    Location
    Germany
    Posts
    722

    Default Re: Carl - the Taxman (economy script)

    I already saw Your tutorial about that yesterday. I havenīt read it, because... The thing is i thought You were saying that it is not possible to use destroy_units when those units are available in the building browser - and are of course already recruited. Just a misunderstanding due to my english - could happen more or less often.

    To the 6.3 script: I saw that too (havenīt played 6.3 so far - just started it to verify if the translation is ok) - but in the end itīs not necessary to do so if the AI will end up in having less money than the units/agents/mercenaries cost. Just a matter of preference i think - and a matter of laziness in my case.
    German Translation for Stainless Steel
    6.2 RR/RC; 6.3, 6.4
    Projects / Submods
    Alternative AI-Economy (money script) StSt 6.2 RR/RC; StSt 6.3, 6.4; TATW; CoW; Resource for Your Mod
    Alternative Recruitment StSt 6.4
    Suggestions
    An apple a day keeps the doctor away!

    Donīt forget to check out these Mods sooner or later:
    Shizoku no Senso - 1648 - Conquer the World


    RockīnīRoll!

  20. #20
    Dunedain Ranger's Avatar Civis
    Join Date
    Jul 2011
    Location
    Switzerland, Europe
    Posts
    109

    Default Re: Carl - the Taxman (economy script)

    Could someone please upload the submod again?

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •