Results 1 to 9 of 9

Thread: FactionWarDeclared - When is it acutally triggered?

  1. #1
    Aneirin's Avatar of flowing verse
    Join Date
    Nov 2012
    Location
    Gododdin
    Posts
    2,734

    Default FactionWarDeclared - When is it acutally triggered?

    Hey there,

    it's been a while and I am bit rusty.

    I was wondering if the monitor below will be triggered during the players turn?
    Or will it only be triggered when the Papal States declare war on France during the players turn?

    Code:
        monitor_event FactionWarDeclared FactionType papal_states
            and TargetFactionType france
            and I_CompareCounter papal_states_counter < 1 ;has there already been an job offer to a faction
            and I_CompareCounter contract_urbino < 1 ;has the contractor faction already signed up for a contract
            and I_CompareCounter papal_states_contract < 1 ;has contract faction already a contract with another faction 
            and DiplomaticStanceFromFaction urbino < Suspicious
    
            generate_random_counter random_contract 1 3
    
            if I_EventCounter random_contract < 2
            and I_CompareCounter war_con_papal_states_france = 0
             
                    historic_event condotta_papal_states_france true factions { urbino, }
    
                set_counter war_con_papal_states_france 1
            end_if
    
        end_monitor
    If you guys could give me a hint, would be great!

    Best
    Aneirin
    Proud son of Aikanár and brother of Iskar

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

    Default Re: FactionWarDeclared - When is it acutally triggered?

    I presume that FactionWarDeclared fires at the time that somebody actually does the declaring. So this would never be during the player's turn except when it's the player doing the declaring.

    In your example it would be during the papal_states turn. But you won't see the historic_event until your turn, as you never do. And it's possible that by then those two factions have since declared peace - unlikely I'd say, outside of other scripted stance stuff.

  3. #3
    Aneirin's Avatar of flowing verse
    Join Date
    Nov 2012
    Location
    Gododdin
    Posts
    2,734

    Default Re: FactionWarDeclared - When is it acutally triggered?

    I see, thanks for the clarification. It seems, I have to find another way to check if a faction has declared war during the AI’s turn.
    Proud son of Aikanár and brother of Iskar

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

    Default Re: FactionWarDeclared - When is it acutally triggered?

    Do you mean checking in the player's turn whether two AI factions went to war during the turn end?

  5. #5
    Aneirin's Avatar of flowing verse
    Join Date
    Nov 2012
    Location
    Gododdin
    Posts
    2,734

    Default Re: FactionWarDeclared - When is it acutally triggered?

    Exactly
    Proud son of Aikanár and brother of Iskar

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

    Default Re: FactionWarDeclared - When is it acutally triggered?

    There is this: http://www.twcenter.net/forums/showt...en-you-need-it e.g. Spawn a character of papal_states and use him (is faction) in a {DiplomaticStanceFromFaction france = AtWar} condition. It won't tell you who started that war though, if that matters.

    But it might be overkill for what you want. How likely is that those two factions would go to war and then ceasefire in the same turn end? Not very, I'd wager.

  7. #7
    Aneirin's Avatar of flowing verse
    Join Date
    Nov 2012
    Location
    Gododdin
    Posts
    2,734

    Default Re: FactionWarDeclared - When is it acutally triggered?

    That would be very unlikely...
    Thank's, I'll certainly have a look at it!
    Proud son of Aikanár and brother of Iskar

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

    Default Re: FactionWarDeclared - When is it acutally triggered?

    An ideal approach would be to use FactionWarDeclared to indicate that a war has happened, then, in the player's turn before doing anything with that bit of news, use that spawned character trick to confirm that they are still at war. As opposed to doing the spawned character trick every turn looking to see if a war has started.

    But yeah, 99.9% of the time your OP's script would be fine, so maybe not worth the extra hassle?

  9. #9
    Aneirin's Avatar of flowing verse
    Join Date
    Nov 2012
    Location
    Gododdin
    Posts
    2,734

    Default Re: FactionWarDeclared - When is it acutally triggered?

    I use that approach in my mercenary script, but without the character spawning trick and it performed about 90% of the time.

    I had a look at your script and it seems a bit too overpowered to go the extra mile with spawning the character.
    Also I realized due to the structure of my mod in terms of scripted events, there are several occasions on which the trigger would be fired. (Quite some hassle in Renaissance Italy )
    So I guess, I'll stick to the solution which I have used in my mercenary script. Nevertheless many thank's for your clarification
    Proud son of Aikanár and brother of Iskar

Posting Permissions

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