Results 1 to 18 of 18

Thread: Year Jump mod for EB (help wanted)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Member Member mrtwisties's Avatar
    Join Date
    Nov 2007
    Location
    Sydney, Australia
    Posts
    235

    Default Year Jump mod for EB (help wanted)

    Aaages back, Epistolary Richard created a year jump mod for BI. It handed control to the computer for a set number of turns, after which you took over.

    I'd really like to get something similar working for EB. The particular use that I have for it is I want to start as the Saka Rauka in Chighu in 172 BCE and run like hell from the Yuezhi. One way or another, it's going to make a fantastic AAR. But this capability would add to the replay value of any faction.

    I'm sure you can think of a bunch of other uses for it. Gotten bored of your campaign? Fast-forward 50 years (and perhaps change factions) and explore the alternate history of the world you're creating. Testing a money script or similar AI behaviour mod? Let the computer play it through for a hundred years or more on your behalf.

    The trick, of course, is to get it working.

    In the spoiler, you can see the version of Epistolary Richard's code that you would use if you were playing with the Alemanni.

    Spoiler Alert, click show to read: 

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;; 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 < 5


    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;; DO NOT CHANGE ANYTHING BELOW HERE ;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    end_while
    console_command control sassanids
    wait 3
    console_command control alemanni

    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


    It's very simple code. The problem is that it depends on the existence of an emergent faction, and AFAIK I'm not going to be able to put an emergent faction into EB.

    Since I'm pretty new to modding, and since I've already stuffed up my EB installation and won't have the time to reinstall for at least a week, I'd like your advice on how to proceed.

    So far as I've come up with, there are two options:

    1. Create a loop that works something like this:

    Spoiler Alert, click show to read: 
    script
    console_command control [faction1]
    console_command run_ai
    wait 100
    console_command control [faction2]
    console_command run_ai
    wait 100
    while I_TurnNumber < 5 ; you can change this to whatever
    end_while
    [transitional code to put you back in control of your own faction with > 0 cash]
    end_script

    The idea is that you'd switch to controlling faction 1, then run the AI until it's faction 1's turn, then switch to controlling faction 2, then run the AI until it's faction 2's turn, then go back to the beginning.

    Would this work? Is my code for it correct? Should I use halt_ai commands rather than wait commands?


    2. Turn the Casse into an emergent faction and use Epistolary Richard's code.

    Any comments or suggestions would be extremely welcome.

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

    Default Re: Year Jump mod for EB (help wanted)

    3. Use simulate_mouse_click to end turns, and set up a system to cycle through factions that you were in control of when the turn ended, so that every faction got to be controlled by the AI at least for most of the time.

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

    Default Re: Year Jump mod for EB (help wanted)

    I had a go on RTW 1.5, which still works. Am having trouble: https://forums.totalwar.org/vb/showthread.php?t=95802

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

    Default Re: Year Jump mod for EB (help wanted)

    This mod is now working for RTW 1.5, and when I get a chance I'll port it to EB. I'm surprised that no-one seems interested, given the number of people who wanted to get access to factional reforms as soon as possible. But I'll still release the code, just in case someone changes their mind.

    Here's the RTW 1.5 version:

    declare_counter loop
    set_counter loop 0

    monitor_event FactionTurnStart FactionType romans_julii
    and I_TurnNumber < 50
    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

  5. #5
    Barely a levy Member overweightninja's Avatar
    Join Date
    Jun 2007
    Location
    Plymouth, U.K
    Posts
    459

    Default Re: Year Jump mod for EB (help wanted)

    Quote Originally Posted by mrtwisties
    This mod is now working for RTW 1.5, and when I get a chance I'll port it to EB. I'm surprised that no-one seems interested, given the number of people who wanted to get access to factional reforms as soon as possible. But I'll still release the code, just in case someone changes their mind.

    Here's the RTW 1.5 version:
    Have a little patience mate, I notice this threads only been up a couple of days and this is certainly the first time I found it (in fact I came here from another thread).
    I'm afraid I can't offer any practical help right now, just wanted to say this does sound like a great idea if you can get it going, would be REALLY useful.
    Anyway all the best, I'll be following your progress
    Cheers

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

    Default Re: Year Jump mod for EB (help wanted)

    Fair call. I did sound a little petulant.

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