Results 1 to 30 of 42

Thread: Can I use a script to end the turn?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Finder of Little Oddities Senior Member Makanyane's Avatar
    Join Date
    Jan 2006
    Posts
    2,220

    Default Re: Can I use a script to end the turn?

    on that last example think you're missing

    set_counter loop 0

    under the declare_counter
    not sure if it defaults to that otherwise.

    @Monkwarrior, I haven't tried -ai from background script, I might have a look at that. I did get it to save with that on shortcut at one stage but, reloading the save without the shortcut command still set it off on its own again, so I rather gave up on looking at it.

    If you are doing anything that switches command to AI I think you may need to look at how rest of script works, I assume that it messes up anything reliant on LocalFaction triggers. I've got Year Jump script triggerable while background script is in use, so I've put a counters in to determine what local faction is on first turn, and use those counters throughout instead of LocalFaction

    EDIT: old discussion on -ai for info
    https://forums.totalwar.org/vb/showt...ghlight=run_ai
    Last edited by Makanyane; 11-28-2007 at 12:12.
    Not used mods before? Looking for something small and fun?!
    Download the:

  2. #2
    Member Member mrtwisties's Avatar
    Join Date
    Nov 2007
    Location
    Sydney, Australia
    Posts
    235

    Default Re: Can I use a script to end the turn?

    Makanyane - in my own chaste way, I love you. Here's the partially working script:

    script

    declare_counter loop
    set_counter loop 0

    monitor_event FactionTurnStart FactionType romans_julii
    and I_TurnNumber < 5

    console_command control greek_cities
    campaign_wait 10
    console_command add_money 40000
    console_command control romans_julii

    end_monitor

    while I_CompareCounter loop = 0
    end_while

    end_script
    This fast-forwarded me to 268 BCE. All I had to do was click a few boxes along the way. When I got to 268 BCE, the AI had taken Segesta and built a whole bunch of units for the Julii. Meanwhile, the Greeks had built up a fortune of some hundreds of thousands of denarii.

    So all I have to do is figure out how to avoid having to click through the scrolls, and I'll be able to use this to fast forward to any turn.

  3. #3
    Member Member mrtwisties's Avatar
    Join Date
    Nov 2007
    Location
    Sydney, Australia
    Posts
    235

    Default Re: Can I use a script to end the turn?

    I tested the script again, using it to fast forward 50 turns to 245 BCE. If you decide to do the same, make sure you turn off "follow AI characters", which I didn't do the first time. Turns out the AI likes to put spies and diplomats everywhere, which means you end up following one helluva lot of AI characters. Running RTW.exe in windowed mode was definitely a good idea, though.

    The Romans and the Greeks got into an extended naval war, which I witnessed first-hand from both sides. It was actually kind of fun to see, and verified that both factions are highly active when they're under AI control. I guess forgetting to take away +40,000 denarii for the Greeks every turn probably contributed to them getting ornery, huh?

    I had also forgotten that those dog units existed in vanilla RTW. Turns out the AI likes to move around whole armies of them. Not sure how I feel about that. Pretty sure the answer is "mirthful", though - the dogs of the Julii more or less chased the Gauls out of northern Italy. Dogmatix would have been ashamed. But then the Gauls came back with a whole mass of soldiers, and they all had a bunch o' fight near the Po.

    By the end of the 50 turns:
    * The Julii owned northern Italy
    * The Brutii owned Epirus and Dalmatia
    * The Scipii owned Sicily, Sardinia, Corsica and bits of Tunisia
    * The Gauls owned bits of Spain, for which I don't blame them, I understand it's got lovely countryside
    * The Seleucids were swallowed by Parthia and the Ptolemies (I mean, *cough*, Egypt)
    * Pontus were on their way to becoming a superpower
    * The Sweboz and the Getai were both massive

    But despite all the fun, it was 50 turns that I had to sit there for, clicking on the occasional scroll. Here are the ones that paused or delayed the turn sequence. I need to find a way to automagically resolve these, so I can do something else with my life while the script is fast-forwarding:

    * Diplomacy scrolls
    * Naval battle predeployment
    * Land battle predeployment
    * Assistance requested from SPQR
    * Senate missions (create massive lag during the turn sequence)

    I can't find events for any of these in the docudemon. Do they exist? And can anyone suggest code for automagically resolving these happenings (preferably with the AI deciding what to do)?

  4. #4
    Member Member mrtwisties's Avatar
    Join Date
    Nov 2007
    Location
    Sydney, Australia
    Posts
    235

    Default Re: Can I use a script to end the turn?

    Thanks for the -ai link, M. I'm testing that as well.

  5. #5
    Member Member mrtwisties's Avatar
    Join Date
    Nov 2007
    Location
    Sydney, Australia
    Posts
    235

    Default Re: Can I use a script to end the turn?

    Hmmm... my capacity to edit my posts seems to appear and disappear at random.

    Anyhoo, first attempts with the -ai command are a bit buggy. I can put myself in control of a faction, I can end turn, I can keep playing with that faction for a bit... I can even save the game I'm playing with the faction. But I can't load the game again. Any attempt to do so CTDs.

    I'm trying again with a different faction - the Julii, instead of the Gauls. I figure the Gauls aren't unlocked in my RTW game, so that might be why loading a Gallic game CTDs.

  6. #6
    Member Member mrtwisties's Avatar
    Join Date
    Nov 2007
    Location
    Sydney, Australia
    Posts
    235

    Default Re: Can I use a script to end the turn?

    The -ai thing totally works. I just took over a Julii campaign in 168 BCE. Then I saved it. Then I closed RTW. Then I loaded it and played for a bit.

    Totally. Works.

  7. #7
    Notepad user Member Red Spot's Avatar
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    491

    Default Re: Can I use a script to end the turn?

    afaik the -ai switch will not work properly ...

    at least I've ran a zillion games with the -ai switch and there is always "something" that makes me believe there is some diff. (dont ask me what, I just wouldnt risk it, the -ai switch clearly hasnt been intended to jump a campaign ... my advise, dont use it as such)


    also about the "simulate_mouse_click lclick_down/up" ... afaik you do not need both, dont know where people got the 2nd command from but I'm not using it and have the same results ...


    G

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO