Results 1 to 5 of 5

Thread: Governor in settlement script

Hybrid View

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

    Default Governor in settlement script

    I'm planning on making a building that gives positive traits to a settlement if the Governor is present and negative traits if no Governor is present. What script would I need to do this?

    I think the script should go something like this but I'm not sure if 'IsGovernor' is the right command to require that the Governor be present:

    Code:
        monitor_event CharacterTurnStart CharacterIsLocal
            and IsGovernor 
            and SettlementBuildingExists = royal_barracks
         set_counter governor_present 1
        end_monitor
    
        monitor_event CharacterTurnStart CharacterIsLocal
            and not IsGovernor 
            and SettlementBuildingExists = royal_barracks
         set_counter governor_present 0
        end_monitor
    Morning Sun (adds Korea and China to the Shogun 2 map)
    http://www.twcenter.net/forums/forum...28-Morning-Sun

    Expanded Japan mod (97 new regions and 101 new factions)
    http://www.twcenter.net/forums/showt...ew-factions%29

    How to split a region in TWS2
    http://www.twcenter.net/forums/showt...split-a-region

    Eras Total Conquest 2.3 (12 campaigns from 970-1547)

  2. #2
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Governor in settlement script

    It looks like you took my governor in residence script and changed it

    What you need to do is fire it on SettlementTurnEnd/Start so it will process for each settlement. SettlementTurnEnd/Start fires before FactionTurnEnd/Start so you should also be able to control whether or not it applies to the AI.

    This will turn the counter off and on for each settlement in the players control as it processes the settlement. Then just put the counter in the requirements line of the EDB. If you want to apply the bonus to the AI the same way it is applied to the player, then make two more identical monitors except they will say "not SettlementIsLocal"
    Code:
    monitor_event SettlementTurnEnd SettlementIsLocal
         and GovernorInResidence
         and SettlementBuildingExists = royal_barracks
         other conditions if you want
         set_event_counter governor_present 1
    end_monitor
    
    monitor_event SettlementTurnEnd SettlementIsLocal
         and not GovernorInResidence
         other conditions if you want
         set_event_counter governor_present 0
    end_monitor
    If you want the bonus to apply to the AI all the time regardless of whether the governor is there or not, then simply set the counter to 1 at FactionTurnEnd FactionIsLocal. Then all the AI factions will get the bonus, but when the first player settlement is processed it will begin switching off and on again.

  3. #3

    Default Re: Governor in settlement script

    Actually I based it on your siege recruitment script because I couldn't find your Governor one Thanks for the help.
    Morning Sun (adds Korea and China to the Shogun 2 map)
    http://www.twcenter.net/forums/forum...28-Morning-Sun

    Expanded Japan mod (97 new regions and 101 new factions)
    http://www.twcenter.net/forums/showt...ew-factions%29

    How to split a region in TWS2
    http://www.twcenter.net/forums/showt...split-a-region

    Eras Total Conquest 2.3 (12 campaigns from 970-1547)

  4. #4
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Governor in settlement script

    No problem.

    All my scripting stuff, in one place:
    http://www.twcenter.net/forums/showthread.php?t=176050

  5. #5

    Default Re: Governor in settlement script

    Again, nice work GED.


Posting Permissions

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