Results 1 to 2 of 2

Thread: Powershell scripts to manipulate unit cost and replenishment rate

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    AqD's Avatar 。◕‿◕。
    Join Date
    Dec 2007
    Location
    🏡🐰🐿️🐴🌳
    Posts
    10,897

    Default Powershell scripts to manipulate unit cost and replenishment rate

    Here are two tiny scripts I wrote to change unit cost and replenishment rate. It's not for players but modders who can at least read export_descr_unit.txt and export_descr_buildings.txt.

    Open them in PowerShell ISE, edit file location and run.


    edu-cost.ps1: Recalculate unit cost and upkeep. Expensive units will be much more expensive. Example:
    Spoiler Alert, click show to read: 
    Code:
    Snaga Skirmishers:
        old:  320 / 150
        new:  393 / 184
    
    Gondor Infantry:
        old:  660 / 270
        new: 1069 / 444
    
    Swan Knights:
        old:  1200 / 420
        new: 1771 / 627

    edb-recruitment.ps1: Increase replenishment rate, depending on factions.
    Spoiler Alert, click show to read: 
    Code:
    Elves:   x 2
    Dwarves: x 3
    Men:     x 3
    Orcs:    x 4 (include Isengard)
    Note it could make campaign unbalanced without other changes. I also had that in export_descr_character_traits:
    Spoiler Alert, click show to read: 
    Code:
    ;######## MY TRAITS ############
    
    ;------------------------------------------
    Trait General_Boost_Elf
        Characters family
        Hidden
    
        Level General_Boost_Elf
            Description General_Boost_Elf_desc
            EffectsDescription General_Boost_Elf_effects_desc
            Threshold  1 
    
            Effect BattleSurgery 75
            Effect HitPoints 3
    
    ;------------------------------------------
    Trait General_Boost_Men
        Characters family
        Hidden
    
        Level General_Boost_Men
            Description General_Boost_Men_desc
            EffectsDescription General_Boost_Men_effects_desc
            Threshold  1 
    
            Effect BattleSurgery 50
            Effect HitPoints 2
    
    ;------------------------------------------
    Trait General_Boost_Orc
        Characters family
        Hidden
    
        Level General_Boost_Orc
            Description General_Boost_Orc_desc
            EffectsDescription General_Boost_Orc_effects_desc
            Threshold  1 
    
            Effect BattleSurgery 25
            Effect HitPoints 2
    and

    Code:
    ;###############  My Triggers  ###############
    
    ;## ELF
    ;------------------------------------------
    Trigger General_Boost_Elf_Add_HighElves
        WhenToTest CharacterTurnStart
    
        Condition IsGeneral
    	      and FactionType egypt
              and Trait General_Boost_Elf < 1
    
        Affects General_Boost_Elf 1  Chance  100 
    
    ;------------------------------------------
    Trigger General_Boost_Elf_Add_SilvanElves
        WhenToTest CharacterTurnStart
    
        Condition IsGeneral
    	      and FactionType mongols
              and Trait General_Boost_Elf < 1
    
        Affects General_Boost_Elf 1  Chance  100 
    
    ;------------------------------------------
    Trigger General_Boost_Elf_Remove
        WhenToTest CharacterTurnEnd
    
        Condition IsGeneral
    	      and not FactionType egypt
    	      and not FactionType mongols
              and Trait General_Boost_Elf >= 1
    
        Affects General_Boost_Elf -1 Chance 100
    
    ;## MEN
    ;------------------------------------------
    Trigger General_Boost_Men_Add_Gondor
        WhenToTest CharacterTurnStart
    
        Condition IsGeneral
    	      and FactionType sicily
              and Trait General_Boost_Men < 1
    
        Affects General_Boost_Men 1  Chance  100 
    
    ;------------------------------------------
    Trigger General_Boost_Men_Add_Rohan
        WhenToTest CharacterTurnStart
    
        Condition IsGeneral
    	      and FactionType milan
              and Trait General_Boost_Men < 1
    
        Affects General_Boost_Men 1  Chance  100 
    
    ;------------------------------------------
    Trigger General_Boost_Men_Add_Dwarves
        WhenToTest CharacterTurnStart
    
        Condition IsGeneral
    	      and FactionType moors
              and Trait General_Boost_Men < 1
    
        Affects General_Boost_Men 1  Chance  100 
    
    ;------------------------------------------
    Trigger General_Boost_Men_Add_Dale
        WhenToTest CharacterTurnStart
    
        Condition IsGeneral
    	      and FactionType scotland
              and Trait General_Boost_Men < 1
    
        Affects General_Boost_Men 1  Chance  100 
    
    ;------------------------------------------
    Trigger General_Boost_Men_Add_Eriador
        WhenToTest CharacterTurnStart
    
        Condition IsGeneral
    	      and FactionType turks
              and Trait General_Boost_Men < 1
    
        Affects General_Boost_Men 1  Chance  100 
    
    ;------------------------------------------
    Trigger General_Boost_Men_Add_Arnor
        WhenToTest CharacterTurnStart
    
        Condition IsGeneral
    	      and FactionType byzantium
              and Trait General_Boost_Men < 1
    
        Affects General_Boost_Men 1  Chance  100 
    
    ;------------------------------------------
    Trigger General_Boost_Men_Add_Easterlings
        WhenToTest CharacterTurnStart
    
        Condition IsGeneral
    	      and FactionType venice
              and Trait General_Boost_Men < 1
    
        Affects General_Boost_Men 1  Chance  100 
    
    ;------------------------------------------
    Trigger General_Boost_Men_Add_Harad
        WhenToTest CharacterTurnStart
    
        Condition IsGeneral
    	      and FactionType spain
              and Trait General_Boost_Men < 1
    
        Affects General_Boost_Men 1  Chance  100 
    
    ;------------------------------------------
    Trigger General_Boost_Men_Add_Companions
        WhenToTest CharacterTurnStart
    
        Condition IsGeneral
    	      and FactionType timurids
              and Trait General_Boost_Men < 1
    
        Affects General_Boost_Men 1  Chance  100 
    
    ;------------------------------------------
    Trigger General_Boost_Men_Remove
        WhenToTest CharacterTurnEnd
    
        Condition IsGeneral
    	      and not FactionType sicily
    	      and not FactionType milan
    	      and not FactionType moors
    	      and not FactionType scotland
    	      and not FactionType turks
    	      and not FactionType byzantium
    	      and not FactionType venice
    	      and not FactionType spain
    	      and not FactionType timurids
              and Trait General_Boost_Men >= 1
    
        Affects General_Boost_Men -1 Chance 100
    
    ;## ORC
    ;------------------------------------------
    Trigger General_Boost_Orc_Add_Mordor
        WhenToTest CharacterTurnStart
    
        Condition IsGeneral
    	      and FactionType england
              and Trait General_Boost_Orc < 1
    
        Affects General_Boost_Orc 1  Chance  100 
    
    ;------------------------------------------
    Trigger General_Boost_Orc_Add_Isengard
        WhenToTest CharacterTurnStart
    
        Condition IsGeneral
    	      and FactionType france
              and Trait General_Boost_Orc < 1
    
        Affects General_Boost_Orc 1  Chance  100 
    
    ;------------------------------------------
    Trigger General_Boost_Orc_Add_OrcsMisty
        WhenToTest CharacterTurnStart
    
        Condition IsGeneral
    	      and FactionType hre
              and Trait General_Boost_Orc < 1
    
        Affects General_Boost_Orc 1  Chance  100 
    
    ;------------------------------------------
    Trigger General_Boost_Orc_Add_OrcsGundabad
        WhenToTest CharacterTurnStart
    
        Condition IsGeneral
    	      and FactionType portugal
              and Trait General_Boost_Orc < 1
    
        Affects General_Boost_Orc 1  Chance  100 
    
    ;------------------------------------------
    Trigger General_Boost_Orc_Remove
        WhenToTest CharacterTurnEnd
    
        Condition IsGeneral
    	      and not FactionType england
    	      and not FactionType france
    	      and not FactionType hre
    	      and not FactionType portugal
              and Trait General_Boost_Orc >= 1
    
        Affects General_Boost_Orc -1 Chance 100

    Attached Files Attached Files

  2. #2
    Mank's Avatar Dormouse of Hader
    Join Date
    Mar 2013
    Location
    The Mankery
    Posts
    777

    Default Re: Powershell scripts to manipulate unit cost and replenishment rate

    Wow this is very cool aqd! A powerful tool to use for game rebalancing.

Posting Permissions

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