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

Thread: Script for annexing a faction by marriage ties

  1. #1

    Default Script for annexing a faction by marriage ties

    I suppose that many people already know this kind of methods to create "dynastic ties", but I put it in case it may be useful to someone. This script is used to join two factions together through marriage of the heir (or leader) with the Princess. When the years pass and die the leader of the other faction, you'll inherit all domains.

    In this example, it will join the Sicily (AI) faction with France (local faction). The first thing to do, is go with the diplomat directly to the Princess to establish diplomatic relations and provide the marriage.

    First, you must created a hidden trait for princesses, to be able to recognize them in the script. In this example, for Sicily.

    Add this to "...\data\export_descr_character_traits.txt"
    Code:
    ;------------------------------------------
    Trait PrincessSicily
        Characters princess
        Hidden
    
        Level Princess_Sicily
            Description Princess_Sicily_desc
            EffectsDescription Princess_Sicily_effects_desc
            Threshold  1
     
            Effect PersonalSecurity  1
    
    ;------------------------------------------
    Code:
    ;------------------------------------------
    Trigger princess_of_sicily
        WhenToTest CharacterComesOfAge
    
        Condition AgentType = princess
              and FactionType sicily
    
        Affects PrincessSicily  1  Chance  100
    
    ;------------------------------------------
    Add the trait to Princess in "...\data\world\maps\campaign\imperial_campaign\descr_strat.txt"
    Code:
    character    Matilda, princess, female, age 17, x 159, y 83
    traits IAmPrincess 1 , PrincessSicily 1 , NaturalPrincess 2 , GoodPrincess 1
    Add this to "...\data\world\maps\campaign\imperial_campaign\campaign_script.txt"
    Code:
        declare_counter ties_fra_sic
        declare_counter union_fra_sic
    
        monitor_event CharacterMarriesPrincess FactionType france
            and Trait Factionleader = 1
            and SpouseTrait PrincessSicily = 1
            and I_LocalFaction france
    
            set_counter ties_fra_sic 1
            terminate_monitor
        end_monitor
    
        monitor_event CharacterMarriesPrincess FactionType france
            and Trait Factionheir = 1
            and SpouseTrait PrincessSicily = 1
            and I_LocalFaction france
    
            set_counter ties_fra_sic 1
            terminate_monitor
        end_monitor
    
        monitor_event InterFactionMarriage FactionType sicily
            and I_CompareCounter ties_fra_sic = 1
            and I_LocalFaction france
    
            set_counter union_fra_sic 1
            terminate_monitor
        end_monitor
    
        monitor_event CeasedFactionLeader FactionType sicily
            and I_FactionLeaderAttribute sicily Command < 5
            and I_SettlementOwner Naples = sicily
            and I_SettlementOwner Paris = france
            and I_CompareCounter union_fra_sic = 1
            and I_LocalFaction france
    
            historic_event france_sicily true factions { france, }
    
            terminate_monitor
        end_monitor
    
        monitor_event EventCounter EventCounterType france_sicily_accepted
            and I_EventCounter france_sicily_accepted = 1
            
            give_everything_to_faction sicily france false
            historic_event sicily_crown
    
            terminate_monitor
        end_monitor
    In the first two events, it detects if our character has married a Princess and who has been exactly. The third event detects that a marriage has occured between two factions. Indicating the other faction. In this case, Sicily.

    Once has given the value of 1 to the counter of "union", adds an event that will trigger the message with question. The conditions are to personal taste, I put these as an example; Once dead the leader of the other faction. Once answered the question, if so, the "give_everything_to_faction" command is used to unite Sicily to the kingdom of France.

    Add event descriptions in "...\data\text\historic_events.txt"
    Code:
    {FRANCE_SICILY_BODY}The King of Sicily has died, and his successor doesn't have the support of much of the nobility. Since your Royal family has the same family relationships that the Kingdom of Sicily, you can claim your legitimate right to the throne in the Sicilian Court.\n\nDo you want to claim your dynastic rights to the Crown?
    {FRANCE_SICILY_TITLE}Union of France with Sicily
    {SICILY_CROWN_BODY}The Kingdom of France and the Kingdom of Sicily are joined forming a single Crown, under the command of the French King.
    {SICILY_CROWN_TITLE}The Kingdom of France and Sicily
    If you want to change the coat of arms and banners you can add this command:
    Code:
    set_faction_banner
        faction france
        banner FACTION
    end_set_faction_banner
    To add the image to the message, you need a TGA file with the name of the event in the "eventpics" folder. Example for this case: "...\data\ui\northern_european\eventpics\sicily_crown.tga"


    Sample photos of the script:
    Spoiler Alert, click show to read: 








    I hope to be useful for you. Best regards.
    Last edited by Miguel_80; March 02, 2018 at 09:43 AM. Reason: Updated

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

    Default Re: Script for annexing a faction by marriage ties

    Nice. Thanks for sharing, Miguel.

    It seems to have a flaw, unless I'm missing something...

    If the france leader married an england princess then the first monitor will fire and ties_fra_sic = 1. Then, as soon as any character from sicily marries any faction other than sicily (not necessarily france), the third monitor will fire and france player will get sicily's regions.

    It seems that the CharacterMarriesPrincess monitors need to have a condition that limits it to sicily princesses, but I can't think of a way to do that. If it could be done then there would also be no need for the InterFactionMarriage monitor.

  3. #3

    Default Re: Script for annexing a faction by marriage ties

    Thank you very much Withwnar!

    Yes, it's true. If there are multiple combinations in the same local faction, it could spend what you mention. But I think the "InterFactionMarriage" event has no effect if the marriage is between factions of the AI.


    P.S: The "TargetFactionType" condition is unavailable to "CharacterMarriesPrincess" event. I can't find another possible condition.
    Last edited by Miguel_80; January 13, 2015 at 06:22 AM.

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

    Default Re: Script for annexing a faction by marriage ties

    I have a solution which appears to work...

    Testing is difficult, waiting for a princess to offer marriage. Fortunately this...

    Code:
    monitor_event FactionTurnStart
    
      console_command diplomacy_mission france england alliance
    
    terminate_monitor
    end_monitor
    ...has the side effect in Kingdoms Grand Campaign of the French princess asking to marry England's heir during turn 2's end. So I'll use england (player, leader/heir) and france (princess) as an example, instead of france and sicily.

    To see what events were firing I used this...

    Code:
    monitor_event CharacterMarriesPrincess FactionType england
      log always CharacterMarriesPrincess FactionType england
    end_monitor
    
    monitor_event InterFactionMarriage FactionType england
      and TargetFactionType france
      log always InterFactionMarriage FactionType england
    end_monitor
    
    monitor_event InterFactionMarriage FactionType france
      and TargetFactionType england
      log always InterFactionMarriage FactionType france
    end_monitor
    (I also tried all other events with "Marriage" or "Marries" in the name and those didn't fire in this scenario. Not even CharacterMarries.)

    The log result was...

    Code:
    17:34:30.031 [game.script] [always] CharacterMarriesPrincess FactionType england
    17:34:30.031 [game.script] [always] InterFactionMarriage FactionType england
    17:34:30.031 [game.script] [always] InterFactionMarriage FactionType france
    So CharacterMarriesPrincess fires first and InterFactionMarriage (one each for the two characters involved) fires immediately after.

    Therefore, we can use CharacterMarriesPrincess to handle the "is england leader/heir" side then use a campaign_wait to let InterFactionMarriage fire and test there if france was the other faction involved (i.e. is a france princess), then use that result back in CharacterMarriesPrincess when it continues after its wait.

    Code:
    declare_counter is_fra_princess
    
    monitor_event CharacterMarriesPrincess FactionType england
      and FactionIsLocal
      and IsFactionLeader
      
      set_counter is_fra_princess 0
      campaign_wait 0.1
      
      if I_CompareCounter is_fra_princess = 1
        set_counter union_eng_fra 1
        terminate_monitor
      end_if
      
    end_monitor
    
    monitor_event CharacterMarriesPrincess FactionType england
      and FactionIsLocal
      and IsFactionHeir
      
      set_counter is_fra_princess 0
      campaign_wait 0.1
      
      if I_CompareCounter is_fra_princess = 1
        set_counter union_eng_fra 1
        terminate_monitor
      end_if
      
    end_monitor
    
    monitor_event InterFactionMarriage FactionType france
      set_counter is_fra_princess 1
    end_monitor
    1) If player england leader marries a princess then the first monitor fires. We don't know what faction the princess is yet.
    2) is_fra_princess is set to 0 (in case it was still 1 from some previous firing) then waits.
    3) During the wait the third monitor will fire, but only if france was involved in an inter-faction-marriage at this time. In which case it must have been a france princess. If FactionType is not france -> it wasn't a france princess that the leader just married -> the third monitor won't fire -> is_fra_princess remains 0.
    4) The first monitor continues after it's 0.1 second pause: is_fra_princess will now be either 1 (married france princess) or 0 (married non-france princess). If 1 then set the union_eng_fra counter (for use in other script) and kill the monitor.

    The same applies to the heir (second monitor).

  5. #5

    Default Re: Script for annexing a faction by marriage ties

    Ok Withwnar. With your method, it avoids that the counter has value 1 when the heir/leader marries with the Princess of another faction. Good thinking!

  6. #6

    Default Re: Script for annexing a faction by marriage ties

    I have a solution! I created a hidden trait for princesses, to be able to recognize them in the script.

    Trait:
    Code:
    ;------------------------------------------
    Trait PrincessSicily
        Characters princess
        Hidden
    
        Level Princess_Sicily
            Description Princess_Sicily_desc
            EffectsDescription Princess_Sicily_effects_desc
            Threshold  1 
     
            ;Effect PersonalSecurity  1 
    
    ;------------------------------------------
    Trigger:
    Code:
    ;------------------------------------------
    Trigger princess_of_sicily
        WhenToTest CharacterComesOfAge
    
        Condition AgentType = princess
              and FactionType sicily
    
        Affects PrincessSicily  1  Chance  100 
    
    ;------------------------------------------
    Add the trait in "descr_strat.txt":
    Code:
    character    Matilda, princess, female, age 17, x 159, y 83 
    traits IAmPrincess 1 , PrincessSicily 1 , NaturalPrincess 2 , GoodPrincess 1
    Add the condition in script:
    Code:
        monitor_event CharacterMarriesPrincess FactionType france
            and Trait Factionleader = 1
            and SpouseTrait PrincessSicily = 1
            and I_LocalFaction france
    
            set_counter ties_fra_sic 1
            terminate_monitor
        end_monitor
    
        monitor_event CharacterMarriesPrincess FactionType france
            and Trait Factionheir = 1
            and SpouseTrait PrincessSicily = 1
            and I_LocalFaction france
    
            set_counter ties_fra_sic 1
            terminate_monitor
        end_monitor
    It works. If the princess doesn't have the trait, the script doesn't work. Now I have the possibility of creating matrimonial ties with various factions.

    Thank you very much for your help, Withwnar. No detail ever escapes to you.
    Last edited by Miguel_80; January 13, 2015 at 07:03 PM.

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

    Default Re: Script for annexing a faction by marriage ties

    Sure, if you want to do it the easy way. Good thinking.

  8. #8
    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,095
    Blog Entries
    35

    Default Re: Script for annexing a faction by marriage ties

    Nice use of the give_everything command. It could do with one more trigger for that princess trait in order to do away with the manual entry at the start of the game:

    Code:
    Trigger princess_of_sicily_a
        WhenToTest CharacterComesOfAge
    
        Condition AgentType = princess
              and FactionType sicily
    
        Affects SicilyPrincess  1  Chance  100
    
    Trigger princess_of_sicily_b
        WhenToTest CharacterTurnStart
    
        Condition AgentType = princess
              and FactionType sicily
              and Trait SicilyPrincess < 1
    
        Affects SicilyPrincess  1  Chance  100
    You may also want to trigger an event when a princess comes of age for the player's (local) faction to point out the mechanics of this. They usually get grabbed up pretty quick by your faction's bachelors otherwise.
    Last edited by Gigantus; January 14, 2015 at 02:56 AM.










  9. #9

    Default Re: Script for annexing a faction by marriage ties

    Thanks Gigantus!! Yes, it's also another possibility add this trigger. And I also use the script with the objective to marry the local princess with other heir/leader (AI), and then by marriage ties, I can get a city using the "capture_settlement" command.

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

    Default Re: Script for annexing a faction by marriage ties


  11. #11

    Default Re: Script for annexing a faction by marriage ties

    Quote Originally Posted by Withwnar View Post
    Many thanks for the warning!

    I have tested the script by adding this condition, and it doesn't work.
    Code:
        monitor_event CeasedFactionLeader FactionType sicily
            and IsCrusadeTargetFaction
            and I_FactionLeaderAttribute sicily Command < 6
            and I_SettlementOwner Naples = sicily
            and I_SettlementOwner Paris = france
            and I_CompareCounter union_fra_sic = 1
            and I_LocalFaction france
    
            historic_event france_sicily true factions { france, }
    
            terminate_monitor
        end_monitor
    And adding this condition does work. I suppose that this would avoid the error, if there is a crusade against Sicily.
    Code:
        monitor_event CeasedFactionLeader FactionType sicily
            and not IsCrusadeTargetFaction
            and I_FactionLeaderAttribute sicily Command < 6
            and I_SettlementOwner Naples = sicily
            and I_SettlementOwner Paris = france
            and I_CompareCounter union_fra_sic = 1
            and I_LocalFaction france
    
            historic_event france_sicily true factions { france, }
    
            terminate_monitor
        end_monitor
    Although this solution would be ideal. But you said that this method doesn’t cancel the crusade. It's a problem...
    Code:
        set_religion france heretic
        give_everything_to_faction sicily france false
        set_religion france catholic
    Last edited by Miguel_80; January 17, 2015 at 08:40 AM.

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

    Default Re: Script for annexing a faction by marriage ties

    Any log errors? IsCrusadeTargetFaction requires a target_faction but CeasedFactionLeader does not export that, only "faction".

    This should work...

    Code:
    declare_counter sicily_is_crusade_target
    
    monitor_event FactionTurnStart FactionType sicily
      set_counter sicily_is_crusade_target 0
    end_monitor
    
    monitor_event SettlementTurnEnd FactionType sicily
      and IsCrusadeTarget
      set_counter sicily_is_crusade_target 1
    end_monitor
    ...then use "sicily_is_crusade_target = 0" as a condition in your monitor.

  13. #13

    Default Re: Script for annexing a faction by marriage ties

    There aren't errors in log file. Curiously it "works".

    And with this event also happens the same. But, I should try it with a crusade too.

    Don't works:
    Code:
        monitor_event InterFactionMarriage FactionType sicily
            and I_CompareCounter ties_fra_sic = 1
            and IsCrusadeTargetFaction
            and I_LocalFaction france
    
            set_counter union_fra_sic 1
            terminate_monitor
        end_monitor
    Works:
    Code:
        monitor_event InterFactionMarriage FactionType sicily
            and I_CompareCounter ties_fra_sic = 1
            and not IsCrusadeTargetFaction
            and I_LocalFaction france
    
            set_counter union_fra_sic 1
            terminate_monitor
        end_monitor

    Although your solution is better.
    Last edited by Miguel_80; January 17, 2015 at 10:16 AM.

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

    Default Re: Script for annexing a faction by marriage ties

    InterFactionMarriage does export target_faction so, yes, that one should work. But here you're only checking the crusade situation at the time of the marriage; things could be different by the time your give_everything monitor fires.

    When I try IsCrusadeTargetFaction with FactionTurnStart - which, like CeasedFactionLeader, exports faction but not target_faction - I get this log error:

    <target_faction> is unavailable from event <FactionTurnStart>
    when testing <IsCrusadeTargetFaction> condition

    If CeasedFactionLeader isn't showing that error when it fires then I don't understand why not.

  15. #15

    Default Re: Script for annexing a faction by marriage ties

    I don't know it. But with the "IsCrusadeTargetFaction" condition doesn't appear the event.

    Code:
        monitor_event FactionTurnStart FactionIsLocal 
            and I_TurnNumber = 2
            
            kill_character Roger
    
            terminate_monitor        
        end_monitor
    Code:
        monitor_event CeasedFactionLeader FactionType sicily
            and IsCrusadeTargetFaction
            and I_FactionLeaderAttribute sicily Command < 6
            and I_SettlementOwner Naples = sicily
            and I_SettlementOwner Paris = france
            and I_CompareCounter union_fra_sic = 1
            and I_LocalFaction france
    
            historic_event france_sicily true factions { france, }
    
            terminate_monitor
        end_monitor
    Spoiler Alert, click show to read: 


    Spoiler Alert, click show to read: 

    18:39:20.093 [game.script.exec] [trace] exec <declare_counter> at line 8 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <declare_counter> at line 9 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <declare_counter> at line 10 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <declare_counter> at line 11 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <declare_counter> at line 12 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <declare_counter> at line 13 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <declare_counter> at line 14 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <declare_counter> at line 15 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <freeze_faction_ai> at line 21 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_event> at line 30 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_event> at line 38 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <declare_counter> at line 48 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <declare_counter> at line 49 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_event> at line 56 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_event> at line 65 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_event> at line 74 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_event> at line 86 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_event> at line 95 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_event> at line 110 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_event> at line 127 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_event> at line 143 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <declare_counter> at line 157 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_event> at line 163 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_event> at line 169 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_event> at line 175 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_event> at line 181 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_event> at line 187 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_conditions> at line 194 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_event> at line 223 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_event> at line 246 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_event> at line 257 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_event> at line 266 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_event> at line 274 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_event> at line 282 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <declare_counter> at line 288 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <declare_counter> at line 289 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_event> at line 294 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_event> at line 304 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.093 [game.script.exec] [trace] exec <monitor_event> at line 314 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_event> at line 322 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_event> at line 347 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_event> at line 468 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_event> at line 479 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_event> at line 870 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_event> at line 881 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_event> at line 1173 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_event> at line 1182 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_event> at line 1190 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_event> at line 1204 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_event> at line 1215 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_event> at line 1219 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_event> at line 1224 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_event> at line 1228 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_conditions> at line 1251 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_conditions> at line 1425 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_conditions> at line 1525 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_conditions> at line 1722 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_conditions> at line 1844 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_conditions> at line 2063 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_conditions> at line 2209 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_conditions> at line 2386 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_conditions> at line 2499 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_conditions> at line 2680 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_conditions> at line 2799 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_conditions> at line 2895 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_conditions> at line 3014 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_conditions> at line 3111 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_conditions> at line 3210 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_conditions> at line 3300 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_conditions> at line 3411 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_conditions> at line 3522 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_conditions> at line 3616 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_conditions> at line 3711 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_conditions> at line 3803 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <monitor_conditions> at line 3900 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:39:20.109 [game.script.exec] [trace] exec <wait_monitors> at line 3982 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt


    Is there any way to display more details about the event of script file?
    Last edited by Miguel_80; January 17, 2015 at 12:09 PM.

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

    Default Re: Script for annexing a faction by marriage ties

    You're saying that the event isn't firing if it has IsCrusadeTargetFaction as a condition?

    If so then my guess is that it's breaking that monitor, like mine broke my FactionTurnStart one, but for some reason it isn't logging the error. Try it with FactionTurnStart and see if the error appears, just to make sure that you are seeing "error" type log reports.

    Is there any way to display more details about the event of script file?
    Not that I know of.

  17. #17

    Default Re: Script for annexing a faction by marriage ties

    I try this monitor_event, but don't appears any error in log file.

    Code:
        monitor_event FactionTurnStart FactionType france
            and IsCrusadeTargetFaction
    
            console_command diplomatic_stance papal_states france War
            set_faction_standing papal_states france -0.8
    
            terminate_monitor        
        end_monitor
    And the other "monitor_event" with this commands:
    Code:
        monitor_event CeasedFactionLeader FactionType sicily
            and not IsCrusadeTargetFaction
            and I_FactionLeaderAttribute sicily Command < 6
            and I_SettlementOwner Naples = sicily
            and I_SettlementOwner Paris = france
            and I_CompareCounter union_fra_sic = 1
            and I_LocalFaction france
    
            log always CeasedFactionLeader FactionType sicily
            log always IsCrusadeTargetFaction
            historic_event france_sicily true factions { france, }
    
            terminate_monitor
        end_monitor

    CeasedFactionLeader in log file:

    19:58:23.578 [game.script.exec] [trace] exec <log> at line 100 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    19:58:23.578 [game.script] [always] CeasedFactionLeader FactionType sicily
    19:58:23.578 [game.script.exec] [trace] exec <log> at line 101 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    19:58:23.578 [game.script] [always] IsCrusadeTargetFaction
    19:58:23.578 [game.script.exec] [trace] exec <historic_event> at line 102 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    19:58:23.625 [game.script.exec] [trace] exec <terminate_monitor> at line 104 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt


    The log file: http://www.mediafire.com/download/ij...system.log.rar


    EDIT: And this "monitor_event"

    Code:
    	monitor_event FactionTurnStart FactionType france
    		and not IsCrusadeTargetFaction
    
    		console_command diplomatic_stance papal_states france War
    		set_faction_standing papal_states france -0.8
    
    		log always CeasedFactionLeader FactionType france
    		log always IsCrusadeTargetFaction
    
    		terminate_monitor		
    	end_monitor
    Log file:

    20:21:39.546 [game.script.exec] [trace] exec <console_command> at line 30 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    20:21:39.562 [game.script.trigger] [trace] Trigger <0031_P_Faction_Excommunicated> fired
    20:21:39.562 [game.script.trigger] [trace] Trigger <0039_P_War_Declared> fired
    20:21:39.562 [game.script.trigger] [trace] Trigger <0208_Message_Incoming_War_Declared_Trigger> fired
    20:21:39.562 [game.script.exec] [trace] exec <set_faction_standing> at line 31 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    20:21:39.562 [game.script.exec] [trace] exec <log> at line 33 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    20:21:39.562 [game.script] [always] CeasedFactionLeader FactionType france
    20:21:39.562 [game.script.exec] [trace] exec <log> at line 34 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    20:21:39.562 [game.script] [always] IsCrusadeTargetFaction
    20:21:39.562 [game.script.exec] [trace] exec <terminate_monitor> at line 36 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    20:21:39.562 [game.script.exec] [trace] exec <set_faction_standing> at line 44 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    20:21:39.562 [game.script.exec] [trace] exec <terminate_monitor> at line 46 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    Last edited by Miguel_80; January 17, 2015 at 01:24 PM.

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

    Default Re: Script for annexing a faction by marriage ties

    Code:
    monitor_event FactionTurnStart FactionType sicily
      and IsCrusadeTargetFaction
      
      log always monitor 1
      
    end_monitor
    
    monitor_event FactionTurnStart FactionType sicily
      and not IsCrusadeTargetFaction
      
      log always monitor 2
      
    end_monitor
    Playing england, end turn...

    Code:
    12:53:45.375 [game.script] [always] monitor 2
    Now I call a crusade against sicily (which is accepted) and end turn...

    Code:
    12:54:49.953 [game.script] [error] Script execution error for <monitor_event>, at line 41, in mods/Third_Age_32_Dcila/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <target_faction> is unavailable from event <FactionTurnStart>
    when testing <IsCrusadeTargetFaction> condition
    12:54:49.953 [game.script] [error] Script execution error for <monitor_event>, at line 48, in mods/Third_Age_32_Dcila/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <target_faction> is unavailable from event <FactionTurnStart>
    when testing <IsCrusadeTargetFaction> condition
    So it all depends on whether there's a crusade in progress at the time.

    Crusade=NO: monitor 2 executed but monitor 1 did not.
    Crusade=YES: both monitors broke and did not execute.

    So it appears to be working 'correctly' when there's no crusade and I have no idea why it doesn't break in that case. Nevertheless, the fact remains that IsCrusadeTargetFaction needs an event that exports target_faction otherwise it simply won't work when there is a crusade in progress.

  19. #19

    Default Re: Script for annexing a faction by marriage ties

    Ok Withwnar. Strange case...

  20. #20

    Default Re: Script for annexing a faction by marriage ties

    Does this work both ways? like say i marry my princess to their heir instead of marrying their princess to my heir.

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
  •