Results 1 to 6 of 6

Thread: Script to hold alliance

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    JuL14n's Avatar Centenarius
    Join Date
    Apr 2009
    Location
    Finland
    Posts
    830

    Icon5 Script to hold alliance

    It's a while ago since last time I scripted.

    I need a script that holds the alliance between 2 factions when both are AI
    and if one of the factions is player controlled, the player should be able to break the alliance,
    but not the AI, and when the player attacks the AI faction a counter will increase from 0 to 1
    and the script will be "broken" until a new alliance has lasted for
    a random amount of turns, then the counter will go back to 0 again and the script will be active.

    1. Is it possible to create such a script?

    2. Is it possible to make two factions have good relation or an unbreakable alliance?

    3. And the commands and conditions for such a script?


    Any help appreciated.

  2. #2

    Icon1 Re: Script to hold alliance

    Maybe this:

    Code:
    ;###### France And Scotland Alliance Timer #######
    
    declare_counter Alliance
    
    	monitor_event PreFactionTurnStart FactionIsLocal
    		and I_CompareCounter Alliance = 2
    		and RandomPercent <= 15
    		set_counter Alliance 0
    	end_monitor
    
    ;###### France And Scotland Allied #######
    
    	monitor_event PreFactionTurnStart FactionType france
    		and DiplomaticStanceFromFaction scotland = Allied
    		and I_CompareCounter Alliance = 0
    		set_faction_standing france scotland 1.0
    	end_monitor
    
    	monitor_event PreFactionTurnStart FactionType scotland
    		and DiplomaticStanceFromFaction france = Allied
    		and I_CompareCounter Alliance = 0
    		set_faction_standing scotland france 1.0
    	end_monitor
    
    ;###### France And Scotland Break Alliance #######
    
    	monitor_event FactionBreakAlliance FactionType france
    		and TargetFactionType scotland
    		and I_CompareCounter Alliance = 0
    		set_counter Alliance 1
    	end_monitor
    
    	monitor_event FactionBreakAlliance FactionType scotland
    		and TargetFactionType france
    		and I_CompareCounter Alliance = 0
    		set_counter Alliance 1
    	end_monitor
    
    ;###### France And Scotland Declared Alliance #######
    
    	monitor_event FactionAllianceDeclared FactionType france
    		and TargetFactionType scotland
    		and I_CompareCounter Alliance = 1
    		set_counter Alliance 2
    	end_monitor
    
    	monitor_event FactionAllianceDeclared FactionType scotland
    		and TargetFactionType france
    		and I_CompareCounter Alliance = 1
    		set_counter Alliance 2
    	end_monitor

  3. #3
    JuL14n's Avatar Centenarius
    Join Date
    Apr 2009
    Location
    Finland
    Posts
    830

    Default Re: Script to hold alliance

    Everything I need! Thanks a lot!

    rep+

  4. #4
    alhoon's Avatar Comes Rei Militaris
    Join Date
    Apr 2008
    Location
    Chania, Greece
    Posts
    24,233

    Default Re: Script to hold alliance

    Or you could just use Lusted's campaign AI. The AI never attacls an ally in that.

    So if some factions start allied from the strat, then they remain allied.
    alhoon is not a member of the infamous Hoons: a (fictional) nazi-sympathizer KKK clan. Of course, no Hoon would openly admit affiliation to the uninitiated.
    "Angry Uncle Gordon" describes me well.
    _______________________________________________________
    Beta-tester for Darthmod Empire, the default modification for Empire Total War that does not ask for your money behind patreon.
    Developer of Causa Belli submod for Darthmod, headed by Hammeredalways and a ton of other people.
    Developer of LtC: Random maps submod for Lands to Conquer (that brings a multitude of random maps and other features).

  5. #5
    JuL14n's Avatar Centenarius
    Join Date
    Apr 2009
    Location
    Finland
    Posts
    830

    Default Re: Script to hold alliance

    Quote Originally Posted by alhoon View Post
    Or you could just use Lusted's campaign AI. The AI never attacls an ally in that.

    So if some factions start allied from the strat, then they remain allied.
    Thanks for the suggestion, but I needed this through a more manipulative format that's why I came
    for a script.

    LcAI is more about codes and balancing. But anyway, rep+ as I might find it useful.

  6. #6
    Kolwen's Avatar Artifex
    Join Date
    Jul 2010
    Location
    Spain
    Posts
    1,217

    Default Re: Script to hold alliance

    Does this script work?
    The AI ignore it in my mod.
    I've just changed "france" for "byzantium" and "scotland" for "slave"
    and those factions became at war in the first 10 turns.
    Any idea about why is this happening?

Posting Permissions

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