Results 1 to 16 of 16

Thread: Working economic script from me

  1. #1
    Danya82's Avatar Tiro
    Join Date
    Oct 2010
    Location
    Saint-Petersburg, Russia
    Posts
    227

    Default Working economic script from me

    There is an economic script for one faction. Using GrnEyedDevl's script replicator, you just change 'variable' for faction from your faction list and all. For slaves disband not needed, here 3 units types of disband, which you can change independently in EDU.

    Code:
    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 1500
    and FactionIncome < 0
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 2500
    and FactionIncome < -500
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 4000
    and FactionIncome < -1000
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 6000
    and FactionIncome < -1750
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 9000
    and FactionIncome < -2750
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 13500
    and FactionIncome < -4000
    freeze_recruit_pool all true
    end_monitor
    
    
    declare_counter treasury
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and Treasury < 1500
    set_counter treasury 1
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and Treasury < 2500
    set_counter treasury 2
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and Treasury < 4000
    set_counter treasury 3
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and Treasury < 6000
    set_counter treasury 4
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and Treasury < 9000
    set_counter treasury 5
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and Treasury < 13500
    set_counter treasury 6
    end_monitor
    
    
    monitor_event AddedToTrainingQueue FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and I_CompareCounter treasury = 1
    and FactionIncome < 0
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event AddedToTrainingQueue FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and I_CompareCounter treasury = 2
    and FactionIncome < -500
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event AddedToTrainingQueue FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and I_CompareCounter treasury = 3
    and FactionIncome < -1000
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event AddedToTrainingQueue FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and I_CompareCounter treasury = 4
    and FactionIncome < -1750
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event AddedToTrainingQueue FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and I_CompareCounter treasury = 5
    and FactionIncome < -2750
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event AddedToTrainingQueue FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and I_CompareCounter treasury = 6
    and FactionIncome < -4000
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event CharacterTurnEnd I_IsFactionAIControlled
    and AgentType = admiral
    and RemainingMPPercentage = 100
    set_event_counter destroyinactive 1
    end_monitor
    
    
    monitor_event FactionTurnEnd FactionType variable
    and I_IsFactionAIControlled
    and Treasury < 0
    and I_CompareCounter month == 1
    destroy_units disband_3
    end_monitor
    
    
    monitor_event FactionTurnEnd FactionType variable
    and I_IsFactionAIControlled
    and Treasury < 0
    and I_CompareCounter month == 2
    destroy_units disband_4
    end_monitor
    
    
    monitor_event FactionTurnEnd FactionType variable
    and I_IsFactionAIControlled
    and Treasury < 0
    and I_CompareCounter month == 3
    destroy_units disband_5
    end_monitor
    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 1500
    and FactionIncome < 0
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 2500
    and FactionIncome < -500
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 4000
    and FactionIncome < -1000
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 6000
    and FactionIncome < -1750
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 9000
    and FactionIncome < -2750
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 13500
    and FactionIncome < -4000
    freeze_recruit_pool all true
    end_monitor
    
    
    declare_counter treasury
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and Treasury < 1500
    set_counter treasury 1
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and Treasury < 2500
    set_counter treasury 2
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and Treasury < 4000
    set_counter treasury 3
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and Treasury < 6000
    set_counter treasury 4
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and Treasury < 9000
    set_counter treasury 5
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and Treasury < 13500
    set_counter treasury 6
    end_monitor
    
    
    monitor_event AddedToTrainingQueue FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and I_CompareCounter treasury = 1
    and FactionIncome < 0
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event AddedToTrainingQueue FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and I_CompareCounter treasury = 2
    and FactionIncome < -500
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event AddedToTrainingQueue FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and I_CompareCounter treasury = 3
    and FactionIncome < -1000
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event AddedToTrainingQueue FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and I_CompareCounter treasury = 4
    and FactionIncome < -1750
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event AddedToTrainingQueue FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and I_CompareCounter treasury = 5
    and FactionIncome < -2750
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event AddedToTrainingQueue FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and I_CompareCounter treasury = 6
    and FactionIncome < -4000
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event CharacterTurnEnd I_IsFactionAIControlled
    and AgentType = admiral
    and RemainingMPPercentage = 100
    set_event_counter destroyinactive 1
    end_monitor
    
    
    monitor_event FactionTurnEnd FactionType variable
    and I_IsFactionAIControlled
    and Treasury < 0
    and I_CompareCounter month == 1
    destroy_units disband_3
    end_monitor
    
    
    monitor_event FactionTurnEnd FactionType variable
    and I_IsFactionAIControlled
    and Treasury < 0
    and I_CompareCounter month == 2
    destroy_units disband_4
    end_monitor
    
    
    monitor_event FactionTurnEnd FactionType variable
    and I_IsFactionAIControlled
    and Treasury < 0
    and I_CompareCounter month == 3
    destroy_units disband_5
    end_monitor
    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 1500
    and FactionIncome < 0
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 2500
    and FactionIncome < -500
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 4000
    and FactionIncome < -1000
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 6000
    and FactionIncome < -1750
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 9000
    and FactionIncome < -2750
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 13500
    and FactionIncome < -4000
    freeze_recruit_pool all true
    end_monitor
    
    
    declare_counter treasury
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and Treasury < 1500
    set_counter treasury 1
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and Treasury < 2500
    set_counter treasury 2
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and Treasury < 4000
    set_counter treasury 3
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and Treasury < 6000
    set_counter treasury 4
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and Treasury < 9000
    set_counter treasury 5
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and Treasury < 13500
    set_counter treasury 6
    end_monitor
    
    
    monitor_event AddedToTrainingQueue FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and I_CompareCounter treasury = 1
    and FactionIncome < 0
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event AddedToTrainingQueue FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and I_CompareCounter treasury = 2
    and FactionIncome < -500
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event AddedToTrainingQueue FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and I_CompareCounter treasury = 3
    and FactionIncome < -1000
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event AddedToTrainingQueue FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and I_CompareCounter treasury = 4
    and FactionIncome < -1750
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event AddedToTrainingQueue FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and I_CompareCounter treasury = 5
    and FactionIncome < -2750
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event AddedToTrainingQueue FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and I_CompareCounter treasury = 6
    and FactionIncome < -4000
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event CharacterTurnEnd I_IsFactionAIControlled
    and AgentType = admiral
    and RemainingMPPercentage = 100
    set_event_counter destroyinactive 1
    end_monitor
    
    
    monitor_event FactionTurnEnd FactionType variable
    and I_IsFactionAIControlled
    and Treasury < 0
    and I_CompareCounter month == 1
    destroy_units disband_3
    end_monitor
    
    
    monitor_event FactionTurnEnd FactionType variable
    and I_IsFactionAIControlled
    and Treasury < 0
    and I_CompareCounter month == 2
    destroy_units disband_4
    end_monitor
    
    
    monitor_event FactionTurnEnd FactionType variable
    and I_IsFactionAIControlled
    and Treasury < 0
    and I_CompareCounter month == 3
    destroy_units disband_5
    end_monitor
    Last edited by z3n; August 08, 2019 at 10:23 PM. Reason: code tags

  2. #2
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,096
    Blog Entries
    35

    Default Re: Working economic script from me

    Nice effort, it's basically stopping recruiting or even disbanding units based on finances. It does however have some flaws:

    - 66 monitors for one faction, that's 2046 monitors at a full compliment of factions. Bound to be a performance hit, eg much longer turn times.
    - freeze_recruit_pool affects all factions, not just the monitored faction, you are lacking an 'unfreeze' for other factions
    - destroy units is missing the faction condition
    - the script also assumes the presence of a seasonal script (and I_CompareCounter month == 1), that is not standard for mods
    - you are setting an event counter in three separate, dedicated monitors that is never checked (set_event_counter destroyinactive 1)
    Last edited by Gigantus; August 08, 2019 at 10:48 PM.










  3. #3
    z3n's Avatar State of Mind
    Moderator Emeritus

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Working economic script from me

    Hello Danya82, please use [CODE] tags in the future instead of quotes for any script related items that lengthy.
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  4. #4
    Danya82's Avatar Tiro
    Join Date
    Oct 2010
    Location
    Saint-Petersburg, Russia
    Posts
    227

    Default Re: Working economic script from me

    From script in Titanium i read this:

    if I_CompareCounter turn_fid = 14
    destroy_units milan, mercenary_unit
    add_money milan -2147478647
    add_money milan 2147483647
    add_money milan 101
    set_counter freeze_milan 0
    set_event_counter freeze_recr_pool 1
    end_if

    So, if i will change 'freeze_recruit_pool all' for 'set_event_counter freeze_recr_pool 1' , will it work? If no, what i have to add or change?
    Pls, if someone have some information, help me.

    And what means "freeze_faction", it's freezes just recruit pools or AI too?
    Last edited by Danya82; August 16, 2019 at 07:31 PM.

  5. #5
    Danya82's Avatar Tiro
    Join Date
    Oct 2010
    Location
    Saint-Petersburg, Russia
    Posts
    227

    Default Re: Working economic script from me

    ...
    Last edited by Danya82; August 16, 2019 at 07:32 PM. Reason: not need anymore

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

    Default Re: Working economic script from me

    Quote Originally Posted by Danya82 View Post
    And what means "freeze_faction", it's freezes just recruit pools or AI too?
    There is no "freeze_faction" command. There is freeze_faction_ai which obviously does freeze AI.

    If you meant "freeze_milan" then that, and your other question, would need somebody with Titanium knowledge to answer.

  7. #7
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,096
    Blog Entries
    35

    Default Re: Working economic script from me

    The titanium script is setting counters for reference, they actually never use the command, same with the faction freeze counter:
    Code:
    set_counter freeze_milan 0
    set_event_counter freeze_recr_pool 1
    You can only freeze the recruit pool in a specific region or everywhere, which makes the use of it for a faction extremely tedious. I know, I developed a recruiting limit script based on it.

    Basically you will have to test for ownership of a region and then freeze the pool for the region if the faction is right and if the faction meets your other criteria.










  8. #8
    Danya82's Avatar Tiro
    Join Date
    Oct 2010
    Location
    Saint-Petersburg, Russia
    Posts
    227

    Default Re: Working economic script from me

    Code:
      
    monitor_event PreFactionTurnStart IsFactionAIControlled
    and FactionIncome > 0
    freeze_recruit_pool all false
    end_Monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 1500
    and FactionIncome < 0
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 2500
    and FactionIncome < -500
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 4000
    and FactionIncome < -1000
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 6000
    and FactionIncome < -1750
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 9000
    and FactionIncome < -2750
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 13500
    and FactionIncome < -4000
    freeze_recruit_pool all true
    end_monitor
    
    
    declare_counter treasury
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and Treasury < 1500
    set_counter treasury 1
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and Treasury < 2500
    set_counter treasury 2
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and Treasury < 4000
    set_counter treasury 3
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and Treasury < 6000
    set_counter treasury 4
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and Treasury < 9000
    set_counter treasury 5
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionType variable
    and Treasury < 13500
    set_counter treasury 6
    end_monitor
    
    
    monitor_event AddedToTrainingQueue FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and I_CompareCounter treasury = 1
    and FactionIncome < 0
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event AddedToTrainingQueue FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and I_CompareCounter treasury = 2
    and FactionIncome < -500
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event AddedToTrainingQueue FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and I_CompareCounter treasury = 3
    and FactionIncome < -1000
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event AddedToTrainingQueue FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and I_CompareCounter treasury = 4
    and FactionIncome < -1750
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event AddedToTrainingQueue FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and I_CompareCounter treasury = 5
    and FactionIncome < -2750
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event AddedToTrainingQueue FactionType variable
    and I_IsFactionAIControlled 
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and I_CompareCounter treasury = 6
    and FactionIncome < -4000
    freeze_recruit_pool all true
    end_monitor
    
    
    monitor_event CharacterTurnEnd I_IsFactionAIControlled
    and AgentType = admiral
    and RemainingMPPercentage = 100
    set_event_counter destroyinactive 1
    end_monitor
    
    
    monitor_event FactionTurnEnd FactionType variable
    and I_IsFactionAIControlled
    and Treasury < 0
    and I_CompareCounter month == 1
    destroy_units disband_3
    end_monitor
    
    
    monitor_event FactionTurnEnd FactionType variable
    and I_IsFactionAIControlled
    and Treasury < 0
    and I_CompareCounter month == 2
    destroy_units disband_4
    end_monitor
    
    
    monitor_event FactionTurnEnd FactionType variable
    and I_IsFactionAIControlled
    and Treasury < 0
    and I_CompareCounter month == 3
    destroy_units disband_5
    end_monitor

  9. #9
    Danya82's Avatar Tiro
    Join Date
    Oct 2010
    Location
    Saint-Petersburg, Russia
    Posts
    227

    Default Re: Working economic script from me

    Now, it's right?

  10. #10
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,096
    Blog Entries
    35

    Default Re: Working economic script from me

    You are setting a counter that isn't checked: destroyinactive - is it used somewhere else?
    The destroy_units command requires a faction to be specified.
    You are using 23 monitors per faction which will result in 600 monitors: that could impact on processing time between turns. Do make use of faction counters and then wrap the faction condition with it's commands into IF loops, see example.

    Faction Counters:
    Code:
        ; --- [faction] ---
        monitor_event PreFactionTurnStart FactionType [faction]
            set_event_counter faction_turn_[faction] 1    ; it's this faction's turn
            log always Turn Start [faction]               ; log entry for bug hunting
        end_monitor
        monitor_event FactionTurnEnd FactionType [faction]
            set_event_counter faction_turn_[faction] 0    ; it's NOT this faction's turn
            log always Turn End [faction]               ; log entry for bug hunting
        end_monitor
    Sample Use:
    Code:
        ; --- Original Monitor ----
        monitor_event FactionTurnEnd FactionType variable
            and I_IsFactionAIControlled
            and Treasury < 0
            and I_CompareCounter month == 1
            destroy_units disband_3
        end_monitor
    
    
        ; --- Adapted ----
        monitor_event FactionTurnEnd I_IsFactionAIControlled
            and Treasury < 0
            and I_CompareCounter month == 1
            if I_EventCounter faction_turn_[faction] 1    ; it's this faction's turn
                destroy_units [faction] disband_3
            end_if
        end_monitor
    GED's script replicator will help you here. Simply replicate the IF loop with the [faction] variable rand then copy the result back into your script.
    Last edited by Gigantus; August 21, 2019 at 10:15 PM.










  11. #11
    Danya82's Avatar Tiro
    Join Date
    Oct 2010
    Location
    Saint-Petersburg, Russia
    Posts
    227

    Default Re: Working economic script from me

    i asked about my script.


    monitor_event PreFactionTurnStart IsFactionAIControlled
    and FactionIncome > 0
    freeze_recruit_pool all false
    end_Monitor


    monitor_event PreFactionTurnStart FactionType variable
    and I_IsFactionAIControlled
    and not I_FactionBesieged variable
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 1500
    and FactionIncome < 0
    freeze_recruit_pool all true
    end_monitor

    Will it work?

  12. #12
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,096
    Blog Entries
    35

    Default Re: Working economic script from me

    It will work, and has the short comings I pointed out. To avoid conflict with the first monitor you should use the simple 'FactionTurnStart' event for the second monitor.










  13. #13
    Danya82's Avatar Tiro
    Join Date
    Oct 2010
    Location
    Saint-Petersburg, Russia
    Posts
    227

    Default Re: Working economic script from me

    Now that's right?

    Code:
    monitor_event PreFactionTurnStart FactionType variable
    set_event_counter Faction_Turn_variable 1
    log always Turn Start variable
    end_monitor
    
    
    monitor_event FactionTurnEnd FactionType variable
    set_event_counter Faction_Turn_variable 0
    log_always Turn End variable
    end_monitor
    
    
    monitor_event PreFactionTurnStart
    and I_IsFactionAIControlled
    and FactionIncome > 0
    if I_Event_Counter Faction_Turn_variable 1
    freeze_recruit_pool all false
    end_if
    end_monitor
    
    
    monitor_event PreFactionTurnStart
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 1500
    and FactionIncome < 0
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event PreFactionTurnStart 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 2500
    and FactionIncome < -500
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event PreFactionTurnStart
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 4000
    and FactionIncome < -1000
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event PreFactionTurnStart 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 6000
    and FactionIncome < -1750
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event PreFactionTurnStart 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 9000
    and FactionIncome < -2750
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event PreFactionTurnStart 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 13500
    and FactionIncome < -4000
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    declare_counter treasury
    
    
    monitor_event PreFactionTurnStart 
    and Treasury < 1500
    if I_Event_Counter Faction_Turn_variable 1
    set_counter treasury 1
    end_if
    end_monitor
    
    
    monitor_event PreFactionTurnStart 
    and Treasury < 2500
    if I_Event_Counter Faction_Turn_variable 1
    set_counter treasury 2
    end_if
    end_monitor
    
    
    monitor_event PreFactionTurnStart 
    and Treasury < 4000
    if I_Event_Counter Faction_Turn_variable 1
    set_counter treasury 3
    end_if
    end_monitor
    
    
    monitor_event PreFactionTurnStart 
    and Treasury < 6000
    if I_Event_Counter Faction_Turn_variable 1
    set_counter treasury 4
    end_if
    end_monitor
    
    
    monitor_event PreFactionTurnStart 
    and Treasury < 9000
    if I_Event_Counter Faction_Turn_variable 1
    set_counter treasury 5
    end_if
    end_monitor
    
    
    monitor_event PreFactionTurnStart 
    and Treasury < 13500
    if I_Event_Counter Faction_Turn_variable 1
    set_counter treasury 6
    end_if
    end_monitor
    
    
    monitor_event AddedToTrainingQueue 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < 0
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 1
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event AddedToTrainingQueue 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -500
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 2
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event AddedToTrainingQueue 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -1000
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 3
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event AddedToTrainingQueue 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -1750
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 4
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event AddedToTrainingQueue 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -2750
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 5
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event AddedToTrainingQueue 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -4000
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 6
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event FactionTurnEnd 
    and I_IsFactionAIControlled
    and Treasury < 0
    and I_CompareCounter month == 1
    if I_Event_Counter Faction_Turn_variable 1
    destroy_units variable disband_3
    end_if
    end_monitor
    
    
    monitor_event FactionTurnEnd 
    and I_IsFactionAIControlled
    and Treasury < 0
    and I_CompareCounter month == 2
    if I_Event_Counter Faction_Turn_variable 1
    destroy_units variable disband_4
    end_if
    end_monitor
    
    
    monitor_event FactionTurnEnd 
    and I_IsFactionAIControlled
    and Treasury < 0
    and I_CompareCounter month == 3
    if I_Event_Counter Faction_Turn_variable 1
    destroy_units variable disband_5
    end_if
    end_monitor
    Last edited by Danya82; September 01, 2019 at 03:08 PM.

  14. #14
    Danya82's Avatar Tiro
    Join Date
    Oct 2010
    Location
    Saint-Petersburg, Russia
    Posts
    227

    Default Re: Working economic script from me

    New version

    Code:
    monitor_event PreFactionTurnStart FactionType variable
    set_event_counter Faction_Turn_variable 1
    log always Turn Start variable
    end_monitor
    
    
    monitor_event FactionTurnEnd FactionType variable
    set_event_counter Faction_Turn_variable 0
    log_always Turn End variable
    end_monitor
    
    
    
    
    monitor_event PreFactionTurnStart
    and I_IsFactionAIControlled
    and FactionIncome > 0
    if I_Event_Counter Faction_Turn_variable 1
    freeze_recruit_pool all false
    end_if
    end_monitor
    
    
    monitor_event PreFactionTurnStart
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 1500
    and FactionIncome < 0
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event PreFactionTurnStart 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 2500
    and FactionIncome < -500
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event PreFactionTurnStart
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 4000
    and FactionIncome < -1000
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event PreFactionTurnStart 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 6000
    and FactionIncome < -1750
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event PreFactionTurnStart 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 9000
    and FactionIncome < -2750
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event PreFactionTurnStart 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 13500
    and FactionIncome < -4000
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    
    
    declare_counter treasury
    
    
    monitor_event PreFactionTurnStart 
    and Treasury < 1500
    if I_Event_Counter Faction_Turn_variable 1
    set_counter treasury 1
    end_if
    end_monitor
    
    
    monitor_event PreFactionTurnStart 
    and Treasury < 2500
    if I_Event_Counter Faction_Turn_variable 1
    set_counter treasury 2
    end_if
    end_monitor
    
    
    monitor_event PreFactionTurnStart 
    and Treasury < 4000
    if I_Event_Counter Faction_Turn_variable 1
    set_counter treasury 3
    end_if
    end_monitor
    
    
    monitor_event PreFactionTurnStart 
    and Treasury < 6000
    if I_Event_Counter Faction_Turn_variable 1
    set_counter treasury 4
    end_if
    end_monitor
    
    
    monitor_event PreFactionTurnStart 
    and Treasury < 9000
    if I_Event_Counter Faction_Turn_variable 1
    set_counter treasury 5
    end_if
    end_monitor
    
    
    monitor_event PreFactionTurnStart 
    and Treasury < 13500
    if I_Event_Counter Faction_Turn_variable 1
    set_counter treasury 6
    end_if
    end_monitor
    
    
    
    
    monitor_event AddedToTrainingQueue 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < 0
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 1
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event AddedToBuildingQueue 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < 0
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 1
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event AddedToTrainingQueue 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -500
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 2
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event AddedToBuildingQueue 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -500
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 2
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event AddedToTrainingQueue 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -1000
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 3
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event AddedToBuildingQueue 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -1000
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 3
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event AddedToTrainingQueue 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -1750
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 4
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event AddedToBuildingQueue 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -1750
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 4
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event AddedToTrainingQueue 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -2750
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 5
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event AddedToBuildingQueue 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -2750
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 5
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event AddedToTrainingQueue 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -4000
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 6
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    monitor_event AddedToBuildingQueue 
    and I_IsFactionAIControlled 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -4000
    if I_Event_Counter Faction_Turn_variable 1
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 6
    freeze_recruit_pool all true
    end_if
    end_monitor
    
    
    
    
    declare_counter disband 
    
    
    monitor_event FactionTurnEnd 
    and I_IsFactionAIControlled
    and Treasury < 500  
    if I_Event_Counter Faction_Turn_variable 0
    and I_LosingMoney variable
    destroy_units variable disband_1
    set_counter disband 1
    end_if
    end_monitor
    
    
    monitor_event FactionTurnEnd 
    and I_IsFactionAIControlled
    and Treasury < 500
    if I_Event_Counter Faction_Turn_variable 0
    and I_LosingMoney variable
    and I_CompareCounter disband = 1
    destroy_units variable disband_2
    set_counter disband 2
    end_if
    end_monitor
    
    
    
    
    monitor_event FactionTurnEnd 
    and I_IsFactionAIControlled
    and Treasury < 500
    if I_Event_Counter Faction_Turn_variable 0
    and I_LosingMoney variable
    and I_CompareCounter disband = 2
    destroy_units variable disband_3
    end_if
    end_monitor

  15. #15
    Danya82's Avatar Tiro
    Join Date
    Oct 2010
    Location
    Saint-Petersburg, Russia
    Posts
    227

    Default Re: Working economic script from me

    PLease, check this script for mistakes

  16. #16
    Danya82's Avatar Tiro
    Join Date
    Oct 2010
    Location
    Saint-Petersburg, Russia
    Posts
    227

    Default Re: Working economic script from me

    Now that's should be right. You have to do next, replicate every part, when you will replicate delete the monitor lines (for example, monitor_event PreFactionTurnStart and I_IsFactionAIControlled and end_monitor), but not in part 1, and then add it in your script , then replicate next part same way and so on, so you will get your script.

    Code:
    =====part1=====
    
    monitor_event PreFactionTurnStart FactionType variable
    set_event_counter Faction_Turn_variable 1
    end_monitor
    
    
    monitor_event FactionTurnEnd FactionType variable
    set_event_counter Faction_Turn_variable 0
    end_monitor
    
    
    =====part2=====
    
    
    monitor_event PreFactionTurnStart
    and I_IsFactionAIControlled
    
    
    if I_Event_Counter Faction_Turn_variable 1
    and FactionIncome > 0
    freeze_recruit_pool all false
    end_if
    
    
    if I_Event_Counter Faction_Turn_variable 1
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 1500
    and FactionIncome < 0
    and not I_FactionBesieged variable
    freeze_recruit_pool all true
    end_if
    
    
    if I_Event_Counter Faction_Turn_variable 1 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 2500
    and FactionIncome < -500
    and not I_FactionBesieged variable
    freeze_recruit_pool all true
    end_if
    
    
    if I_Event_Counter Faction_Turn_variable 1
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 4000
    and FactionIncome < -1000
    and not I_FactionBesieged variable
    freeze_recruit_pool all true
    end_if
    
    
    if I_Event_Counter Faction_Turn_variable 1 
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 6000
    and FactionIncome < -1750
    and not I_FactionBesieged variable
    freeze_recruit_pool all true
    end_if
    
    
    if I_Event_Counter Faction_Turn_variable 1
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 9000
    and FactionIncome < -2750
    and not I_FactionBesieged variable
    freeze_recruit_pool all true
    end_if
    
    
    if I_Event_Counter Faction_Turn_variable 1
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and Treasury < 13500
    and FactionIncome < -4000
    and not I_FactionBesieged variable
    freeze_recruit_pool all true
    end_if
    
    
    end_monitor
    
    
    =====part3=====
    
    
    declare_counter treasury
    
    
    monitor_event PreFactionTurnStart IsFactionAIControlled
    
    
    if I_Event_Counter Faction_Turn_variable 1
    and Treasury < 1500
    set_counter treasury 1
    end_if
    
    
    if I_Event_Counter Faction_Turn_variable 1
    and Treasury < 2500
    set_counter treasury 2
    end_if
    
    
    if I_Event_Counter Faction_Turn_variable 1
    and Treasury < 4000
    set_counter treasury 3
    end_if
    
    
    if I_Event_Counter Faction_Turn_variable 1
    and Treasury < 6000
    set_counter treasury 4
    end_if
    
    
    if I_Event_Counter Faction_Turn_variable 1
    and Treasury < 9000
    set_counter treasury 5
    end_if
    
    
    if I_Event_Counter Faction_Turn_variable 1
    and Treasury < 13500
    set_counter treasury 6
    end_if
    
    
    end_monitor
    
    
    =====part4=====
    
    
    monitor_event AddedToTrainingQueue IsFactionAIControlled
    
    
    if I_Event_Counter Faction_Turn_variable 1
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < 0
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 1
    freeze_recruit_pool all true
    end_if
    
    
    if I_Event_Counter Faction_Turn_variable 1
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -500
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 2
    freeze_recruit_pool all true
    end_if
    
    
    if I_Event_Counter Faction_Turn_variable 1
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -1000
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 3
    freeze_recruit_pool all true
    end_if
    
    
    if I_Event_Counter Faction_Turn_variable 1
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -1750
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 4
    freeze_recruit_pool all true
    end_if
    
    
    if I_Event_Counter Faction_Turn_variable 1
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -2750
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 5
    freeze_recruit_pool all true
    end_if
    
    
    if I_Event_Counter Faction_Turn_variable 1
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -4000
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 6
    freeze_recruit_pool all true
    end_if
    
    
    end_monitor
    
    
    =====part5=====
    
    
    monitor_event AddedToBuildingQueue IsFactionAIControlled
    
    
    if I_Event_Counter Faction_Turn_variable 1
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < 0
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 1
    freeze_recruit_pool all true
    end_if
    
    
    if I_Event_Counter Faction_Turn_variable 1
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -500
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 2
    freeze_recruit_pool all true
    end_if
    
    
    if I_Event_Counter Faction_Turn_variable 1
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -1000
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 3
    freeze_recruit_pool all true
    end_if
    
    
    if I_Event_Counter Faction_Turn_variable 1
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -1750
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 4
    freeze_recruit_pool all true
    end_if
    
    
    if I_Event_Counter Faction_Turn_variable 1
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -2750
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 5
    freeze_recruit_pool all true
    end_if
    
    
    if I_Event_Counter Faction_Turn_variable 1
    and not IsCrusadeTargetFaction
    and not IsJihadTargetFaction
    and FactionIncome < -4000
    and not I_FactionBesieged variable
    and I_CompareCounter treasury = 6
    freeze_recruit_pool all true
    end_if
    
    
    end_monitor
    
    
    =====part6=====
    
    
    declare_counter disband
    
    
    monitor_event FactionTurnEnd IsFactionAIControlled
    
    
    if I_Event_Counter Faction_Turn_variable 0
    and Treasury < 500
    and I_LosingMoney variable
    destroy_units variable disband_1
    set_counter disband 1
    end_if
    
    
    if I_Event_Counter Faction_Turn_variable 0
    and Treasury < 500
    and I_LosingMoney variable
    and I_CompareCounter disband = 1
    destroy_units variable disband_2
    set_counter disband 2
    end_if
    
    
    if I_Event_Counter Faction_Turn_variable 0
    and Treasury < 500
    and I_LosingMoney variable
    and I_CompareCounter disband = 2
    destroy_units variable disband_3
    end_if
    
    
    end_monitor
    Last edited by Danya82; October 15, 2019 at 02:23 PM.

Posting Permissions

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