Results 1 to 3 of 3

Thread: Barons Alliance

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Civis
    Join Date
    Mar 2008
    Location
    Vienna, Austria
    Posts
    134

    Default Barons Alliance

    Hi, i thought about including the "Barons Alliance" - feature in my modding project. Major rebel factions for Byzantine Empire and HRE.

    Could someone tell me which files need to be changed to get that game mechanic working?

    By the way:
    Does anybody know, how to decrease the loyalty of generals/family members manually, to make rebellions more often happen?

  2. #2
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Barons Alliance

    This is the entry in the campaign_script.txt from the Brittania campaign about the Baron's Alliance:

    Code:
    ;------------------- BARONS ALLIANCE -------------------;
    	
    	;setup related event counters
    	monitor_event FactionTurnStart FactionType england
    		
    		add_events
    			event	counter ba_last_spawn_timer
    	 		date	0
    	 	end_add_events
    	
    		terminate_monitor
    		
    	end_monitor
    	
    	;inc time since the barons alliance last spawned timer
    	monitor_event FactionTurnStart FactionType england
    	
    		inc_event_counter ba_last_spawn_timer 1
    	
    	end_monitor
    	
    	;initial spawning
    	
    	;first first spawn opportunity (lead by de_Montfort if spawned at this point in time)
    	monitor_event FactionTurnEnd FactionType england
    		and I_CompareCounter ba_first_emergence = 0
    		and I_TurnNumber > 8
    		and I_TurnNumber < 35
    		
    		;randomise to determine if this check should be made this turn
    		
    		faction_emerge barons_alliance england 6 60.0 155.0 0.9 town false simon1 Simon de_Montfort 42
    		
    		if I_NumberOfSettlements barons_alliance > 0
    			set_counter ba_first_emergence 1
    			set_event_counter ba_last_spawn_timer 0
    			historic_event barons_emerge_montfort
    		end_if	
    		
    	end_monitor
    	
    	;second first spawn opportunity
    	monitor_event FactionTurnEnd FactionType england
    		and I_CompareCounter ba_first_emergence = 0
    		and I_TurnNumber > 50
    		and I_TurnNumber < 70
    		
    		faction_emerge barons_alliance england 6 60.0 140.0 0.9 town false
    		
    		if I_NumberOfSettlements barons_alliance > 0
    			set_counter ba_first_emergence 1
    			set_event_counter ba_last_spawn_timer 0
    			historic_event barons_emerge_generic
    		end_if	
    		
    	end_monitor
    	
    	;third first spawn opportunity
    	monitor_event FactionTurnEnd FactionType england
    		and I_CompareCounter ba_first_emergence = 0
    		and I_TurnNumber > 90
    		and I_TurnNumber < 110
    		
    		faction_emerge barons_alliance england 6 60.0 140.0 0.9 town false
    		
    		if I_NumberOfSettlements barons_alliance > 0
    			set_counter ba_first_emergence 1
    			set_event_counter ba_last_spawn_timer 0
    			historic_event barons_emerge_generic
    		end_if	
    		
    	end_monitor
    	
    	;final first spawn opportunity
    	monitor_event FactionTurnEnd I_CompareCounter ba_first_emergence = 0
    		and I_TurnNumber > 130
    		and I_TurnNumber < 150
    		
    		faction_emerge barons_alliance england 6 60.0 140.0 0.9 town false
    		
    		if I_NumberOfSettlements barons_alliance > 0
    			set_counter ba_first_emergence 1
    			set_event_counter ba_last_spawn_timer 0
    			historic_event barons_emerge_generic
    		end_if	
    		
    	end_monitor
    	
    	;subsequent spawn conditions
    	
    	;check when England gets a new faction leader
    	monitor_event BecomesFactionLeader FactionType england
    		and I_NumberOfSettlements england > 15
    		and I_CompareCounter ba_first_emergence = 1
    		and I_NumberOfSettlements barons_alliance = 0
    		and I_EventCounter ba_last_spawn_timer > 10
    		
    		faction_emerge barons_alliance england 6 70.0 140.0 0.85 town false
    		
    		if I_NumberOfSettlements barons_alliance > 0
    			set_event_counter ba_last_spawn_timer 0
    			historic_event barons_reemerge_new_king
    			add_money barons_alliance 10000
    		end_if	
    		
    	end_monitor
    	
    	;check when English leaders authority is low
    	monitor_event FactionTurnEnd FactionType england
    		and I_NumberOfSettlements england > 15
    		and I_CompareCounter ba_first_emergence = 1
    		and I_NumberOfSettlements barons_alliance = 0
    		and I_EventCounter ba_last_spawn_timer > 10
    		
    		generate_random_counter	authority_value 1 100
    		
    		
    		;the lower the faction leaders authority, the greater the chance of the barons_alliance appearing
    		if I_FactionLeaderAttribute england Authority = 0
    		
    			if I_EventCounter authority_value <= 33
    				faction_emerge barons_alliance england 5 50.0 145.0 0.9 town false
    			end_if
    		
    		end_if
    		
    		if I_FactionLeaderAttribute england Authority = 1
    		
    			if I_EventCounter authority_value <= 25
    				faction_emerge barons_alliance england 6 60.0 135.0 0.9 town false
    			end_if
    		
    		end_if
    		
    		if I_FactionLeaderAttribute england Authority = 2
    		
    			if I_EventCounter authority_value <= 20
    				faction_emerge barons_alliance england 6 65.0 130.0 0.85 town false
    			end_if
    		
    		end_if
    		
    		if I_FactionLeaderAttribute england Authority = 3
    		
    			if I_EventCounter authority_value <= 15
    				faction_emerge barons_alliance england 6 70.0 120.0 0.85 town false
    			end_if
    		
    		end_if
    		
    		if I_FactionLeaderAttribute england Authority = 4
    		
    			if I_EventCounter authority_value <= 10
    				faction_emerge barons_alliance england 6 80.0 120.0 0.85 town false
    			end_if
    		
    		end_if
    		
    		if I_FactionLeaderAttribute england Authority = 5
    		
    			if I_EventCounter authority_value <= 5
    				faction_emerge barons_alliance england 6 85.0 120.0 0.85 town false
    			end_if
    		
    		end_if	
    		
    		if I_NumberOfSettlements barons_alliance > 0
    			set_event_counter ba_last_spawn_timer 0
    			historic_event barons_reemerge_poor_king
    			add_money barons_alliance 10000
    		end_if	
    		
    	end_monitor
    You'll probably have to make some changes to other files and to the script itself for it to work, but it should indicate where to look to make those changes.

    As for the loyalty, it depends on what you mean by manually. You can't do it from the campaign map while in a game, unless you make some accept/decline scripts that trigger on specific instances, but I wouldn't see the point. If you want all generals to be disloyal just create 100% chance traits which give negative bonuses to loyalty. There's also a trait called "LoyaltyStarter" that can be removed along with the triggers, which grants all generals at the least 3 loyalty when they are created. There might be an xml file that governs this but those mainly pertain to AI.

    Cheers,
    Augustus

  3. #3
    Civis
    Join Date
    Mar 2008
    Location
    Vienna, Austria
    Posts
    134

    Default Re: Barons Alliance

    Many thanks !

    The trait idea is great, that`s exactly what i`ve searched for.

Posting Permissions

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