Results 1 to 8 of 8

Thread: [release]4tp/Ageing Script That Works with Hotseat

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Incomitatus's Avatar Ducenarius
    Join Date
    Jul 2007
    Location
    Tahoe, NV
    Posts
    916

    Default [release]4tp/Ageing Script That Works with Hotseat

    The 4tpy script that is in vanilla TATW and most (all?) submods uses a counter that advances at the start of each human player's turn, when it reaches 4, winter happens, the counter resets, and the following season characters age. It works fine in single player games, but in a hotseat game, adding a second human player doubles the ageing, three triples it, etc etc.*

    (*except sometimes it doesn't, because if you're playing a hotseat on one computer rather than saving and passing the file, a battle in one factions turn prevents the game from recognizing the next faction as a new turn, so the actual time acceleration is reduced, but still faster than it should be)

    I decided to solve this problem yesterday, since I was finally fed up with it. Over a year of periodically searching the forums never yielded a solution that anyone else had done so I decided it was time I do it myself. Unlike all the other modding I've done over the years for my own enjoyment, I'm making this revised script available to everyone instead of just explaining how to do it.

    This script also uses a counter to advance the seasons, but the counter only advances at the end of slave turn. It doesn't matter how many human players there are, or how many factions are destroyed. The counter only cares about the slave faction, and the slave faction can't be destroyed.

    I'm currently using this in my own hotseat game and everything seems to work perfectly, but it hasn't been extensively tested. There's no logical reason I can think of for there to be any problems, but more people using it in more games just to be sure would be a good thing!

    Installation

    1. Make a backup of ...\Medieval II\mods\Third_Age_3\data\world\maps\campaign\imperial_campaign\campaign_script.txt
    2. Open ...\Medieval II\mods\Third_Age_3\data\world\maps\campaign\imperial_campaign\campaign_script.txt
    3. Replace (or comment out, like I've done)
    Code:
    ;console_command toggle_perfect_spy
    ;console_command toggle_fow
    
    ;declare_counter quarter
    ;set_counter quarter 1
    ;
    ;monitor_event PreFactionTurnStart FactionIsLocal
    ;    if I_CompareCounter quarter == 1
    ;        console_command season summer
    ;    end_if
    ;    
    ;    if I_CompareCounter quarter == 2
    ;        console_command season summer
    ;    end_if
    ;    
    ;    if I_CompareCounter quarter == 3
    ;        console_command season summer
    ;    end_if
    ;    
    ;    if I_CompareCounter quarter == 4
    ;        console_command season winter
    ;    end_if
    ;    
    ;    inc_counter quarter 1
    ;    if I_CompareCounter quarter == 5
    ;        set_counter quarter 1
    ;    end_if
    ;end_monitor
    ;
    ;monitor_event FactionTurnEnd FactionType slave
    ;    and I_CompareCounter quarter > 1
    ;    console_command season summer
    ;end_monitor
    with
    Code:
    declare_counter season_counter
    set_counter season_counter 1
    
    monitor_event FactionTurnEnd FactionType slave
        inc_counter season_counter 1
    
        if I_CompareCounter season_counter == 4
            set_counter season_counter 0
        end_if
    end_monitor
    
    monitor_event PreFactionTurnStart FactionIsLocal
    
        if I_CompareCounter season_counter == 0
            console_command season winter
    
        end_if
    
        if I_CompareCounter season_counter > 0
            console_command season summer
    
        end_if
    end_monitor
    4. Delete the map.rwm (just to be safe)
    5. Start a new campaign (changes to campaign script are not save game compatible)
    6. Enjoy!

    Everyone is free to use this script. I do request credit if it's used in any public mods, but there's no need to ask permission. Oh, but I would like to be notified if it will be used in a mod, simply for the warm, fuzzy, useful feelings inside!

    AND, to give credit were credit is due, the idea occurred to me while reading this thread. Alpaca's example 4tpy script is much simpler than the one in TATW, but just as functional, and while studying the differences I realised there was no good reason I could think of why the counter had to be pegged to the LocalFaction. I only take credit for the idea of using the slave faction to advance the counter.
    Last edited by Incomitatus; September 26, 2012 at 09:29 AM.
    Homo sum: humani nihil a me alienum puto. - Terence

    My M2:TW 4TPY Script, Adapted to Work With Hotseat.


    Guides and Useful Posts of Mine
    Middle Earth Strategikon (M2:TW: TATW 3.2)(WIP: ~60% Complete)
    Advice on Playing as Gondor - Part I - Part II (M2:TW: TATW 3.2)
    Dirty Secret to Killing Trolls Fast and Easy (M2:TW: TATW)
    The Basics of Naval Engagements Part I - Part II (EMPIRE: DMUC)
    Roman Army Composition and Use (RTW: RTR Platinum)

  2. #2

    Default Re: [release]4tp/Ageing Script That Works with Hotseat

    Sounds great, I will give a try when I get back in town. I had no idea hotseat campaigns had this problem since I have never played one.

    The map.rwm file does not need to be deleted. You only have to start a new campaign.

  3. #3
    Incomitatus's Avatar Ducenarius
    Join Date
    Jul 2007
    Location
    Tahoe, NV
    Posts
    916

    Default Re: [release]4tp/Ageing Script That Works with Hotseat

    Quote Originally Posted by alreadyded View Post
    Sounds great, I will give a try when I get back in town. I had no idea hotseat campaigns had this problem since I have never played one.

    The map.rwm file does not need to be deleted. You only have to start a new campaign.
    Thanks! I know the map.rwm doesn't need to be deleted, but it never hurts. I tend to delete mine before every new game, just in case I tweaked something in descr_strat and forgot.
    Homo sum: humani nihil a me alienum puto. - Terence

    My M2:TW 4TPY Script, Adapted to Work With Hotseat.


    Guides and Useful Posts of Mine
    Middle Earth Strategikon (M2:TW: TATW 3.2)(WIP: ~60% Complete)
    Advice on Playing as Gondor - Part I - Part II (M2:TW: TATW 3.2)
    Dirty Secret to Killing Trolls Fast and Easy (M2:TW: TATW)
    The Basics of Naval Engagements Part I - Part II (EMPIRE: DMUC)
    Roman Army Composition and Use (RTW: RTR Platinum)

  4. #4
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: [release]4tp/Ageing Script That Works with Hotseat

    That is a more elegant script anyway, aside from fixing the hotseat thing. Not that it really matters I suppose - both are small scripts - but an elegant script is a thing of beauty. (Or is that just me? ) Nice one Incomitatus.

  5. #5
    Incomitatus's Avatar Ducenarius
    Join Date
    Jul 2007
    Location
    Tahoe, NV
    Posts
    916

    Default Re: [release]4tp/Ageing Script That Works with Hotseat

    Thanks, and nope not just you. I'd never scripted before (though I'd done a lot with triggers over the years and it's not that much different, once you adjust to the different syntax), so at first I didn't have an opinion on the old script. After I read up on how to do it, though, I looked at it again and groaned. Its more lines than needed! Shamefully wasteful!

    Also, I'm sure you've already noticed, but with mine you can fit it to any number of turns per year by changing just one number instead of adding a whole condition for each turn. Technically, I could have made it one line less by starting the counter at 0, like Alpaca's example, but I decided to start it at 1 so that the number it counts up to is the same as the turns per year. Not as 'simple', I guess, but more elegant and easier to keep track of if you're adjusting it, in my humble opinion.

    Glad you like it!
    Homo sum: humani nihil a me alienum puto. - Terence

    My M2:TW 4TPY Script, Adapted to Work With Hotseat.


    Guides and Useful Posts of Mine
    Middle Earth Strategikon (M2:TW: TATW 3.2)(WIP: ~60% Complete)
    Advice on Playing as Gondor - Part I - Part II (M2:TW: TATW 3.2)
    Dirty Secret to Killing Trolls Fast and Easy (M2:TW: TATW)
    The Basics of Naval Engagements Part I - Part II (EMPIRE: DMUC)
    Roman Army Composition and Use (RTW: RTR Platinum)

  6. #6
    Incomitatus's Avatar Ducenarius
    Join Date
    Jul 2007
    Location
    Tahoe, NV
    Posts
    916

    Default Re: [release]4tp/Ageing Script That Works with Hotseat

    Shameless BUMP.

    Also, I've now been testing the script for 30 turns. It works like a charm!
    Homo sum: humani nihil a me alienum puto. - Terence

    My M2:TW 4TPY Script, Adapted to Work With Hotseat.


    Guides and Useful Posts of Mine
    Middle Earth Strategikon (M2:TW: TATW 3.2)(WIP: ~60% Complete)
    Advice on Playing as Gondor - Part I - Part II (M2:TW: TATW 3.2)
    Dirty Secret to Killing Trolls Fast and Easy (M2:TW: TATW)
    The Basics of Naval Engagements Part I - Part II (EMPIRE: DMUC)
    Roman Army Composition and Use (RTW: RTR Platinum)

  7. #7

    Default Re: [release]4tp/Ageing Script That Works with Hotseat

    Well, this is a clever solution!

  8. #8

    Default Re: [release]4tp/Ageing Script That Works with Hotseat

    THIS IS AMAZING!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •