Results 1 to 6 of 6

Thread: ask for checking script

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default ask for checking script

    i would like to add a condition to recruiting some arabian units on the east. The condition should checking if some cities from the east are own of european factions.

    First i've made events checking if eastern cities are own of each of european factions
    it looks like this:
    monitor_conditions not I_SettlementOwner Antioch = poland
    and I_EventCounter holds_antioch == 1
    and I_NumberOfSettlements poland > 0
    set_event_counter holds_antioch 0
    end_monitor

    monitor_conditions I_SettlementOwner Antioch = poland
    and I_EventCounter holds_antioch == 0
    add_events
    event counter holds_antioch
    date 0
    end_add_events
    end_monitor
    Then i would like to add section like this:
    monitor_event PreFactionTurnStart FactionType egypt
    and event_counter holds_antioch 1
    or event_counter holds_tripolii 1
    or event_counter holds_acre 1
    or event_counter holds_jerusalem 1
    or event_counter holds_jaffa 1
    or event_counter holds_ascalon 1
    or event_counter holds_damietta 1
    or event_counter holds_alexandria 1
    or event_counter holds_cairo 1
    or event_counter holds_edessa 1
    set_event_counter kontakt 1
    end_monitor
    monitor_event FactionTurnEnd FactionType byzantium
    and I_EventCounter kontakt == 1
    and not event_counter holds_antioch 1
    or not event_counter holds_tripolii 1
    or not event_counter holds_acre 1
    or not event_counter holds_jerusalem 1
    or not event_counter holds_jaffa 1
    or not event_counter holds_ascalon 1
    or not event_counter holds_damietta 1
    or not event_counter holds_alexandria 1
    or not event_counter holds_cairo 1
    or not event_counter holds_edessa 1
    set_event_counter kontakt 0
    end_monitor
    And the condition in EDU should looks like this:
    recruit_pool "ME Crossbow Militia" 1 0.005 2 0 requires factions { moors, egypt, } and event_counter kontakt 1 and not hidden_resource europa and region_religion islam 70
    What do you think? Does it make what i'm planning?

  2. #2

    Icon1 Re: ask for checking script

    attyla: Because you really only need to know if Egypt or the Moors owns those settlements before they start their turns, I suggest doing this:
    Spoiler Alert, click show to read: 
    Code:
    	monitor_event PreFactionTurnStart FactionType egypt 
      		if I_SettlementOwner Antioch = egypt
       		set_event_counter kontakt 1
    	end_if
     		if I_SettlementOwner Tripolii = egypt
       		set_event_counter kontakt 1
    	end_if
     		if I_SettlementOwner Acre = egypt
       		set_event_counter kontakt 1
    	end_if
     		if I_SettlementOwner Jerusalem = egypt
       		set_event_counter kontakt 1
    	end_if
     		if I_SettlementOwner Jaffa = egypt
       		set_event_counter kontakt 1
    	end_if
     		if I_SettlementOwner Ascalon = egypt
       		set_event_counter kontakt 1
    	end_if
     		if I_SettlementOwner Damietta = egypt
       		set_event_counter kontakt 1
    	end_if
     		if I_SettlementOwner Alexandria = egypt
       		set_event_counter kontakt 1
    	end_if
     		if I_SettlementOwner Cairo = egypt
       		set_event_counter kontakt 1
    	end_if
     		if I_SettlementOwner Edessa = egypt
       		set_event_counter kontakt 1
    	end_if
    	end_monitor
    
    	monitor_event PreFactionTurnStart FactionType egypt 
      		if not I_SettlementOwner Antioch = egypt
       		set_event_counter kontakt 0
    	end_if
      		if not I_SettlementOwner Tripolii = egypt
       		set_event_counter kontakt 0
    	end_if
      		if not I_SettlementOwner Acre = egypt
       		set_event_counter kontakt 0
    	end_if
      		if not I_SettlementOwner Jerusalem = egypt
       		set_event_counter kontakt 0
    	end_if
      		if not I_SettlementOwner Jaffa = egypt
       		set_event_counter kontakt 0
    	end_if
      		if not I_SettlementOwner Ascalon = egypt
       		set_event_counter kontakt 0
    	end_if
      		if not I_SettlementOwner Damietta = egypt
       		set_event_counter kontakt 0
    	end_if
      		if not I_SettlementOwner Alexandria = egypt
       		set_event_counter kontakt 0
    	end_if
      		if not I_SettlementOwner Cairo = egypt
       		set_event_counter kontakt 0
    	end_if
      		if not I_SettlementOwner Edessa = egypt
       		set_event_counter kontakt 0
    	end_if
    	end_monitor

  3. #3

    Default Re: ask for checking script

    No. I need to know if the settlements belonge to european factions. I want to use this condition to recruit units like crossbowmen and heavy cavalry in africa and asia. Another words i only want to recruit this units if eastern faction have military contact with european military on east (recruiting in europe are described by other lines of EDB)

  4. #4

    Icon1 Re: ask for checking script

    Maybe this:
    Spoiler Alert, click show to read: 
    Code:
    declare_counter kontakt_points
    
    monitor_event GeneralCaptureSettlement FactionReligion catholic
    	and IsRegionOneOf Antioch_Province, Tripolii_Province, Acre_Province, Jerusalem_Province, Jaffa_Province, Ascalon_Province, Damietta_Province, Alexandria_Province, Cairo_Province, Edessa_Province
       	inc_counter kontakt_points 1
    end_monitor
    
    monitor_event GeneralCaptureSettlement not FactionReligion catholic
    	and IsRegionOneOf Antioch_Province, Tripolii_Province, Acre_Province, Jerusalem_Province, Jaffa_Province, Ascalon_Province, Damietta_Province, Alexandria_Province, Cairo_Province, Edessa_Province
    	and I_CompareCounter kontakt_points >= 1
    	inc_counter kontakt_points -1
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType egypt 
    	if I_CompareCounter kontakt_points >= 1
       	set_event_counter kontakt 1
    end_if
    	if I_CompareCounter kontakt_points = 0
       	set_event_counter kontakt 0
    end_if
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType moors 
    	if I_CompareCounter kontakt_points >= 1
       	set_event_counter kontakt 1
    end_if
    	if I_CompareCounter kontakt_points = 0
       	set_event_counter kontakt 0
    end_if
    end_monitor

  5. #5

    Default Re: ask for checking script

    Nice
    I didn't know most of commands you used

    I need to check your script, but it take a lot of time - i'm changing recruiting system in my mod and it's a lot of work.

    I would like to ask you one more question: chow to use CrusadeOutcome condition? I know that i need to add none, success, fail or cancel parameter but i have no idea how i can use it

  6. #6

    Icon1 Re: ask for checking script

    attyla: I have never actually used the ‘CrusadeOutcome’ condition, but I think you would have to do something like this for it to work:
    Code:
    monitor_event CrusadeEnds IsCrusade	; or IsJihad
    	and CrusadeOutcome success	; or none, fail, cancel
    	and TargetSettlementName Jerusalem

Posting Permissions

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