Page 1 of 3 123 LastLast
Results 1 to 20 of 42

Thread: Losing the settlement or battle as a condition of script

Hybrid View

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

    Default Losing the settlement or battle as a condition of script

    Is there any way to check by a script, whether a particular faction lost any battle or lost any city? I need this information to calling by script rising of specific faction.
    Last edited by attyla; November 13, 2011 at 02:48 PM.

  2. #2

    Icon1 Re: Losing the settlement or battle as a condition of script

    attyla: If you wanted to know how many settlements a faction had won or lost you could try doing something like this:
    Spoiler Alert, click show to read: 
    Code:
    declare_counter sicily_settlements
    
    	monitor_event GeneralCaptureSettlement FactionType sicily
        		inc_counter sicily_settlements 1
    	end_monitor
    
    	monitor_event GiveSettlement TargetFactionType sicily
        		inc_counter sicily_settlements 1
    	end_monitor
    
    	monitor_event GeneralCaptureSettlement TargetFactionType sicily
        		inc_counter sicily_settlements -1
    	end_monitor
    
    	monitor_event GiveSettlement FactionType sicily
        		inc_counter sicily_settlements -1
    	end_monitor
    Or this:
    Code:
    declare_counter sicily_settlements
    
    	monitor_event OccupySettlement FactionType sicily
        		inc_counter sicily_settlements 1
    	end_monitor
    
    	monitor_event OccupySettlement TargetFactionType sicily
        		inc_counter sicily_settlements -1
    	end_monitor
    For battles try:
    Code:
    declare_counter sicily_won_battle
    
    	monitor_event PostBattle CharFactionType sicily
    		and WonBattle
        		inc_counter sicily_won_battle 1
    	end_monitor
    
    	monitor_event PostBattle CharFactionType sicily
    		and not WonBattle
        		inc_counter sicily_won_battle -1
    	end_monitor

    You can also add the ‘IsRegionOneOf’ condition to those examples if you need to know where the battle took place, or which settlement was won or lost.

  3. #3

    Default Re: Losing the settlement or battle as a condition of script

    thank you TNZ.
    Where can i find the list of things like GeneralCaptureSettlement? I cannot find it in DokumentDemos.
    And second question - as i can understand - the part of script concerning lost battles will work everytime when specific faction lost any battle? Even small skirmisch?

  4. #4

    Icon1 Re: Losing the settlement or battle as a condition of script

    attyla: This download should have the files you need: Kingdoms Docudemons

    The mod documents for barbarian invasion can be quite useful to have as well. They used to be in the download section, but I couldn't find it when I did a search. You may need to try over at the The Org to find that file.

    Yes that ‘PostBattle’ script will work any time there's a battle of any size. I would need to look up the right conditions, but it should be possible to make it so that it only works for big battles or small battles, if that's what you're after?

  5. #5

    Default Re: Losing the settlement or battle as a condition of script

    TNZ
    Thank you again I had not document for Kingdoms So i will start to study it

    And ofcourse i am

  6. #6

    Default Re: Losing the settlement or battle as a condition of script

    What can be wrong with this script?
    PHP Code:
    declare_counter siege_sofia
    declare_counter siege_preslav
    declare_counter siege_varna
    declare_counter siege_nisz
    declare_counter siege_skopia
    declare_counter siege_craiova

    monitor_event FactionTurnStart FactionIsLocal
        
    and I_CompareCounter siege_sofia 1
        
    and not I_SettlementOwner Sofia normans
    ;    console_command auto_win attacker
        siege_settlement Aleksei
    Sofiaattack
    ;    terminate_monitor
    end_monitor

    monitor_event FactionTurnStart FactionIsLocal
        
    and I_CompareCounter siege_preslav 1
        
    and not I_SettlementOwner Preslav normans
    ;    console_command auto_win attacker
        siege_settlement Bolda
    Preslavattack
    ;    terminate_monitor
    end_monitor

    monitor_event FactionTurnStart FactionIsLocal
        
    and I_CompareCounter siege_varna 1
        
    and not I_SettlementOwner Varna normans
    ;    console_command auto_win attacker
        siege_settlement Chernek
    Varnaattack
    ;    terminate_monitor
    end_monitor

    monitor_event FactionTurnStart FactionIsLocal
        
    and I_CompareCounter siege_nisz 1
        
    and not I_SettlementOwner Nisz normans
    ;    console_command auto_win attacker
        siege_settlement Grechin
    Niszattack
    ;    terminate_monitor
    end_monitor

    monitor_event FactionTurnStart FactionIsLocal
        
    and I_CompareCounter siege_skopia 1
        
    and not I_SettlementOwner Skopia normans
    ;    console_command auto_win attacker
        siege_settlement Kisel
    Skopiaattack
    ;    terminate_monitor
    end_monitor

    monitor_event FactionTurnStart FactionIsLocal
        
    and I_CompareCounter siege_craiova 1
        
    and not I_SettlementOwner Craiova normans
    ;    console_command auto_win attacker
        siege_settlement Stepan
    Craiovaattack
    ;    terminate_monitor
    end_monitor

    declare_counter byzantium_settlements
    declare_counter bunt_bu
    łgarów

        
    monitor_event OccupySettlement FactionType byzantium
            
    and IsRegionOneOf Constantinople_Province
            
    and IsRegionOneOf Gallipoli_Province
            
    and IsRegionOneOf Thrace
            
    and IsRegionOneOf Epirus_Province
            
    and IsRegionOneOf Morea
            
    and IsRegionOneOf Naxos_Province
            
    and IsRegionOneOf Bythinia

                inc_counter byzantium_settlements 1
        end_monitor

    monitor_event FactionTurnStart FactionIsLocal
        
    and I_CompareCounter byzantium_settlements 1
        
    and I_NumberOfSettlements normans 4
            generate_random_counter bunt_1 1 6

    if I_CompareCounter bunt_bułgarów = 1
            
    and not I_SettlementOwner Sofia poland
            
    and not I_SettlementOwner Sofia hungary
            
    and not I_SettlementOwner Sofia hre
            
    and not I_SettlementOwner Sofia france
            
    and not I_SettlementOwner Sofia denmark
            
    and not I_SettlementOwner Sofia sweden
            
    and not I_SettlementOwner Sofia sicily
            
    and not I_SettlementOwner Sofia england
            
    and not I_SettlementOwner Sofia scotland
            
    and not I_SettlementOwner Sofia spain
            
    and not I_SettlementOwner Sofia portugal
            
    and not I_SettlementOwner Sofia milan
            
    and not I_SettlementOwner Sofia venice
            
    and not I_SettlementOwner Sofia papal_states
            
    and not I_SettlementOwner Sofia jerusalem
            
    and not I_SettlementOwner Sofia egypt
            
    and not I_SettlementOwner Sofia moors
            
    and not I_SettlementOwner Sofia turks
            
    and not I_SettlementOwner Sofia mongols
            
    and not I_SettlementOwner Sofia timurids
            
    and not I_SettlementOwner Sofia hedjaz
            
    and not I_SettlementOwner Sofia normans
            
    and not I_SettlementOwner Sofia serbia
            
    and not I_SettlementOwner Sofia kiev
            
    and not I_SettlementOwner Sofia russia
            
    and not I_SettlementOwner Sofia armenia
            
    and not I_SettlementOwner Sofia saxons

        spawn_army
            faction normans
    character    Aleksei
    named characterage 16x 338y 184 
    traits Factionheir 1 
    GoodCommander 2 BattleDread 3 ReligionStarter 1 LoyaltyStarter 1 Austere 1 
    unit        Bulgarian Bodyguard            exp 1 armour 0 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Dismounted Bulgarian Cavalry        exp 1 armour 0 weapon_lvl 0
    unit        Dismounted Bulgarian Cavalry        exp 1 armour 0 weapon_lvl 0
    unit        Mongol Foot Archers            exp 1 armour 0 weapon_lvl 0
    unit        Mongol Foot Archers            exp 1 armour 0 weapon_lvl 0
    unit        Mongol Foot Archers            exp 1 armour 0 weapon_lvl 0
    unit        Mongol Foot Archers            exp 1 armour 0 weapon_lvl 0
    unit        Cuman Horse Archers            exp 1 armour 0 weapon_lvl 0
    unit        Cuman Horse Archers            exp 1 armour 0 weapon_lvl 0
    unit        Bulgarian Cavalry            exp 1 armour 0 weapon_lvl 0
    unit        Bulgarian Cavalry            exp 1 armour 0 weapon_lvl 0
    unit        EE Catapult                exp 0 armour 0 weapon_lvl 0
    end
        siege_settlement Aleksei
    Sofiaattack
        set_counter siege_sofia 1
    end_if

    If I_CompareCounter bunt_bułgarów = 2
            
    and not I_SettlementOwner Preslav poland
            
    and not I_SettlementOwner Preslav hungary
            
    and not I_SettlementOwner Preslav hre
            
    and not I_SettlementOwner Preslav france
            
    and not I_SettlementOwner Preslav denmark
            
    and not I_SettlementOwner Preslav sweden
            
    and not I_SettlementOwner Preslav sicily
            
    and not I_SettlementOwner Preslav england
            
    and not I_SettlementOwner Preslav scotland
            
    and not I_SettlementOwner Preslav spain
            
    and not I_SettlementOwner Preslav portugal
            
    and not I_SettlementOwner Preslav milan
            
    and not I_SettlementOwner Preslav venice
            
    and not I_SettlementOwner Preslav papal_states
            
    and not I_SettlementOwner Preslav jerusalem
            
    and not I_SettlementOwner Preslav egypt
            
    and not I_SettlementOwner Preslav moors
            
    and not I_SettlementOwner Preslav turks
            
    and not I_SettlementOwner Preslav mongols
            
    and not I_SettlementOwner Preslav timurids
            
    and not I_SettlementOwner Preslav hedjaz
            
    and not I_SettlementOwner Preslav normans
            
    and not I_SettlementOwner Preslav serbia
            
    and not I_SettlementOwner Preslav kiev
            
    and not I_SettlementOwner Preslav russia
            
    and not I_SettlementOwner Preslav armenia
            
    and not I_SettlementOwner Preslav saxons

        spawn_army
            faction normans
    character    Bolda
    named characterage 16x 351y 187 
    traits Factionheir 1 
    GoodCommander 2 BattleDread 3 ReligionStarter 1 LoyaltyStarter 1 Austere 1 
    unit        Bulgarian Bodyguard            exp 1 armour 0 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Dismounted Bulgarian Cavalry        exp 1 armour 0 weapon_lvl 0
    unit        Dismounted Bulgarian Cavalry        exp 1 armour 0 weapon_lvl 0
    unit        Mongol Foot Archers            exp 1 armour 0 weapon_lvl 0
    unit        Mongol Foot Archers            exp 1 armour 0 weapon_lvl 0
    unit        Mongol Foot Archers            exp 1 armour 0 weapon_lvl 0
    unit        Mongol Foot Archers            exp 1 armour 0 weapon_lvl 0
    unit        Cuman Horse Archers            exp 1 armour 0 weapon_lvl 0
    unit        Cuman Horse Archers            exp 1 armour 0 weapon_lvl 0
    unit        Bulgarian Cavalry            exp 1 armour 0 weapon_lvl 0
    unit        Bulgarian Cavalry            exp 1 armour 0 weapon_lvl 0
    unit        EE Catapult                exp 0 armour 0 weapon_lvl 0
    end
        siege_settlement Bolda
    Preslavattack
        set_counter siege_preslav 1
    end_if

    If I_CompareCounter bunt_bułgarów = 3
            
    and not I_SettlementOwner Varna poland
            
    and not I_SettlementOwner Varna hungary
            
    and not I_SettlementOwner Varna hre
            
    and not I_SettlementOwner Varna france
            
    and not I_SettlementOwner Varna denmark
            
    and not I_SettlementOwner Varna sweden
            
    and not I_SettlementOwner Varna sicily
            
    and not I_SettlementOwner Varna england
            
    and not I_SettlementOwner Varna scotland
            
    and not I_SettlementOwner Varna spain
            
    and not I_SettlementOwner Varna portugal
            
    and not I_SettlementOwner Varna milan
            
    and not I_SettlementOwner Varna venice
            
    and not I_SettlementOwner Varna papal_states
            
    and not I_SettlementOwner Varna jerusalem
            
    and not I_SettlementOwner Varna egypt
            
    and not I_SettlementOwner Varna moors
            
    and not I_SettlementOwner Varna turks
            
    and not I_SettlementOwner Varna mongols
            
    and not I_SettlementOwner Varna timurids
            
    and not I_SettlementOwner Varna hedjaz
            
    and not I_SettlementOwner Varna normans
            
    and not I_SettlementOwner Varna serbia
            
    and not I_SettlementOwner Varna kiev
            
    and not I_SettlementOwner Varna russia
            
    and not I_SettlementOwner Varna armenia
            
    and not I_SettlementOwner Varna saxons

        spawn_army
            faction normans
    character    Chernek
    named characterage 16x 347y 171 
    traits Factionheir 1 
    GoodCommander 2 BattleDread 3 ReligionStarter 1 LoyaltyStarter 1 Austere 1 
    unit        Bulgarian Bodyguard            exp 1 armour 0 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Dismounted Bulgarian Cavalry        exp 1 armour 0 weapon_lvl 0
    unit        Dismounted Bulgarian Cavalry        exp 1 armour 0 weapon_lvl 0
    unit        Mongol Foot Archers            exp 1 armour 0 weapon_lvl 0
    unit        Mongol Foot Archers            exp 1 armour 0 weapon_lvl 0
    unit        Mongol Foot Archers            exp 1 armour 0 weapon_lvl 0
    unit        Mongol Foot Archers            exp 1 armour 0 weapon_lvl 0
    unit        Cuman Horse Archers            exp 1 armour 0 weapon_lvl 0
    unit        Cuman Horse Archers            exp 1 armour 0 weapon_lvl 0
    unit        Bulgarian Cavalry            exp 1 armour 0 weapon_lvl 0
    unit        Bulgarian Cavalry            exp 1 armour 0 weapon_lvl 0
    unit        EE Catapult                exp 0 armour 0 weapon_lvl 0
    end
        siege_settlement Chernek
    Varnaattack
        set_counter siege_varna 1
    end_if

    If I_CompareCounter bunt_bułgarów = 4
            
    and not I_SettlementOwner Craiova poland
            
    and not I_SettlementOwner Craiova hungary
            
    and not I_SettlementOwner Craiova hre
            
    and not I_SettlementOwner Craiova france
            
    and not I_SettlementOwner Craiova denmark
            
    and not I_SettlementOwner Craiova sweden
            
    and not I_SettlementOwner Craiova sicily
            
    and not I_SettlementOwner Craiova england
            
    and not I_SettlementOwner Craiova scotland
            
    and not I_SettlementOwner Craiova spain
            
    and not I_SettlementOwner Craiova portugal
            
    and not I_SettlementOwner Craiova milan
            
    and not I_SettlementOwner Craiova venice
            
    and not I_SettlementOwner Craiova papal_states
            
    and not I_SettlementOwner Craiova jerusalem
            
    and not I_SettlementOwner Craiova egypt
            
    and not I_SettlementOwner Craiova moors
            
    and not I_SettlementOwner Craiova turks
            
    and not I_SettlementOwner Craiova mongols
            
    and not I_SettlementOwner Craiova timurids
            
    and not I_SettlementOwner Craiova hedjaz
            
    and not I_SettlementOwner Craiova normans
            
    and not I_SettlementOwner Craiova serbia
            
    and not I_SettlementOwner Craiova kiev
            
    and not I_SettlementOwner Craiova russia
            
    and not I_SettlementOwner Craiova armenia
            
    and not I_SettlementOwner Craiova saxons

        spawn_army
            faction normans
    character    Stepan
    named characterage 16x 349y 199 
    traits Factionheir 1 
    GoodCommander 2 BattleDread 3 ReligionStarter 1 LoyaltyStarter 1 Austere 1 
    unit        Bulgarian Bodyguard            exp 1 armour 0 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Dismounted Bulgarian Cavalry        exp 1 armour 0 weapon_lvl 0
    unit        Dismounted Bulgarian Cavalry        exp 1 armour 0 weapon_lvl 0
    unit        Mongol Foot Archers            exp 1 armour 0 weapon_lvl 0
    unit        Mongol Foot Archers            exp 1 armour 0 weapon_lvl 0
    unit        Mongol Foot Archers            exp 1 armour 0 weapon_lvl 0
    unit        Mongol Foot Archers            exp 1 armour 0 weapon_lvl 0
    unit        Cuman Horse Archers            exp 1 armour 0 weapon_lvl 0
    unit        Cuman Horse Archers            exp 1 armour 0 weapon_lvl 0
    unit        Bulgarian Cavalry            exp 1 armour 0 weapon_lvl 0
    unit        Bulgarian Cavalry            exp 1 armour 0 weapon_lvl 0
    unit        EE Catapult                exp 0 armour 0 weapon_lvl 0
    end
        siege_settlement Stepan
    Craiovaattack
        set_counter siege_craiova 1
    end_if

    If I_CompareCounter bunt_bułgarów = 5
            
    and not I_SettlementOwner Nisz poland
            
    and not I_SettlementOwner Nisz hungary
            
    and not I_SettlementOwner Nisz hre
            
    and not I_SettlementOwner Nisz france
            
    and not I_SettlementOwner Nisz denmark
            
    and not I_SettlementOwner Nisz sweden
            
    and not I_SettlementOwner Nisz sicily
            
    and not I_SettlementOwner Nisz england
            
    and not I_SettlementOwner Nisz scotland
            
    and not I_SettlementOwner Nisz spain
            
    and not I_SettlementOwner Nisz portugal
            
    and not I_SettlementOwner Nisz milan
            
    and not I_SettlementOwner Nisz venice
            
    and not I_SettlementOwner Nisz papal_states
            
    and not I_SettlementOwner Nisz jerusalem
            
    and not I_SettlementOwner Nisz egypt
            
    and not I_SettlementOwner Nisz moors
            
    and not I_SettlementOwner Nisz turks
            
    and not I_SettlementOwner Nisz mongols
            
    and not I_SettlementOwner Nisz timurids
            
    and not I_SettlementOwner Nisz hedjaz
            
    and not I_SettlementOwner Nisz normans
            
    and not I_SettlementOwner Nisz serbia
            
    and not I_SettlementOwner Nisz kiev
            
    and not I_SettlementOwner Nisz russia
            
    and not I_SettlementOwner Nisz armenia
            
    and not I_SettlementOwner Nisz saxons

        spawn_army
            faction normans
    character    Grechin
    named characterage 16x 324y 186 
    traits Factionheir 1 
    GoodCommander 2 BattleDread 3 ReligionStarter 1 LoyaltyStarter 1 Austere 1 
    unit        Bulgarian Bodyguard            exp 1 armour 0 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Dismounted Bulgarian Cavalry        exp 1 armour 0 weapon_lvl 0
    unit        Dismounted Bulgarian Cavalry        exp 1 armour 0 weapon_lvl 0
    unit        Mongol Foot Archers            exp 1 armour 0 weapon_lvl 0
    unit        Mongol Foot Archers            exp 1 armour 0 weapon_lvl 0
    unit        Mongol Foot Archers            exp 1 armour 0 weapon_lvl 0
    unit        Mongol Foot Archers            exp 1 armour 0 weapon_lvl 0
    unit        Cuman Horse Archers            exp 1 armour 0 weapon_lvl 0
    unit        Cuman Horse Archers            exp 1 armour 0 weapon_lvl 0
    unit        Bulgarian Cavalry            exp 1 armour 0 weapon_lvl 0
    unit        Bulgarian Cavalry            exp 1 armour 0 weapon_lvl 0
    unit        EE Catapult                exp 0 armour 0 weapon_lvl 0
    end
        siege_settlement Grechin
    Niszattack
        set_counter siege_nisz 1
    end_if

    If I_CompareCounter bunt_bułgarów = 6
            
    and not I_SettlementOwner Skopia poland
            
    and not I_SettlementOwner Skopia hungary
            
    and not I_SettlementOwner Skopia hre
            
    and not I_SettlementOwner Skopia france
            
    and not I_SettlementOwner Skopia denmark
            
    and not I_SettlementOwner Skopia sweden
            
    and not I_SettlementOwner Skopia sicily
            
    and not I_SettlementOwner Skopia england
            
    and not I_SettlementOwner Skopia scotland
            
    and not I_SettlementOwner Skopia spain
            
    and not I_SettlementOwner Skopia portugal
            
    and not I_SettlementOwner Skopia milan
            
    and not I_SettlementOwner Skopia venice
            
    and not I_SettlementOwner Skopia papal_states
            
    and not I_SettlementOwner Skopia jerusalem
            
    and not I_SettlementOwner Skopia egypt
            
    and not I_SettlementOwner Skopia moors
            
    and not I_SettlementOwner Skopia turks
            
    and not I_SettlementOwner Skopia mongols
            
    and not I_SettlementOwner Skopia timurids
            
    and not I_SettlementOwner Skopia hedjaz
            
    and not I_SettlementOwner Skopia normans
            
    and not I_SettlementOwner Skopia serbia
            
    and not I_SettlementOwner Skopia kiev
            
    and not I_SettlementOwner Skopia russia
            
    and not I_SettlementOwner Skopia armenia
            
    and not I_SettlementOwner Skopia saxons

        spawn_army
            faction normans
    character    Kisel
    named characterage 16x 311y 169 
    traits Factionheir 1 
    GoodCommander 2 BattleDread 3 ReligionStarter 1 LoyaltyStarter 1 Austere 1 
    unit        Bulgarian Bodyguard            exp 1 armour 0 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Slav Levies                exp 1 armour 1 weapon_lvl 0
    unit        Dismounted Bulgarian Cavalry        exp 1 armour 0 weapon_lvl 0
    unit        Dismounted Bulgarian Cavalry        exp 1 armour 0 weapon_lvl 0
    unit        Mongol Foot Archers            exp 1 armour 0 weapon_lvl 0
    unit        Mongol Foot Archers            exp 1 armour 0 weapon_lvl 0
    unit        Mongol Foot Archers            exp 1 armour 0 weapon_lvl 0
    unit        Mongol Foot Archers            exp 1 armour 0 weapon_lvl 0
    unit        Cuman Horse Archers            exp 1 armour 0 weapon_lvl 0
    unit        Cuman Horse Archers            exp 1 armour 0 weapon_lvl 0
    unit        Bulgarian Cavalry            exp 1 armour 0 weapon_lvl 0
    unit        Bulgarian Cavalry            exp 1 armour 0 weapon_lvl 0
    unit        EE Catapult                exp 0 armour 0 weapon_lvl 0
    end
        siege_settlement Kisel
    Skopiaattack
        set_counter siege_skopia 1
    end_if

    end_monitor 
    log says:
    17:27:55.593 [game.script] [error] Script parsing error at line 191, column 1 in mods/oikoumene/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    don't recognise this token: If
    17:27:55.593 [game.script] [error] Script parsing error at line 193, column 9 in mods/oikoumene/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    Couldn't create a script from file mods/oikoumene/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    It looks like the game wouldn't like to accept line:
    If I_CompareCounter bunt_bułgarów = 1

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

    Default Re: Losing the settlement or battle as a condition of script

    I'm not sure if campaign_script lets you use special characters like ó. Just a guess.

  8. #8
    Kiliç Alì's Avatar Domesticus
    Artifex

    Join Date
    Feb 2011
    Location
    Italy
    Posts
    2,114

    Default Re: Losing the settlement or battle as a condition of script

    moreover, it is "if" and not "If" (the capital letter)

    Member of the Imperial House of Hader, proud client of The only and sole Ferrit

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

    Default Re: Losing the settlement or battle as a condition of script

    Oh yeah. That would do it.

  10. #10

    Default Re: Losing the settlement or battle as a condition of script

    oh damn
    It was it Sorry.
    Now log says nothing but script doesn't work too. Any idea?

  11. #11

    Default Re: Losing the settlement or battle as a condition of script

    TNZ are you sure that your script should work?
    i've added to it line
    historic_event bunt_bulgaria true
    to check it but it still doesn't work. So i suppose it is the matter of this part of script.

  12. #12

    Default Re: Losing the settlement or battle as a condition of script

    attyla: I think this bit is causing the problem in your script:
    Spoiler Alert, click show to read: 
    Code:
        	monitor_event OccupySettlement FactionType byzantium 
            	and IsRegionOneOf Constantinople_Province 
            	and IsRegionOneOf Gallipoli_Province 
            	and IsRegionOneOf Thrace 
            	and IsRegionOneOf Epirus_Province 
            	and IsRegionOneOf Morea 
            	and IsRegionOneOf Naxos_Province 
            	and IsRegionOneOf Bythinia
                	inc_counter byzantium_settlements 1 
        	end_monitor

    Try this instead:
    Spoiler Alert, click show to read: 
    Code:
    	monitor_event OccupySettlement FactionType byzantium 
            	and IsRegionOneOf Constantinople_Province, Gallipoli_Province, Thrace, Epirus_Province, Morea, Naxos_Province, Bythinia
            	inc_counter byzantium_settlements 1 
        	end_monitor

  13. #13

    Default Re: Losing the settlement or battle as a condition of script

    TNZ
    i'm afraid it still doesn't work.

  14. #14

    Icon1 Re: Losing the settlement or battle as a condition of script

    attyla: Try 'GeneralCaptureSettlement':
    Code:
    	monitor_event GeneralCaptureSettlement FactionType byzantium 
            	and IsRegionOneOf Constantinople_Province, Gallipoli_Province, Thrace, Epirus_Province, Morea, Naxos_Province, Bythinia
            	inc_counter byzantium_settlements 1 
        	end_monitor

  15. #15

    Default Re: Losing the settlement or battle as a condition of script

    Still doesn't work...

  16. #16

    Default Re: Losing the settlement or battle as a condition of script

    Another try and something worong again...
    What can be wrong with line
    and I_CompareCounter bunt_sofia > 8
    in script (this is a little part of it )
    PHP Code:
    monitor_event SettlementTurnStart SettlementName Sofia
        
    and not I_SettlementOwner Sofia normans
            
    if SettlementLoyaltyLevel loyalty_disillusioned
                generate_random_counter bunt_sofia 1 10
                    
    and I_CompareCounter bunt_sofia 8
                    
    if I_IsFactionAiControlled normans 
    I have a lot almost the same conditions but this one only won't work...

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

    Default Re: Losing the settlement or battle as a condition of script

    "if SettlementLoyaltyLevel" won't work. That should be an "and" I think, not an "if".

    "and I_CompareCounter bunt_sofia > 8" ... "and" with what? Should be an "if"?

  18. #18

    Default Re: Losing the settlement or battle as a condition of script

    Nice. It turns me upside down the whole concept
    I can only get down to work

  19. #19

    Default Re: Losing the settlement or battle as a condition of script

    How can i check if faction exists? I've tried to use I_IsFactionAiControlled (faction is spawned) but every time when i've tried to use it log told to me that "condotion parser doesn't recognise token: I_IsFactionAiControlled...

  20. #20

    Default Re: Losing the settlement or battle as a condition of script

    Or maybe there is a possible to check if specific faction has its own leader?

Page 1 of 3 123 LastLast

Posting Permissions

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