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

Thread: AI autopilot command

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default AI autopilot command

    I remember a while ago there was an explanation on how to make it so that the AI plays for the player as well (i.e. when it's the player's turn the AI plays it like another faction). I sort of remember it involved putting a -ai suffix to the mod shortcut, but I tried that and it hasn't worked beyond preventing scrolls from opening in-game.

    Can anyone tell me? I've been thinking of, among other things, allowing the AI to make a mess of the Romans or the Seleucids for a while before taking manual control for a more unique game.


  2. #2
    DimeBagHo's Avatar Praeses
    Moderator Emeritus

    Join Date
    Mar 2005
    Location
    Auckland
    Posts
    7,943

    Default Re: AI autopilot command

    Adding -ai to the shortcut is all you need to do, but IIRC you have to start the campaign in ai mode, so you can't just load a normal campaign, and once started as an ai campaign there is no way to change the campaign back to a normal campaign.

  3. #3

    Default Re: AI autopilot command

    I know that End of Days 2 uses a script to do what you want (AI runs the faction for a specified amount of time). You should look at how they did that.

    Expand your borders, a mod based on XGM 5.

  4. #4
    DimeBagHo's Avatar Praeses
    Moderator Emeritus

    Join Date
    Mar 2005
    Location
    Auckland
    Posts
    7,943

    Default Re: AI autopilot command

    Good to know CV. I tried out something like that a couple of years back but never got it to work right.

  5. #5

    Default Re: AI autopilot command

    Quote Originally Posted by DimeBagHo View Post
    Adding -ai to the shortcut is all you need to do, but IIRC you have to start the campaign in ai mode, so you can't just load a normal campaign, and once started as an ai campaign there is no way to change the campaign back to a normal campaign.
    Ah, that's a pity. Oh well, it was worth a try.

    Quote Originally Posted by CaesarVincens View Post
    I know that End of Days 2 uses a script to do what you want (AI runs the faction for a specified amount of time). You should look at how they did that.
    I do remember that... hm. Thanks. I will check it out.


  6. #6

    Default Re: AI autopilot command

    You're welcome. The EoD team has some pretty neat stuff, definitely worth checking out for ideas.

    Expand your borders, a mod based on XGM 5.

  7. #7
    Boriak's Avatar Senator
    Join Date
    Sep 2009
    Location
    Slovenia
    Posts
    1,199

    Default Re: AI autopilot command

    Quote Originally Posted by Quirinal View Post
    Can anyone tell me? I've been thinking of, among other things, allowing the AI to make a mess of the Romans or the Seleucids for a while before taking manual control for a more unique game.
    Yes, that would be a good challenge.

  8. #8

    Default Re: AI autopilot command

    I have found a year jump script for vanilla BI by Epistolary Richard, which is pretty similar to the EoD2 one. It requires setting the number of years you want to jump beforehand (before you start up a game) but you can play it after the autopilot lapses. It's amazing, jumping 40+ years into the game really makes for a different experience, I started a game as the WRE in 409AD with Italy and Gaul under barbarian control, great fun. Also, you get more characterful family members with long trait lists. The only limit is the Slav emergence at turn 93. I have tried to port it to XGM, but to no avail, I must be doing something wrong. But I imagine a fairly experienced modder could do it in no time.
    Last edited by Publius Quirinus; February 01, 2010 at 10:29 AM. Reason: reverse brain fart >.<


  9. #9

    Default Re: AI autopilot command

    Can you upload the script and export_descr_advice?

    Expand your borders, a mod based on XGM 5.

  10. #10

    Default Re: AI autopilot command

    The files are here: http://www.disko.co.uk/files/bi_extra_hordes_and_factions_v1_3.zip

    Credits to professorspatula

    If you mean what I added:
    Code:
    ;------------------------------------------ ERYearJump
    
    
    
    
    ;------------------------------------------
    AdviceThread ERYearJump_seleucid_Thread
        GameArea Campaign
    
        Item ERYearJump_seleucid_Text_01
            Uninhibitable
            Verbosity  0 
            Threshold  1 
            Attitude Normal
            Presentation Default
            Title ERYearJump_Text_01_Title
            Script scripts\show_me\ERYearJump_seleucid.txt
            Text ERYearJump_Text_01_Text1
    
    ;------------------------------------------

    And the script itself

    Code:
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;       WELCOME TO YEAR JUMP                         ;;;
    ;;; Follow the instructions below                      ;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    script
    console_command control slavs
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;       BEFORE YOU LAUNCH THE GAME                   ;;;
    ;;;   Input the _turn_ number you want to jump to      ;;;
    ;;;   (2 turns in a year) in place of the '5' below    ;;;
    ;;;                                                    ;;;
    ;;;  - number cannot exceed 93 (Slavs emerge)          ;;;
    ;;;  - if your own faction or Sassanids are destroyed  ;;;
    ;;;     then it will not work, reload campaign         ;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;    DO NOT CHANGE ANYTHING ABOVE HERE               ;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    ;;; INSERT DESIRED TURN NUMBER IN LINE BELOW
    while I_TurnNumber < 50
    
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;       DO NOT CHANGE ANYTHING BELOW HERE            ;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    end_while
    console_command control seleucid
    wait 3
    console_command control seleucid
    
    monitor_event FactionTurnEnd FactionIsLocal
    and Treasury < -50000
    console_command add_money 10000
    terminate_monitor
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    and Treasury < -40000
    console_command add_money 10000
    terminate_monitor
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    and Treasury < -30000
    console_command add_money 10000
    terminate_monitor
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    and Treasury < -20000
    console_command add_money 10000
    terminate_monitor
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    and Treasury < -10000
    console_command add_money 10000
    terminate_monitor
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    and Treasury < 0
    console_command add_money 10000
    terminate_monitor
    end_monitor
    monitor_event FactionTurnStart FactionIsLocal
    and Treasury > 0
    set_counter loop 1
    terminate_monitor
    end_monitor
    while I_CompareCounter loop < 1
    end_while
    end_script
    I just changed the BI faction name to the xgm one, in this case I modified "ERYearJump_huns.txt". Don't know what the slav line does, so I left it.
    Last edited by Publius Quirinus; February 01, 2010 at 10:28 AM. Reason: fixed link


  11. #11

    Default Re: AI autopilot command

    Ah, the part about the slavs makes it so you don't control any living faction. The EoD II script probably works in a similar way. If I do end up working on it at all and if I get it to work, I'll be sure to let you know.

    Expand your borders, a mod based on XGM 5.

  12. #12
    DimeBagHo's Avatar Praeses
    Moderator Emeritus

    Join Date
    Mar 2005
    Location
    Auckland
    Posts
    7,943

    Default Re: AI autopilot command

    I had a quick play around with it and I got it to work by doing the following:

    (1) Add this stuff to the end of XGM_Campaign_Script.txt. The romans_scipii bit should remain unchanged. Change the '50' to whatever number of turns you want to skip. Change 'seleucid' to the faction you are playing.

    Code:
        console_command control romans_scipii
    
        while I_TurnNumber < 50
        end_while
        console_command control seleucid
        wait 3
        console_command control seleucid
    (2) Replace the romans_scipii entry in descr_strat.txt with this. To keep things tidy you should also transfer their two starting regions to another faction and set up garrisons, but this isn't strictly necessary.

    Code:
    faction	romans_scipii, comfortable caesar
    dead_until_resurrected
    re_emergent
    denari	10000
    When you start the campaign it will run for the number of turns you specified and then stop. When I tried it I had to save the game and load it again to regain control of the Selecids, but everything seemed to be working fine after that. Also you might want to play with loyalty off - bad things will probably happen if the Romans have a region go over to the Roman rebels.
    Last edited by DimeBagHo; February 01, 2010 at 02:30 PM.

  13. #13

    Default Re: AI autopilot command

    A couple of questions, do I add these in 'XGM_Campaign_Script.txt' in addition to the original script? It's in a file of its own in show_me under 'ERYearJump_seleucid.txt'. Also, do I need to make any changes to 'export_descr_advice' etc.? Thanks. =]


  14. #14
    DimeBagHo's Avatar Praeses
    Moderator Emeritus

    Join Date
    Mar 2005
    Location
    Auckland
    Posts
    7,943

    Default Re: AI autopilot command

    You don't need the original script and using this method you don't need to make any changes to export_descr_advice.

    You can find XGM_Campaign_Script.txt in the campaign folder along with descr_srat.txt. The main campaign is in: [rtw]xgm\Data\world\maps\campaign\[imperial_campaign/barbarian_invasion/Alexander]

  15. #15

    Default Re: AI autopilot command

    Just did a test run, set it to jump 100 turns... but Seleucids got wiped out about 90+ turns in. Dang. Should really try with less turns.


  16. #16

    Default Re: AI autopilot command

    I went for 60 turns (30 years) and just managed to catch the Seleucids just barely hanging on: I had Ipsus, Ephesus, Harmozia, Charax and Arbela left, and only Ipsus not actually under siege.

    It was a little hairy for the first few turns - the Armenians, Parthians, Ptolemaics and Baktrians were all at war with me, I had to match levy phalangites (often undermanned) against machimoi phalangites and the like in city fights. Greek hoplites were particularly irritating because they would smash through the pikes and my levy phalanx would try to turn to the side (facing the walls), getting butchered in the process. This is particularly bad for this scenario because I was broke, and so could not recruit anything. Another thing that made it difficult was the fact that I had just come back from a stint in vanilla BI.... I quickly relearned that being good at using cavalry in vanilla =/= being good at using cavalry.


    I think I've gotten things mostly sorted out though. I got a surplus by exterminating Side, and the Indie Greeks are my ally (for now). I got ceasefires and trade rights from all my enemies but the Ptolemaics. I've also gotten Antioch back, so it should be a lot easier for me from now. Pontus is neutral, as is Macedon.

    Definitely a fun experience. I would guess a horde campaign with the beginning decade or two under AI autopilot would also be interesting.


  17. #17
    Boriak's Avatar Senator
    Join Date
    Sep 2009
    Location
    Slovenia
    Posts
    1,199

    Default Re: AI autopilot command

    Does this work with the AI bonuses turned off? It seems to me the script is dormant if they are off.

    Do I have to remove the added parts from the script between saving and reloading the game?

    Also, I didn't find the line in descr_strat.txt that would start with "faction romans_scipii". There were a lot of lines that started with "sub_faction". What am I looking for?

    I want to try trick this with Gauls. Is the Vanilla game name different or are the XGM Gauls also Gauls in Vanilla?

  18. #18

    Default Re: AI autopilot command

    Quote Originally Posted by Boriak View Post
    Does this work with the AI bonuses turned off? It seems to me the script is dormant if they are off.
    They definitely do, I play on half of reduced bonuses and it worked for me. Don't know about the details though, modding noob here.


  19. #19
    DimeBagHo's Avatar Praeses
    Moderator Emeritus

    Join Date
    Mar 2005
    Location
    Auckland
    Posts
    7,943

    Default Re: AI autopilot command

    Quote Originally Posted by Boriak View Post
    Does this work with the AI bonuses turned off? It seems to me the script is dormant if they are off.
    It should work, and I recommend using reduced bonuses. Otherwise your own faction is likely to be swamped while on auto-pilot.
    Do I have to remove the added parts from the script between saving and reloading the game?
    No, the script only runs once at the start of the campaign anyway, so there's no need to remove anything later.
    Also, I didn't find the line in descr_strat.txt that would start with "faction romans_scipii". There were a lot of lines that started with "sub_faction". What am I looking for?
    It should definitely be in there around line no. 1724.
    I want to try trick this with Gauls. Is the Vanilla game name different or are the XGM Gauls also Gauls in Vanilla?
    The internal faction names are the same as vanilla except for 'romans_senate' which has been changed to 'slavs' (for reasons relating to the way that the emergent factions code works).

  20. #20
    Boriak's Avatar Senator
    Join Date
    Sep 2009
    Location
    Slovenia
    Posts
    1,199

    Default Re: AI autopilot command

    Well, I tried with Gaul but they got killed somewhere in between and time just kept going until I finally quit the game. I will try again, this time with Germania.

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
  •