Results 1 to 18 of 18

Thread: Year Jump mod for EB (help wanted)

  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.

  7. #7
    Member Member Gugus's Avatar
    Join Date
    Jul 2007
    Location
    Where Amber Route begins
    Posts
    77

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

    Also intrested, only lurking. Unfortuantelly have no spare time and skills to help :).
    G

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

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

    I now have a more elegant implementation of the code. As we speak, I'm fast-forwarding to 200 BCE in an EB campaign. I haven't loaded the background script, so time is passing extremely quickly.

    I'll eventually need to change the triggers so that you can load the background script before fast-forwarding. I also need to nut out a few issues to make it a smoother ride. Once that's all done, I'll let you guys know.

  9. #9
    Member Megas Methuselah's Avatar
    Join Date
    Aug 2007
    Location
    Prairie Grasslands
    Posts
    5,040

    Thumbs up Re: Year Jump mod for EB (help wanted)

    Wow. I admit, I never visit the unofficial mod part of EB's forum, and now that I did, I'm glad of it. I can't wait for this, it sounds so cool. I stopped playing a Baktrian campaign a while back because it got a little boring, with the same reason applying to any of my dead campaigns. This mod should put quite a bit of spice to these games.





    Someone should sticky this thread.

    EDIT: I'm no help as a modder, sorry. But I want this mod!
    Last edited by Megas Methuselah; 12-02-2007 at 20:21.

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

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

    Cheers, M.

    I can't get the battle results screen to disappear automatically, which means you have to hit enter sometimes when you're fast-forwarding. I've got some workarounds in mind, but it's not foolproof yet.

    I also haven't tested it while the EB background script is running. If Pharnakes is right, it's going to go mental when I do that. Sigh.

  11. #11
    Asia ton Barbaron mapper Member Pharnakes's Avatar
    Join Date
    Feb 2007
    Location
    The Kingdom of Fife
    Posts
    1,768

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

    Yeah, sorry but I would be very suprised if you get this to work. Sorry
    Asia ton Barbaron The new eastern mod for eb!

    Laziest member of the team My red balloons, as red as the blood of he who mentioned Galatians.
    Roma Victor!

    Yous ee gishes?

  12. #12
    Urwendur Ûrîbêl Senior Member Mouzafphaerre's Avatar
    Join Date
    Nov 2003
    Location
    Mikligarðr
    Posts
    6,899

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

    .
    Quote Originally Posted by Methuselah
    Someone should sticky this thread.
    Thread Tools > Stick the thread to the top
    .
    Ja mata Tosa Inu-sama, Hore Tore, Adrian II, Sigurd, Fragony

    Mouzafphaerre is known elsewhere as Urwendil/Urwendur/Kibilturg...
    .

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

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

    Wow. At first it seemed like Pharnakes was right. But then I restored all my backup files and it looks like I did something somewhere that completely broke EB. So Pharnakes may or may not be right, and it's time for an ol' fashioned "complete reinstall".

    I'm planning to produce a modified version of the EBBS that plays for you for ten years whenever it's triggered. Hopefully that'll work...

  14. #14
    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
    I'm planning to produce a modified version of the EBBS that plays for you for ten years whenever it's triggered. Hopefully that'll work...
    Good luck mate!

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

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

    Cheers, OWN. So far, so good. Have restructured my earlier code to fit in the EBBS, and it works fine in RTW 1.5 (I always test there first, because it's so much faster / easier to mod). Tomorrow I'll start the grand run.

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

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

    Or perhaps not :). Am still working on dismissing the diplomacy and battle results screens automagically. Does anyone know a good keypress utility? I've pretty much given up on scripting it. I don't think you can select the relevant ui_element from the script. Or at least, I don't know what the correct name is.

  17. #17
    Asia ton Barbaron mapper Member Pharnakes's Avatar
    Join Date
    Feb 2007
    Location
    The Kingdom of Fife
    Posts
    1,768

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

    Don't think you can script them away. In fact I'm sure you can't.

    Might be able to switch them off in prefrences, though.
    Asia ton Barbaron The new eastern mod for eb!

    Laziest member of the team My red balloons, as red as the blood of he who mentioned Galatians.
    Roma Victor!

    Yous ee gishes?

  18. #18

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

    This sounds awesome for a quick jump into the future if you get bored, i don't mind clicking some battle resolves or diplomatic junk, ill take any working version you have that wont screw my game

    PS: would it be save compatible?

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