Results 1 to 7 of 7

Thread: Working economic script from me

  1. #1

    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 The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it
    Patrician Moderator Emeritus Administrator Emeritus Modding Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    46,845
    Blog Entries
    24

    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
    Patrician Artifex Modding Staff Director

    Join Date
    Aug 2011
    Posts
    3,407

    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.
    Contributor in The AI Workshop
    AI/Game Mechanics Developer for Europa Barbaroum II
    Developer of The Northern Crusades
    Retired Lead Developer for Classical Age Total War
    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

    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

    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,092

    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 The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it
    Patrician Moderator Emeritus Administrator Emeritus Modding Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    46,845
    Blog Entries
    24

    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.



Posting Permissions

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