Results 1 to 8 of 8

Thread: Event showing the unification of Italy under the rule of the Byzantines

  1. #1
    Clanish's Avatar Libertus
    Join Date
    Sep 2011
    Location
    the most beautiful country of the wourld
    Posts
    58

    Default Event showing the unification of Italy under the rule of the Byzantines

    Hello to all, i would ask the favor to who can help me in creating a event that pops up when the byzantines conquer all italy, a kind of unification of the roman empire....like in barbarian invasion.Can someone show me how can this be possible?I have litle experience in moding and canīt do any kind of scripting.I hope someone can help me.Salutations to all
    Last edited by Clanish; June 15, 2017 at 12:37 PM.

  2. #2

    Default Re: Event showing the unification of Italy under the rule of the Byzantines

    Do you mean just a notification message? If so, that's pretty easy.

    Code:
        monitor_event FactionTurnStart FactionType byzantium
            if I_IsFactionAIControlled byzantium
                terminate_monitor
            end_if  
            if I_SettlementOwner sett_nnn = byzantium		
                and I_SettlementOwner sett_nnn = byzantium	
                and I_SettlementOwner sett_nnn = byzantium	
                and I_SettlementOwner sett_nnn = byzantium
                ; repeat for all the provinces in Italy			
                set_event_counter ecRoman_Reunification 1
                historic_event HE_ROMAN_REUNIFICATION factions { byzantium, }
                terminate_monitor
            end_if
        end_monitor
    That's your base script, you need to edit sett_nnn to whatever the actual data names are for the settlements in Italy.

    You also need to edit the historic_events.txt, adding an entry with your text.

    I put in an event_counter called ec_Roman_Reunification, which you might want to use for varying recruitment, such as making particular units available in Italy when it's been restored to the Roman Empire.
    Last edited by QuintusSertorius; June 16, 2017 at 06:56 AM.

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

    Default Re: Event showing the unification of Italy under the rule of the Byzantines

    Beaten to the punch while writing this...

    campaign_script.txt:

    Code:
    monitor_event GeneralCaptureSettlement FactionType byzantium
      
      if I_IsFactionAIControlled byzantium
        terminate_monitor
      end_if  
      if I_EventCounter byz_owns_italy > 0
        terminate_monitor
      end_if
      
      campaign_wait 0.1  ;allow time for ownership to change  
      inc_event_counter test_byz_owns_italy_now 1  
      
    end_monitor
    
    monitor_event GiveSettlement TargetFactionType byzantium
      
      if I_IsFactionAIControlled byzantium
        terminate_monitor
      end_if 
      if I_EventCounter byz_owns_italy > 0
        terminate_monitor
      end_if
      
      inc_event_counter test_byz_owns_italy_now 1  
      
    end_monitor
    
    monitor_event FactionTurnStart FactionType byzantium
      
      if I_IsFactionAIControlled byzantium
        terminate_monitor
      end_if 
      if I_EventCounter byz_owns_italy > 0
        terminate_monitor
      end_if
      
      inc_event_counter test_byz_owns_italy_now 1  
      
    end_monitor
    
    monitor_event EventCounter EventCounterType test_byz_owns_italy_now
    
      if I_SettlementOwner Rome byzantium
        and I_SettlementOwner Palermo byzantium
        and I_SettlementOwner Naples byzantium
        and I_SettlementOwner Florence byzantium
        and I_SettlementOwner Bologna byzantium
        and I_SettlementOwner Genoa byzantium
        and I_SettlementOwner Milan byzantium
        and I_SettlementOwner Venice byzantium
        
        historic_event byz_owns_italy factions { byzantium, }
      end_if
        
    end_monitor
    ...at the end, before these lines:

    Code:
            ; keep script unfinised until last monitor termination
    	wait_monitors
    
    end_script
    You'll see a message when byzantium owns all of the settlements listed in the fourth monitor - only the first time they do, not if they later lose some and get them back again. Allows for ownership via capture and diplomacy-give-region, plus a check every turn in case those two don't cover everything (e.g. bribery?).

    Only if the player is byzantium. If you want to see the message also when AI is byzantium then remove the red and blue bits. If, in HotSeat, you want all player factions to see it when byzantium is a player then remove the blue bit.


    historic_events.txt - add these lines anywhere:

    Code:
    {BYZ_OWNS_ITALY_TITLE}Byzantium Owns Italy
    {BYZ_OWNS_ITALY_BODY}Say what you want here...
    Create a picture for the message if you like: data\ui\southern_european\eventpics\byz_owns_italy.tga

    If this is for the base campaign game, not a mod, then you'll need to unpack the game etc. first. There are tutorials around about that.

    Not save game compatible. Script changes never are.

    Quote Originally Posted by QuintusSertorius View Post
    I put in an event_counter called ec_Roman_Reunification, which you might want to use for varying recruitment, such as making particular units available in Italy when it's been restored to the Roman Empire.
    historic_event also creates and increments an event counter of the same name as its message. The HE_ROMAN_REUNIFICATION event counter could be used wherever ec_Roman_Reunification is, so ec_Roman_Reunification isn't needed.

  4. #4

    Default Re: Event showing the unification of Italy under the rule of the Byzantines

    Quote Originally Posted by Withwnar View Post
    historic_event also creates and increments an event counter of the same name as its message. The HE_ROMAN_REUNIFICATION event counter could be used wherever ec_Roman_Reunification is, so ec_Roman_Reunification isn't needed.
    It does, but I prefer to keep event_counters and historic_events separate; it avoids confusion and errors that may arise.

  5. #5
    Clanish's Avatar Libertus
    Join Date
    Sep 2011
    Location
    the most beautiful country of the wourld
    Posts
    58

    Default Re: Event showing the unification of Italy under the rule of the Byzantines

    Thatīs what i want guys, many thanks to you both for this favor and for sharing your knowledge with me.

  6. #6
    Clanish's Avatar Libertus
    Join Date
    Sep 2011
    Location
    the most beautiful country of the wourld
    Posts
    58

    Default Re: Event showing the unification of Italy under the rule of the Byzantines

    Hello my friends, first i would like to thank once again your help, i used the QuintosSertorius script because the less dificult to insert, altough i thak to withwnar help, but his script gave me a error and the scrip couldnīt be created, the QuintosSertorius script created the script file but....

    12:52:07.104 [system.rpt] [always] CPU: SSE2
    12:52:07.104 [system.rpt] [always] ==== system log start, build date: Jun 25 2007 version bld-medieval2-update2.1-30 (43169) ===
    12:52:07.120 [system.io] [always] mounted pack packs/data_0.pack
    12:52:07.120 [system.io] [always] mounted pack packs/data_1.pack
    12:52:07.120 [system.io] [always] mounted pack packs/data_2.pack
    12:52:07.120 [system.io] [always] mounted pack packs/data_3.pack
    12:52:07.120 [system.io] [always] mounted pack packs/data_4.pack
    12:52:07.120 [system.io] [always] mounted pack packs/localized.pack
    12:53:12.946 [game.script] [error] Condition parsing error in data/world/maps/campaign/imperial_campaign/campaign_script.txt, at line 789, column 12
    Condition parser doesn't recognise this token: I_IsFactionAIControlled
    12:58:27.561 [game.script] [error] Condition parsing error in data/world/maps/campaign/imperial_campaign/campaign_script.txt, at line 789, column 12
    Condition parser doesn't recognise this token: I_IsFactionAIControlled



    this was my script:

    monitor_event FactionTurnStart FactionType byzantium
    if I_IsFactionAIControlled byzantium
    terminate_monitor
    end_if
    if I_SettlementOwner Palermo = byzantium
    and I_SettlementOwner Naples = byzantium
    and I_SettlementOwner Florence = Byzantium
    and I_SettlementOwner Bologna = byzantium
    and I_SettlementOwner Genoa = byzantium
    and I_SettlementOwner Milan = byzantium
    and I_SettlementOwner Venice = byzantium
    ; repeat for all the provinces in Italy
    set_event_counter ecRoman_Reunification 1
    historic_event HE_ROMAN_REUNIFICATION factions { byzantium, }
    terminate_monitor
    end_if
    end_monitor

    Did i done something wrong?Can you help me to solve this.The scrip will work like that?I donīt know if can help but this is for vanilla campaign.Many thanks for the help guys.

  7. #7
    AntonisTheGreek's Avatar Senator
    Join Date
    Dec 2013
    Location
    Athens, Greece
    Posts
    1,394

    Default Re: Event showing the unification of Italy under the rule of the Byzantines

    For some reason the condition I_IsFactionAIControlled is not recognised,according to the log.Try replacing the line if I_IsFactionAIControlled byzantium with this:

    if not I_LocalFaction byzantium

    Edit:According to the Docudemons the I_IsFactionAIControlled condition is usable only in Kingdoms,not vanilla.That's why it didn't get recognised.
    Last edited by AntonisTheGreek; June 20, 2017 at 03:13 PM.

  8. #8

    Default Re: Event showing the unification of Italy under the rule of the Byzantines

    I_LocalFaction isn't Hotseat compatible.

    Are you not playing with Kingdoms?

Posting Permissions

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