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

Thread: Help needed: Editing CAI to want to make satrapies

  1. #1
    alhoon's Avatar Comes Rei Militaris
    took an arrow to the knee

    Join Date
    Apr 2008
    Location
    Chania, Greece
    Posts
    24,765

    Default Help needed: Editing CAI to want to make satrapies

    I would like to make a custom mod that increases the CAI's willingness to make satrapies. That's the main thing I would like some help with. The others I can live without.

    The second step which is more difficult but probably not much, is to give a CAI-vassal to CAI-liege diplomacy bonus on top of the usual vassal-liege diplomacy bonus.

    The third step, which is perhaps much more difficult, is to give the liege food and pop-growth bonuses on top of money bonuses.

    The forth and final step, perhaps the most difficult, is to give the CAI bigger garrisons or more powerful garrisons (through morale, defense etc bonuses) based on the numbers of vassals they have. I.e. making it much harder to take down the city of an empire with 6 satrapies than the city of a faction without satrapies.


    Thank you all in advance.
    alhoon is not a member of the infamous Hoons: a (fictional) nazi-sympathizer KKK clan. Of course, no Hoon would openly admit affiliation to the uninitiated.
    "Angry Uncle Gordon" describes me well.
    _______________________________________________________
    Beta-tester for Darthmod Empire, the default modification for Empire Total War that does not ask for your money behind patreon.
    Developer of Causa Belli submod for Darthmod, headed by Hammeredalways and a ton of other people.
    Developer of LtC: Random maps submod for Lands to Conquer (that brings a multitude of random maps and other features).

  2. #2
    Jake Armitage's Avatar Artifex
    Patrician

    Join Date
    Apr 2011
    Location
    apartment 6
    Posts
    4,694

    Default Re: Help needed: Editing CAI to want to make satrapies

    1) to increase/decrease the occupation decision you should check and mod:
    cai_personalities_tables
    cai_personality_occupation_decision_components_tables
    cai_personality_occupation_decision_priorities

    have a look onto this DeI submod which was making similar thing to what you're trying to
    https://www.twcenter.net/forums/show...de+ai+arbitris

    2) value should be moddable inside another CAI table, don't remember which one

    3) yes doable but it's complicated

    4) 100% possible but I don't know the procedure, never messesd up with units(settlements can't have more than 20 units)

  3. #3
    alhoon's Avatar Comes Rei Militaris
    took an arrow to the knee

    Join Date
    Apr 2008
    Location
    Chania, Greece
    Posts
    24,765

    Default Re: Help needed: Editing CAI to want to make satrapies

    Thanks
    alhoon is not a member of the infamous Hoons: a (fictional) nazi-sympathizer KKK clan. Of course, no Hoon would openly admit affiliation to the uninitiated.
    "Angry Uncle Gordon" describes me well.
    _______________________________________________________
    Beta-tester for Darthmod Empire, the default modification for Empire Total War that does not ask for your money behind patreon.
    Developer of Causa Belli submod for Darthmod, headed by Hammeredalways and a ton of other people.
    Developer of LtC: Random maps submod for Lands to Conquer (that brings a multitude of random maps and other features).

  4. #4
    Jake Armitage's Avatar Artifex
    Patrician

    Join Date
    Apr 2011
    Location
    apartment 6
    Posts
    4,694

    Default Re: Help needed: Editing CAI to want to make satrapies

    You're welcome, feel free to return making questions if needed (don't expect too much 'cause I'm rather busy).

  5. #5
    alhoon's Avatar Comes Rei Militaris
    took an arrow to the knee

    Join Date
    Apr 2008
    Location
    Chania, Greece
    Posts
    24,765

    Default Re: Help needed: Editing CAI to want to make satrapies

    Could someone please direct me to mods\submods that deal with #3 and #4?
    alhoon is not a member of the infamous Hoons: a (fictional) nazi-sympathizer KKK clan. Of course, no Hoon would openly admit affiliation to the uninitiated.
    "Angry Uncle Gordon" describes me well.
    _______________________________________________________
    Beta-tester for Darthmod Empire, the default modification for Empire Total War that does not ask for your money behind patreon.
    Developer of Causa Belli submod for Darthmod, headed by Hammeredalways and a ton of other people.
    Developer of LtC: Random maps submod for Lands to Conquer (that brings a multitude of random maps and other features).

  6. #6
    Jake Armitage's Avatar Artifex
    Patrician

    Join Date
    Apr 2011
    Location
    apartment 6
    Posts
    4,694

    Default Re: Help needed: Editing CAI to want to make satrapies

    3) It shouldn't be difficult to do but pop script is really complicated and I'll have to study it before attempting to give you a skeleton script (as a note it already contains features regarding treasury)
    but I can tell you 2 things:

    a) This is a generic script skeleton combining number of region owned and treasury (to let you see how a treasury function works)
    Pop script works differently though, it is a sort of refactored scripting type

    Code:
    local function AeF_01a_econ_corr(context)
    
        if context:faction():is_human() == true
        then
        local region_count = context:faction():region_list():num_items()
        local faction = context:faction():name()
        local treasury = context:faction():treasury()
        
            if region_count == 1
            then
    
                if treasury < 500
                then    
                scripting.game_interface:apply_effect_bundle("AeF_01a_econ_corr_01_01" ,faction, 1)
    
    .... then you can put a lot of things and variables
    
                end               
            end
        end
    end
    
    -- ###---------------------------------- END*
    
    -- ###------------------------- START *******
    -- CALLBACKS ---------------------------------------------------------------------
    -- ###-------------------------
    
    scripting.AddEventCallBack("FactionTurnStart", AeF_01a_econ_corr);
    
    -- ###---------------------------------- END*
    b) If you don't have any experience about scripting then leave it be, beleive me, don't begin to work on a complex script like the pop one
    if you're interested I'm gonna open a closed group for Rome 2 scripters quite soon, we can discuss about this in that group

    4) You can try by searching with advanced forum searches, maybe something will come out
    Otherwise there is a submod here for DeI but the links are down, I've sent a discord message to the author and other DeI devs, he or me will answer you and post the pack (if someone still has a copy). I'm 100% sure you can use it as a skeleton to understand what to do.
    http://www.twcenter.net/forums/showt...duced-Garrison
    Last edited by Jake Armitage; August 08, 2019 at 12:58 PM.

  7. #7
    alhoon's Avatar Comes Rei Militaris
    took an arrow to the knee

    Join Date
    Apr 2008
    Location
    Chania, Greece
    Posts
    24,765

    Default Re: Help needed: Editing CAI to want to make satrapies

    3) Well, since I'm nearly a novice in scripting, how about $$$ bonuses like the Sassanids have in ATW? There must be something somewhere that tells the game how much cash the vassal is paying. I want to increase that even if I don't change the pop.

    At the very least, the script you sent makes sense to me.

    What I would like is to change this:
    "local region_count = context:faction():region_list():num_items()"
    with
    "local Vassal_count = context:faction():?????:num_items()"

    Where the ???? is the vassal list. I would like to know what ???? would be to tell the game to check the number of vassals.
    Then I could send a bunch of effects including tech increase and food from the effects of techs and faction traits. Frankly, I could do a lot of things from that.


    4) I can modify garrisons from the DB I think. What I would like is to tie garrisons or garrison bonuses to the number of vassals the CAI has. I.e. an empire with 4 vassals to have stronger garrisons that an empire with 1 vassal.

    However, if I can do #3 from your script, I could simply give them a +15% or something morale while defending.
    Last edited by alhoon; August 08, 2019 at 04:56 PM.
    alhoon is not a member of the infamous Hoons: a (fictional) nazi-sympathizer KKK clan. Of course, no Hoon would openly admit affiliation to the uninitiated.
    "Angry Uncle Gordon" describes me well.
    _______________________________________________________
    Beta-tester for Darthmod Empire, the default modification for Empire Total War that does not ask for your money behind patreon.
    Developer of Causa Belli submod for Darthmod, headed by Hammeredalways and a ton of other people.
    Developer of LtC: Random maps submod for Lands to Conquer (that brings a multitude of random maps and other features).

  8. #8
    Jake Armitage's Avatar Artifex
    Patrician

    Join Date
    Apr 2011
    Location
    apartment 6
    Posts
    4,694

    Default Re: Help needed: Editing CAI to want to make satrapies

    3) more or less it should be doable but it would require some time I don't have atm

    4) ah I see now, don't think you can do that 'cause I don't think you can spawn units for garrison armies ('cause they don't have an actual general and they are not linked to the garrison captain)

  9. #9
    alhoon's Avatar Comes Rei Militaris
    took an arrow to the knee

    Join Date
    Apr 2008
    Location
    Chania, Greece
    Posts
    24,765

    Default Re: Help needed: Editing CAI to want to make satrapies

    Still, you have helped very much! I found the list of LUA functions.

    If I may, does "num_allies" includes defensive alliances?
    alhoon is not a member of the infamous Hoons: a (fictional) nazi-sympathizer KKK clan. Of course, no Hoon would openly admit affiliation to the uninitiated.
    "Angry Uncle Gordon" describes me well.
    _______________________________________________________
    Beta-tester for Darthmod Empire, the default modification for Empire Total War that does not ask for your money behind patreon.
    Developer of Causa Belli submod for Darthmod, headed by Hammeredalways and a ton of other people.
    Developer of LtC: Random maps submod for Lands to Conquer (that brings a multitude of random maps and other features).

  10. #10
    Jake Armitage's Avatar Artifex
    Patrician

    Join Date
    Apr 2011
    Location
    apartment 6
    Posts
    4,694

    Default Re: Help needed: Editing CAI to want to make satrapies

    Never used it yet but I think I've seen it around in some script, by intuit it should count military and defensive.
    I have no problem at all into answering and give some generic helps, doing scripts is another matter, though.

    Have a look to all DeI scripts and mine (inside DeI Testudo submod, it contains PIGS, RPGu and VPS scripts too), they will help you a lot into understanding what to do and maybe you'll be able to find some adaptable skeleton code.
    https://www.twcenter.net/forums/show...-upd-aug-07-19
    Last edited by Jake Armitage; August 09, 2019 at 11:51 AM.

  11. #11
    alhoon's Avatar Comes Rei Militaris
    took an arrow to the knee

    Join Date
    Apr 2008
    Location
    Chania, Greece
    Posts
    24,765

    Default Re: Help needed: Editing CAI to want to make satrapies

    Thank you!
    Just for clarification, I appreciate a lot everything you told me and I would never expect you to start writing scripts for every person that asked a question.

    I don't mind the pop script. I don't use manpower etc. Just the usual pop for city increase and replenishment.

    If I could do a "If AI has 1-2 vassals +500 coins. If AI has 3-5 vassals +1000 coins." and a "If AI has 1-2 vassals, activate +10% morale. If AI 3-5 vassals, activate +10% defense on top of that. If AI has 6+ vassals +1 recruitment slot" I would be happy.
    To be clear, I plan to work on such a script myself, I am not asking you to spend time. I actually find it a nice challenge.
    Last edited by alhoon; August 09, 2019 at 02:45 PM.
    alhoon is not a member of the infamous Hoons: a (fictional) nazi-sympathizer KKK clan. Of course, no Hoon would openly admit affiliation to the uninitiated.
    "Angry Uncle Gordon" describes me well.
    _______________________________________________________
    Beta-tester for Darthmod Empire, the default modification for Empire Total War that does not ask for your money behind patreon.
    Developer of Causa Belli submod for Darthmod, headed by Hammeredalways and a ton of other people.
    Developer of LtC: Random maps submod for Lands to Conquer (that brings a multitude of random maps and other features).

  12. #12
    Jake Armitage's Avatar Artifex
    Patrician

    Join Date
    Apr 2011
    Location
    apartment 6
    Posts
    4,694

    Default Re: Help needed: Editing CAI to want to make satrapies

    What's the "usual pop for city increase and replenishment"?
    I've never played Rome vanilla, just DeI from start (began playing Rome 3/4 years ago).

    As soon as you have it, post your code skeleton, I'll have a look.

  13. #13
    alhoon's Avatar Comes Rei Militaris
    took an arrow to the knee

    Join Date
    Apr 2008
    Location
    Chania, Greece
    Posts
    24,765

    Default Re: Help needed: Editing CAI to want to make satrapies

    And I've never played DEI. In R2TW there is no manpower etc. I am not sure how cities increase in DEI but in vanilla there's a slow growth based on many things and once you have enough pop, you open up a new slot in your cities. The bigger the city, the greatest the cost in population.

    As for the script, thanks, but it will take some time. :-)
    alhoon is not a member of the infamous Hoons: a (fictional) nazi-sympathizer KKK clan. Of course, no Hoon would openly admit affiliation to the uninitiated.
    "Angry Uncle Gordon" describes me well.
    _______________________________________________________
    Beta-tester for Darthmod Empire, the default modification for Empire Total War that does not ask for your money behind patreon.
    Developer of Causa Belli submod for Darthmod, headed by Hammeredalways and a ton of other people.
    Developer of LtC: Random maps submod for Lands to Conquer (that brings a multitude of random maps and other features).

  14. #14
    Jake Armitage's Avatar Artifex
    Patrician

    Join Date
    Apr 2011
    Location
    apartment 6
    Posts
    4,694

    Default Re: Help needed: Editing CAI to want to make satrapies

    ahhhhh, now I see...

    if you want to mod those thresholds go to
    campaign variables > settlement_development_point_cost_secondary_slot_1 ... (there are various entries)
    you can see some modded examples here: http://www.mediafire.com/file/o4vbhp...nment.zip/file

    There's nothing else you can mod about that (without going hex editing) besides various growth effects around the cdir/effect junctions tables (scripted or not).

    C'mon man, come to DeI (and if you're the micromanager player try TESTUDO submod - no ads meant )
    Last edited by Jake Armitage; August 10, 2019 at 10:35 AM.

  15. #15
    alhoon's Avatar Comes Rei Militaris
    took an arrow to the knee

    Join Date
    Apr 2008
    Location
    Chania, Greece
    Posts
    24,765

    Default Re: Help needed: Editing CAI to want to make satrapies

    While I had considered DEI, I want something simpler and without much micromanaging. I am a casual gamer. I just think that the game would be more interesting and challenging if there were a bunch of factions that you had to take first before going for the "head" and the CAI defends better when they have few regions.
    Last edited by alhoon; August 13, 2019 at 10:10 PM.
    alhoon is not a member of the infamous Hoons: a (fictional) nazi-sympathizer KKK clan. Of course, no Hoon would openly admit affiliation to the uninitiated.
    "Angry Uncle Gordon" describes me well.
    _______________________________________________________
    Beta-tester for Darthmod Empire, the default modification for Empire Total War that does not ask for your money behind patreon.
    Developer of Causa Belli submod for Darthmod, headed by Hammeredalways and a ton of other people.
    Developer of LtC: Random maps submod for Lands to Conquer (that brings a multitude of random maps and other features).

  16. #16
    alhoon's Avatar Comes Rei Militaris
    took an arrow to the knee

    Join Date
    Apr 2008
    Location
    Chania, Greece
    Posts
    24,765

    Default Re: Help needed: Editing CAI to want to make satrapies

    Keeping in mind that I am a total, complete, utter n0000b when it comes to scripting:

    Code:
    local function alhoon_test (context)
    
        if context:faction():is_human() == false
        then
        local region_count = context:faction():region_list():num_items()
        local faction = context:faction():name()
        local num_vass_allies = context:faction():num_allies()
        
            if region_count > 0 
            then
    
                if num_vass_allies > 0
                then    
                scripting.game_interface:apply_effect_bundle("alhoon_stuff_1" ,faction, 1)
    
    .... then you can put a lot of things and variables
    
                end               
            end
        end
    end
    
    -- ###---------------------------------- END*
    
    -- ###------------------------- START *******
    -- CALLBACKS ---------------------------------------------------------------------
    -- ###-------------------------
    
    scripting.AddEventCallBack("FactionTurnStart", alhoon_test);
    
    -- ###---------------------------------- END*

    Would that check each faction, at the start of each of their turns to see if: they have at least one region and if yes, if they have at least one vassal \ ally and if both are true go and do stuff?

    I have added my changes on Jake's code in red to make them visible.
    Last edited by alhoon; August 14, 2019 at 11:14 PM.
    alhoon is not a member of the infamous Hoons: a (fictional) nazi-sympathizer KKK clan. Of course, no Hoon would openly admit affiliation to the uninitiated.
    "Angry Uncle Gordon" describes me well.
    _______________________________________________________
    Beta-tester for Darthmod Empire, the default modification for Empire Total War that does not ask for your money behind patreon.
    Developer of Causa Belli submod for Darthmod, headed by Hammeredalways and a ton of other people.
    Developer of LtC: Random maps submod for Lands to Conquer (that brings a multitude of random maps and other features).

  17. #17
    Jake Armitage's Avatar Artifex
    Patrician

    Join Date
    Apr 2011
    Location
    apartment 6
    Posts
    4,694

    Default Re: Help needed: Editing CAI to want to make satrapies

    I'll see into it, give me some days

  18. #18
    Jake Armitage's Avatar Artifex
    Patrician

    Join Date
    Apr 2011
    Location
    apartment 6
    Posts
    4,694

    Default Re: Help needed: Editing CAI to want to make satrapies

    Sorry man, haven't had time yet, hope to do that before next week.

  19. #19
    alhoon's Avatar Comes Rei Militaris
    took an arrow to the knee

    Join Date
    Apr 2008
    Location
    Chania, Greece
    Posts
    24,765

    Default Re: Help needed: Editing CAI to want to make satrapies

    Just saw your reply... 3 days later. That should tell you that I am not in a hurry. Also, why are you apologizing? Man, I am already grateful for what you did. You don't have to do anything to help me.
    Last edited by alhoon; August 28, 2019 at 03:24 PM.
    alhoon is not a member of the infamous Hoons: a (fictional) nazi-sympathizer KKK clan. Of course, no Hoon would openly admit affiliation to the uninitiated.
    "Angry Uncle Gordon" describes me well.
    _______________________________________________________
    Beta-tester for Darthmod Empire, the default modification for Empire Total War that does not ask for your money behind patreon.
    Developer of Causa Belli submod for Darthmod, headed by Hammeredalways and a ton of other people.
    Developer of LtC: Random maps submod for Lands to Conquer (that brings a multitude of random maps and other features).

  20. #20
    alhoon's Avatar Comes Rei Militaris
    took an arrow to the knee

    Join Date
    Apr 2008
    Location
    Chania, Greece
    Posts
    24,765

    Default Re: Help needed: Editing CAI to want to make satrapies

    Anyone that could help?
    alhoon is not a member of the infamous Hoons: a (fictional) nazi-sympathizer KKK clan. Of course, no Hoon would openly admit affiliation to the uninitiated.
    "Angry Uncle Gordon" describes me well.
    _______________________________________________________
    Beta-tester for Darthmod Empire, the default modification for Empire Total War that does not ask for your money behind patreon.
    Developer of Causa Belli submod for Darthmod, headed by Hammeredalways and a ton of other people.
    Developer of LtC: Random maps submod for Lands to Conquer (that brings a multitude of random maps and other features).

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
  •