Results 1 to 9 of 9

Thread: The Mongols at war with themselves - is this a bug?

  1. #1
    Geoffrey of Villehardouin's Avatar Campidoctor
    Content Staff

    Join Date
    Jan 2011
    Location
    Magdeburg
    Posts
    1,726

    Default The Mongols at war with themselves - is this a bug?

    There seems to be a potentially problematic piece of code on Khiva in the campaign_script. It seems the Mongols lay siege to Khiva even if it belongs to them (sold by Khwarezm) and the campaign crashes. Is this a known issue?

  2. #2

    Default Re: The Mongols at war with themselves - is this a bug?

    Dont know anything about it, but I sure laughed out loud at this bug, haha. xD

  3. #3

    Default Re: The Mongols at war with themselves - is this a bug?

    that can only be when there is a scripted command in campaign_script like this that is forcing the mongols too attack the settlement even if the settlement is owned by themself and so campaign crash

    script like this:
    siege_settlement Baraka Yamak, Khiva, maintain
    siege_settlement Baraka Yamak,Khiva, attack

    but schould have; and not I_settlementowner Khiva = mongols
    and not I_SettlementUnderSiege Khiva

  4. #4
    Geoffrey of Villehardouin's Avatar Campidoctor
    Content Staff

    Join Date
    Jan 2011
    Location
    Magdeburg
    Posts
    1,726

    Default Re: The Mongols at war with themselves - is this a bug?

    The "and not I_settlementowner Khiva = mongols" condition is missing. Still it did not work. Here is the relevant code with your line added

    Spoiler Alert, click show to read: 
    Code:
    ;mongols weaken and no longer are a superpower
    monitor_event PreFactionTurnStart FactionType mongols
        and not FactionIsLocal
        and I_EventCounter mongols_invasion = 5
    
        set_event_counter is_the_ai 0
    
        end_monitor
    
        declare_counter attack_khiva
    set_counter attack_khiva 0
    
    monitor_event FactionTurnStart FactionType mongols
        and not FactionIsLocal
        and I_CharacterExists mongols4jebe
        and I_CharacterExists mongols4bayan
    
        if I_CompareCounter attack_khiva = 1
            siege_settlement mongols4jebe, Khiva, attack
            siege_settlement mongols4bayan, Khiva, maintain
            set_counter attack_khiva 2
            terminate_monitor
        end_if
    
        if not I_SettlementUnderSiege Khiva
        and not I_settlementowner Khiva = mongols
            if I_CompareCounter attack_khiva = 0
                siege_settlement mongols4jebe, Khiva, maintain
                siege_settlement mongols4bayan, Khiva, maintain
                set_counter attack_khiva 1
            end_if
        end_if
    
    end_monitor

  5. #5

    Default Re: The Mongols at war with themselves - is this a bug?

    i don't know that script but maybe it got too be like this;this is not saved game free
    Code:
    ;mongols weaken and no longer are a superpower    monitor_event PreFactionTurnStart FactionType mongols
        and not FactionIsLocal
        and I_EventCounter mongols_invasion = 5
    
    
    
    
        set_event_counter is_the_ai 0
    
    
    
    
        end_monitor
    
    
    
    
        declare_counter attack_khiva
    set_counter attack_khiva 0
    
    
    
    
    monitor_event FactionTurnStart FactionType mongols
        and not FactionIsLocal
        and not I_settlementowner Khiva = mongols
        and not I_SettlementUnderSiege Khiva
        and I_CharacterExists mongols4jebe
        and I_CharacterExists mongols4bayan
    
    
            set_counter attack_khiva 1
    
    
        if I_CompareCounter attack_khiva = 1
            siege_settlement mongols4jebe, Khiva, maintain
            siege_settlement mongols4bayan, Khiva, attack
            set_counter attack_khiva 0
            terminate_monitor
        end_if
    
    
    end_monitor
    but there schould be a easier code for this kind of script .
    Last edited by stevietheconquer; May 27, 2014 at 03:46 PM.

  6. #6

    Default Re: The Mongols at war with themselves - is this a bug?

    IMO it would be also good to mimic the conditions of the Teutonic Order script fix (avoids CTDs in case the characters cant reach the objective and stuff) as well as adding that codeline.

    will include this in the bugfix compilation
    Last edited by Melooo182; May 26, 2014 at 04:56 PM.

  7. #7

    Default Re: The Mongols at war with themselves - is this a bug?

    Ok here is my take on a more permanent fix including some extra safety measures as was done with Teutonic Order siege scripts

    Included the other 2 settlements targeted for siege by mongols
    mongols fix
    Code:
    declare_counter attack_urgench
    set_counter attack_urgench 0
    
    
    monitor_event FactionTurnStart FactionType mongols
        and not I_SettlementOwner Urgench = mongols
        and I_IsFactionAIControlled mongols
        and I_CharacterExists mongols4genghis
        and I_CharacterExists mongols4aradai
        
        if I_SettlementUnderSiege Urgench;if settlement under siege already, avoid ctd.
        and  I_CompareCounter attack_urgench = 0
            terminate_monitor
        end_if
    
    
        if not I_CharacterTypeNearTile mongols, named_character, 5, 500, 154 ;if character not standing where it should, avoid ctd
            terminate_monitor
        end_if
    
    
        if I_CompareCounter attack_urgench = 1
            siege_settlement mongols4genghis, Urgench, attack
            siege_settlement mongols4aradai, Urgench, maintain
            set_counter attack_urgench 2
            if I_CharacterExists mongols4aradai
                move mongols4aradai, 453, 207;for jaiksk
            end_if
            terminate_monitor
        end_if
    
    
        if not I_SettlementUnderSiege Urgench
            if I_CompareCounter attack_urgench = 0
                siege_settlement mongols4genghis, Urgench, maintain
                siege_settlement mongols4aradai, Urgench, maintain
                set_counter attack_urgench 1
            end_if
        end_if
    end_monitor
    
    
    declare_counter attack_khiva
    set_counter attack_khiva 0
    
    
    monitor_event FactionTurnStart FactionType mongols
        and not I_SettlementOwner Khiva = mongols
        and I_IsFactionAIControlled mongols
        and I_CharacterExists mongols4jebe
        and I_CharacterExists mongols4bayan
        
        if I_SettlementUnderSiege Khiva;if settlement under siege already, avoid ctd.
        and  I_CompareCounter attack_khiva = 0
            terminate_monitor
        end_if
    
    
        if not I_CharacterTypeNearTile mongols, named_character, 5, 505, 147 ;if character not standing where it should, avoid ctd
            terminate_monitor
        end_if
    
    
        if I_CompareCounter attack_khiva = 1
            siege_settlement mongols4jebe, Khiva, attack
            siege_settlement mongols4bayan, Khiva, maintain
            set_counter attack_khiva 2
            terminate_monitor
        end_if
    
    
        if not I_SettlementUnderSiege Khiva
            if I_CompareCounter attack_khiva = 0
                siege_settlement mongols4jebe, Khiva, maintain
                siege_settlement mongols4bayan, Khiva, maintain
                set_counter attack_khiva 1
            end_if
        end_if
    end_monitor
    
    
    declare_counter attack_konjikala
    set_counter attack_konjikala 0
    
    
    monitor_event FactionTurnStart FactionType mongols
        and not I_SettlementOwner Konjikala = mongols
        and I_IsFactionAIControlled mongols
        and I_CharacterExists mongols4chindu
        and I_CharacterExists mongols4nayuk
        
        if I_SettlementUnderSiege Konjikala;if settlement under siege already, avoid ctd.
        and  I_CompareCounter attack_konjikala = 0
            terminate_monitor
        end_if
    
    
        if not I_CharacterTypeNearTile mongols, named_character, 5, 490, 126 ;if character not standing where it should, avoid ctd
            terminate_monitor
        end_if
    
    
        if I_CompareCounter attack_konjikala = 1
            siege_settlement mongols4chindu, Konjikala, attack
            siege_settlement mongols4nayuk, Konjikala, maintain
            set_counter attack_konjikala 2
            terminate_monitor
        end_if
    
    
        if not I_SettlementUnderSiege Konjikala
            if I_CompareCounter attack_konjikala = 0
                siege_settlement mongols4chindu, Konjikala, maintain
                siege_settlement mongols4nayuk, Konjikala, maintain
                set_counter attack_konjikala 1
            end_if
        end_if
    end_monitor


    Timurids suffered from the same errors, so here they are included
    timurids fix
    Code:
    declare_counter attack_urgench_timurids
    set_counter attack_urgench_timurids 0
    
    
    monitor_event FactionTurnStart FactionType timurids
        and not I_SettlementOwner Urgench = timurids
        and I_IsFactionAIControlled timurids
        and I_CharacterExists timurids4timur
        and I_CharacterExists timurids4husayn
        
        if I_SettlementUnderSiege Urgench;if settlement under siege already, avoid ctd.
        and  I_CompareCounter attack_urgench = 0
            terminate_monitor
        end_if
    
    
        if not I_CharacterTypeNearTile timurids, named_character, 5, 500, 154 ;if character not standing where it should, avoid ctd
            terminate_monitor
        end_if
    
    
        if I_CompareCounter attack_urgench_timurids = 1
            siege_settlement timurids4timur, Urgench, attack
            siege_settlement timurids4husayn, Urgench, maintain
            set_counter attack_urgench_timurids 2
            if I_CharacterExists timurids4husayn
                move timurids4husayn, 453, 207;for jaiksk
            end_if
            terminate_monitor
        end_if
    
    
        if not I_SettlementUnderSiege Urgench
            if I_CompareCounter attack_urgench_timurids = 0
                siege_settlement timurids4timur, Urgench, maintain
                siege_settlement timurids4husayn, Urgench, maintain
                set_counter attack_urgench_timurids 1
            end_if
        end_if
    
    
    end_monitor
    
    
    declare_counter attack_khiva_timurids
    set_counter attack_khiva_timurids 0
    
    
    monitor_event FactionTurnStart FactionType timurids
        and not I_SettlementOwner Khiva = timurids
        and I_IsFactionAIControlled timurids
        and I_CharacterExists timurids4umar
        and I_CharacterExists timurids4miran
        
        if I_SettlementUnderSiege Khiva;if settlement under siege already, avoid ctd.
        and  I_CompareCounter attack_khiva = 0
            terminate_monitor
        end_if
    
    
        if not I_CharacterTypeNearTile timurids, named_character, 5, 505, 147 ;if character not standing where it should, avoid ctd
            terminate_monitor
        end_if
    
    
        if I_CompareCounter attack_khiva_timurids = 1
            siege_settlement timurids4umar, Khiva, attack
            siege_settlement timurids4miran, Khiva, maintain
            set_counter attack_khiva_timurids 2
            terminate_monitor
        end_if
    
    
        if not I_SettlementUnderSiege Khiva
            if I_CompareCounter attack_khiva_timurids = 0
                siege_settlement timurids4umar, Khiva, maintain
                siege_settlement timurids4miran, Khiva, maintain
                set_counter attack_khiva_timurids 1
            end_if
        end_if
    
    
    end_monitor
    
    
    declare_counter attack_konjikala_timurids
    set_counter attack_konjikala_timurids 0
    
    
    monitor_event FactionTurnStart FactionType timurids
        and not I_SettlementOwner Konjikala = timurids
        and I_IsFactionAIControlled timurids
        and I_CharacterExists timurids4batutai
        and I_CharacterExists timurids4ghazatai
        
        if I_SettlementUnderSiege Konjikala;if settlement under siege already, avoid ctd.
        and  I_CompareCounter attack_konjikala = 0
            terminate_monitor
        end_if
    
    
        if not I_CharacterTypeNearTile timurids, named_character, 5, 490, 126 ;if character not standing where it should, avoid ctd
            terminate_monitor
        end_if
    
    
        if I_CompareCounter attack_konjikala_timurids = 1
            siege_settlement timurids4batutai, Konjikala, attack
            siege_settlement timurids4ghazatai, Konjikala, maintain
            set_counter attack_konjikala_timurids 2
            terminate_monitor
        end_if
    
    
        if not I_SettlementUnderSiege Konjikala
            if I_CompareCounter attack_konjikala_timurids = 0
                siege_settlement timurids4batutai, Konjikala, maintain
                siege_settlement timurids4ghazatai, Konjikala, maintain
                set_counter attack_konjikala_timurids 1
            end_if
        end_if
    
    
    end_monitor

  8. #8
    RobotGonzo's Avatar Foederatus
    Join Date
    Apr 2014
    Location
    Austin, TX
    Posts
    29

    Default Re: The Mongols at war with themselves - is this a bug?

    It's kinda fitting when you really think about it though.

  9. #9

    Default Re: The Mongols at war with themselves - is this a bug?

    Do I replace any lines in campaign_script.txt, or do I only add these lines into the file?

Posting Permissions

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