Page 1 of 4 1234 LastLast
Results 1 to 20 of 65

Thread: How to create an emerging faction with Barons Alliance script

  1. #1
    Polpolgio's Avatar Miles
    Join Date
    Jun 2008
    Location
    Barcelona, Europe
    Posts
    362

    Default How to create an emerging faction with Barons Alliance script

    Well, I decided to write this tutorial for create an emerging faction using the Barons Alliance script. First, I must give credit to CeltiberoRamiroI, who helped me with the final step. This tutorial is for any Kingdoms's mod.

    Necessary files


    -Descr_sm_factions (Found in Data)

    -Campaign_script (Found in Data/World/Maps/Campaign/Campaign_name

    -Descr_strat (Found in Data/World/Maps/Campaign/Campaign_name

    Steps

    1) First, we have to decide which faction will emerge and from which other faction will do it. For example, I made emergent Portugal from Galicia (scotland) in Reconquista's mod.

    2) The second step is go to descr_sm_factions and add to the faction that will emerge "Shadowing faction from where will emerge" and to the faction from where the other faction will emerge "Shadowed_by faction who will emerge" near the faction name. In my case is:

    Code:
    faction                        scotland, shadowed_by portugal
    culture                        southern_european
    religion                    catholic
    symbol                        models_strat/symbol_scotland.CAS
    rebel_symbol                    models_strat/symbol_rebels.CAS
    primary_colour                    red 39, green 118, blue 216
    secondary_colour                red 243, green 219, blue 13
    loading_logo                    loading_screen/symbols/symbol128_scotland.tga
    standard_index                    6
    logo_index                    FACTION_LOGO_SCOTLAND
    small_logo_index                SMALL_FACTION_LOGO_SCOTLAND
    triumph_value                    5
    custom_battle_availability            yes
    can_sap                        yes
    prefers_naval_invasions                yes
    can_have_princess                yes
    has_family_tree                    yes
    And for Portugal, faction who will emerge:

    Code:
    faction                        portugal, shadowing scotland
    culture                        southern_european
    religion                    catholic
    symbol                        models_strat/symbol_portugal.CAS
    rebel_symbol                    models_strat/symbol_rebels.CAS
    primary_colour                    red 255, green 255, blue 255
    secondary_colour                red 0, green 0, blue 255
    loading_logo                    loading_screen/symbols/symbol128_portugal.tga
    standard_index                    13
    logo_index                    FACTION_LOGO_PORTUGAL
    small_logo_index                SMALL_FACTION_LOGO_PORTUGAL
    triumph_value                    5
    custom_battle_availability            yes
    can_sap                        yes
    prefers_naval_invasions                yes
    can_have_princess                yes
    has_family_tree                    yes
    Warning: The factions should have a same culture and units in common (as a minim the bodyguard type).

    3) Once done that, we will add an entry in descr_strat to the faction who will emerge:

    Code:
    faction    portugal, balanced smith
    ai_label    catholic
    dead_until_emerged
    re_emergent
    denari    15000
    denari_kings_purse    3000
    We must add some units to new faction too, then we must add units to the faction from where the new faction will emerge generals, and quite disloyals, in my case, to scotland (Galicia):

    Code:
    character    John, named character, male, age 27, x 83, y 169
    traits GoodRiskyAttacker 1 , NaturalMilitarySkill 1 , GoodCommander 1 , BattleDread 2 , StrategyDread 1 , LoyaltyStarter 1
    army
    unit        SE Bodyguard                exp 0 armour 0 weapon_lvl 0
    unit        Town Militia                exp 0 armour 0 weapon_lvl 0
    unit        Town Militia                exp 0 armour 0 weapon_lvl 0
    
    character    George, named character, label portugal1, male, age 25, x 70, y 165
    traits GoodRiskyAttacker 1 , BattleDread 2 , StrategyDread 1 , LoyaltyStarter 1
    army
    unit        SE Bodyguard                exp 0 armour 0 weapon_lvl 0
    unit        Town Militia                exp 0 armour 0 weapon_lvl 0
    unit        Town Militia                exp 0 armour 0 weapon_lvl 0
    unit        Town Militia                exp 0 armour 0 weapon_lvl 0
    unit        Town Militia                exp 0 armour 0 weapon_lvl 0
    The generals are governors of the regions of Porto and Viseu.

    4) We have to go now to campaign_script. The original script from Britannias campaign says this:

    Code:
     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
    I summed it up and changed the names, England by Scotland and Barons_alliance by Portugal, so:

    Code:
    declare_counter portugal_emerge
    
       monitor_event and I_TurnNumber > 1
          and I_TurnNumber < 5
          and I_CompareCounter portugal_emerge == 0
          
          faction_emerge portugal scotland 4 80.0 120.0 0.85 town false 
          
          if I_NumberOfSettlements portugal > 0
             add_money portugal 10000
             set_counter portugal_emerge 1
          end_if    
          
         historic_event portugal_emerges 
          
       end_monitor
       
          ;check when English leaders authority is low
       monitor_event FactionTurnEnd FactionType scotland
          and I_NumberOfSettlements scotland > 2
          and I_NumberOfSettlements portugal = 0
          
          generate_random_counter   authority_value 1 100
          
                ;the lower the faction leaders authority, the greater the chance of the portugal appearing
          if I_FactionLeaderAttribute scotland Authority = 0
          
             if I_EventCounter authority_value <= 33
          faction_emerge portugal scotland 4 80.0 120.0 0.85 town false
             end_if
          
          end_if
          
          if I_FactionLeaderAttribute scotland Authority = 1
          
             if I_EventCounter authority_value <= 25
          faction_emerge portugal scotland 4 100.0 120.0 0.85 town false
             end_if
          
          end_if
          
          if I_FactionLeaderAttribute scotland Authority = 2
          
             if I_EventCounter authority_value <= 20
          faction_emerge portugal scotland 4 100.0 120.0 0.85 town false
             end_if
          
          end_if
          
          if I_FactionLeaderAttribute scotland Authority = 3
          
             if I_EventCounter authority_value <= 15
          faction_emerge portugal scotland 4 90.0 120.0 0.85 town false
             end_if
          
          end_if
          
          if I_FactionLeaderAttribute scotland Authority = 4
          
             if I_EventCounter authority_value <= 10
          faction_emerge portugal scotland 4 90.0 120.0 0.85 town false
             end_if
          
          end_if
          
          if I_FactionLeaderAttribute scotland Authority = 5
          
             if I_EventCounter authority_value <= 5
          faction_emerge portugal scotland 4 80.0 120.0 0.85 town false
             end_if
          
          end_if 
          
       end_monitor
    Portugal will emerge between the turn 1 and 5, and the script valores the authority of every general and according with it, gives different parameters to the future emergence (is it said like this?):

    Code:
    if I_FactionLeaderAttribute scotland Authority = 4
          
             if I_EventCounter authority_value <= 10
          faction_emerge portugal scotland 4 90.0 120.0 0.85 town false
             end_if
    If the leader authority is equal to 4, Portugal will emerge with the following parameters:

    Code:
    faction_emerge portugal scotland 4 90.0 120.0 0.85 town false
    And they mean:

    emerging_faction: portugal
    target_faction: scotland
    min_num_remain: 4 (Min of settlements that must keep the faction from where the emerging faction will emerge).
    max_order_threshold: 90 (Maximum of public order allowed for the regions where will emerge the new faction, if the public order is more that 70 in this case, the faction will not emerge).
    max_order_threshold_surrounding: 120 (The maximum order of the neightbour regions can't be larger than 120 for acheive the emerge).
    max_order_dropoff: 0.85 (I don't know its meaning yet)
    min_level_threshold: town (Minim level of the settlements where can emerge the new faction).
    fire_emerge_message: false
    leader_script_label: not used (optional)
    leader_name: not used (optional)
    leader_age: not used (optional)

    (Thanks to CeltiberoRamiroI for his gelp giving me the meaning of the numbers).

    Here, Porto region before the emerge:




    Now, after Portugal has emerged:




    I hope you liked this tutorial.

  2. #2
    Polpolgio's Avatar Miles
    Join Date
    Jun 2008
    Location
    Barcelona, Europe
    Posts
    362

    Default Re: How to create an emerging faction with Barons Alliance script

    I haven't seen anybody interested in this yet. Has anybody tried it? Does the script work correctly in your games?

  3. #3

    Default Re: How to create an emerging faction with Barons Alliance script

    nice tuto nice and simple i havent tried it because i havent needed too

  4. #4

    Default Re: How to create an emerging faction with Barons Alliance script

    great +rep
    very usefull for me
    Under the patronage of Nakharar
    DM Multi modding project

  5. #5
    Polpolgio's Avatar Miles
    Join Date
    Jun 2008
    Location
    Barcelona, Europe
    Posts
    362

    Default Re: How to create an emerging faction with Barons Alliance script

    Thank you very much, Nakharar and Master Zuma. Is a good script but not always the emergent factions appears where we want it to appear, nor when we want it to appear, but almost always should appear as we want, I think, giving the most suitable conditions and parameters.

  6. #6
    Polpolgio's Avatar Miles
    Join Date
    Jun 2008
    Location
    Barcelona, Europe
    Posts
    362

    Default Re: How to create an emerging faction with Barons Alliance script

    Just a question, did anybody try this?

  7. #7
    Opifex
    Join Date
    Feb 2005
    Location
    New York, USA
    Posts
    15,154

    Default Re: How to create an emerging faction with Barons Alliance script

    Excellent tutorial! I'll +rep for this because emergent-faction experts aren't very numerous.

    Question, what do you think "re_emergent" in descr_strat.txt does? Perhaps that if you defeat Portugal they may still continue to reappear at some time in the future?


    "If ye love wealth greater than liberty,
    the tranquility of servitude greater than
    the animating contest for freedom, go
    home from us in peace. We seek not
    your counsel, nor your arms. Crouch
    down and lick the hand that feeds you,
    and may posterity forget that ye were
    our countrymen."
    -Samuel Adams

  8. #8

    Default Re: How to create an emerging faction with Barons Alliance script

    i think it requires shadow factions...

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

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

    Default Re: How to create an emerging faction with Barons Alliance script

    Quote Originally Posted by SigniferOne View Post
    Excellent tutorial! I'll +rep for this because emergent-faction experts aren't very numerous.

    Question, what do you think "re_emergent" in descr_strat.txt does? Perhaps that if you defeat Portugal they may still continue to reappear at some time in the future?
    Consider that the Western_Roman_Rebels and Eastern_Roman_Rebels in BI both used the re_emerge parameter. As such, it's a way of telling the game that this faction is directly connected to another faction(this association is determined by the shadow bits in the sm_factions). So if any province of Portugal revolts in this example, there's a % chance (could be 100, could be partial, no clue where it's listed) that the shadow faction gets the province. This was the way it was handled in BI and M2. Kingdoms provides the new faction_emerge condition. Whether or not that deprecates the previous usage, combines with it, or requires it I'm not sure, but they were made on top of each other.

    And good tutorial Polpolgio, not a fan of the eventless monitor in one of the scripts, since it seems like it would infinitely loop until terminated, but otherwise nice job.

  10. #10
    Nevada's Avatar Domesticus
    Join Date
    Jun 2007
    Location
    Bavaria
    Posts
    2,197

    Default Re: How to create an emerging faction with Barons Alliance script

    Is it also possible with factions that don't have the same units?



  11. #11
    Polpolgio's Avatar Miles
    Join Date
    Jun 2008
    Location
    Barcelona, Europe
    Posts
    362

    Default Re: How to create an emerging faction with Barons Alliance script

    Quote Originally Posted by Nevada View Post
    Is it also possible with factions that don't have the same units?
    Of course, but I think they must have as a minim one unit type in common, for example Town Militia.

  12. #12
    Nevada's Avatar Domesticus
    Join Date
    Jun 2007
    Location
    Bavaria
    Posts
    2,197

    Default Re: How to create an emerging faction with Barons Alliance script

    Ok, thanks.



  13. #13
    Darkstar's Avatar Senator
    Join Date
    Feb 2007
    Location
    Massachusetts, USA
    Posts
    1,032

    Default Re: How to create an emerging faction with Barons Alliance script

    Is it possible to give the emergent faction a specific settlement?

  14. #14
    Userpro's Avatar =RAE= HostedMod Creator
    Join Date
    Jul 2008
    Location
    regno germanicum, teutonical forest
    Posts
    1,673

    Default Re: How to create an emerging faction with Barons Alliance script

    max_order_threshold: 90 (Maximum of public order allowed for the regions where will emerge the new faction, if the public order is more that 70 in this case, the faction will not emerge).
    Hey Polpolgio, it is possible you've made an explanation error with the red marked numbers? Or have i missed something?
    Visit our TWC M2TW-Kingdoms Hosted Mods Forum for...

    !!! RAE Development stopped --- read last Statement here !!!
    M2TW-Kingdoms Mod Creator REDEO AD EXORDIUM ( RAE )
    Progress: 95% internal final beta release - 85% official release
    RAE TWC-Wiki Eagle Standard interview ... RAE.net Homepage ... RAE TWZ-Germany
    Proudly Sega & Steam Boycotter since ETW! See why here or this petition
    Sorry for bad english here, there and in my tutorials > advanced horde invasion & hide/unhide stratmap-ui & Beginners modding



  15. #15
    Polpolgio's Avatar Miles
    Join Date
    Jun 2008
    Location
    Barcelona, Europe
    Posts
    362

    Default Re: How to create an emerging faction with Barons Alliance script

    I don't remember what whas I thinking in when I wrote the explanation, but anywhat, it seems that I wrote 70 instead of 90 again...

  16. #16
    IZob's Avatar Citizen
    Join Date
    Aug 2009
    Location
    Australia
    Posts
    9,829

    Default Re: How to create an emerging faction with Barons Alliance script

    Darkstar was asking a simular question. But is it possiable to have a faction emerge inside a settlement? And say its possiable, would then the previous owner go to war against this emerging faction (since they did just lose their base to them).

    Also fogive me if I didnt see it in your posts, but can a emerging factions be triggered on a specific date/turn? or would it be more prudent to trigger the emerging faction on a revolting settlement. Deppends on what im going for here i guess, but i'd like the flexability to choose the triggering event.
    Contact me on Steam: steamcommunity.com/id/IZob/ or send a PM.

  17. #17
    Polpolgio's Avatar Miles
    Join Date
    Jun 2008
    Location
    Barcelona, Europe
    Posts
    362

    Default Re: How to create an emerging faction with Barons Alliance script

    Well, I'm pretty sure that it's not possible... Anyway, you could make from the start some regions more propicious to have revolts/riots in them, so they will easily make emerge the barons script emerging faction.

    And about make emerge a faction in a specific date/turn with this script is possible, but not in exactly the same turn as you want it to emerge, just after/before a specific turn with some other specific conditions that you can choose. Anyway, I didn't experiment too much with this script, but I acheived make Portugal emerge from Galicia.

  18. #18
    IZob's Avatar Citizen
    Join Date
    Aug 2009
    Location
    Australia
    Posts
    9,829

    Default Re: How to create an emerging faction with Barons Alliance script

    Ok thankyou for responding

    But one final question. Since if I wanted to make the settlement revolt so that the faction could emerge would you recommend that the settlement has revolted because of religious unrest. The religion being the same as the emerging faction? That way the emerging faction will be easily able to take the settlement because both the faction and settlement will have the same religion?

    Oh and another question sorry: Is it possible to set the settlements 'creator' to the emerging faction? That way (I assume) the emerging faction will push itself to capture their rightfully settlements.
    Last edited by IZob; December 03, 2009 at 04:39 PM.
    Contact me on Steam: steamcommunity.com/id/IZob/ or send a PM.

  19. #19
    Swagger's Avatar Imperial Coffee-Runner
    Join Date
    Apr 2007
    Location
    Portugal
    Posts
    12,453

    Default Re: How to create an emerging faction with Barons Alliance script

    must be done via script:

    using this:

    console_command provoke_rebellion Rome
    replace replace rome by the city name you want to rebel
    Under the Patronage of the Dreadful cedric37!
    Ancs Guide, Emergent Factions , Yes/No Events |L'Outremer for Modders| Swagger's Skymod


  20. #20
    IZob's Avatar Citizen
    Join Date
    Aug 2009
    Location
    Australia
    Posts
    9,829

    Default Re: How to create an emerging faction with Barons Alliance script

    ah thx swagger. That should deffinatly work.
    Contact me on Steam: steamcommunity.com/id/IZob/ or send a PM.

Page 1 of 4 1234 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
  •