Results 1 to 16 of 16

Thread: Ancillary triggers.

  1. #1

    Default Ancillary triggers.

    I play Third Age 3.2 and want to implement "lordships" into the game. I have it all written down - 45 minor lordships and 12 major lordships made up of 3-4 minor lordships. I have made a spreadsheet. All the settlements are divided into groups of 3 or 4. Each group of settlements will give the general in the main province a Lordship as an ancillary. This will enable me to implement the BodyguardSize effect into this ancillary. I can now reduce the BG size to a minimum in the export_unit_descr file and increase the General's BG as the game progresses and more territory is acquired. The problem is the trigger. In Mordor there are two settlements named Orc Encampment. How do I get around this? I'm also interested in a trigger for cultural percentage in the settlement.

    Example (Because the faction leader already have a hard-coded BodyguardSize 7.75, the ancillary will only be available to those who conquer the settlements listed in the trigger.)

    Ancillary lord_lindon
    Type court
    Transferable 1
    Image lord_lindon.tga
    Description lord_lindon_desc
    ExcludedAncillaries Leader of the White Council
    EffectsDescription lord_lindon_effects_desc
    Effect Command 1
    Effect Authority 1
    Effect BodyguardSize 5

    Trigger lord_lindon
    WhenToTest CharacterTurnEnd
    Condition EndedInSettlement
    and SettlementName Mithlond
    and I_SettlementOwner Forlond
    and I_SettlementOwner Harlond
    and I_SettlementOwner Elostirion
    and IsFactionLeader
    and not FactionwideAncillaryExists lord_lindon

    AcquireAncillary lord_lindon chance 100
    "Alea iacta est"

  2. #2
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,121
    Blog Entries
    35

    Default Re: Ancillary triggers.

    In Mordor there are two settlements named Orc Encampment.
    Script triggers will always use the data name of a settlement. Simply open the data\text\imperial_campaign_regions_and_settlement_names.txt file and search for Orc encampment (the display name) in there - the names on the left of them (in parenthesis) gives you the data name:
    Code:
    {Orc_Province}West Gorgoroth
    {Orc}Orc Encampment
    {East_Gorgoroth_Province}Ered Lithui
    {East_Gorgoroth}Orc Encampment
    Proceed the same way with all your other triggers.

    A note as to your trigger example:
    1. it is restricted to the faction leader - do keep in mind that you have limited anc slots per character
    2. the I_SettlementOwner condition is incomplete, the syntax is I_SettlementOwner [settlement name] [faction]
    3. I have an inkling that the ExcludedAncillaries definition 'Leader of the White Council' is in a wrong format as the words are usually connected with underscores.
    Last edited by Gigantus; September 07, 2020 at 03:03 AM.










  3. #3

    Default Re: Ancillary triggers.

    Thank you. That was very helpful. I guess I was just lucky when I tested this earlier with Mithlond. The display name is often the same as the data name.

    The number of ancillaries for each general is hardcoded at 8. I will keep that in mind. I'll use and IsGeneral

    The correct entry would be leader_council

    If I use: and I_SettlementOwner mithlond egypt

    will this restrict the ancillary to only egypt (high elves)? I want it to be available for everyone. Can I list them all or is there a better way of doing it?

    I don't know if this is possible, but how can I make it so that the general with an ancillary will lose it if he get a better one? In this scenario I would like 3 lordships represented by 3 ancillaries to dissapear if the general get 1 ancillary representing all of them. So 3 lordships combined into an earldom or something like that. In the game when you get the One Ring this happens when you get Gollum as an ancillary. Is this a script or a trigger?

    Proabably a lot of noobish questions, but I have just started to fiddle around with this.
    "Alea iacta est"

  4. #4
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,121
    Blog Entries
    35

    Default Re: Ancillary triggers.

    If I use: and I_SettlementOwner mithlond egypt

    will this restrict the ancillary to only egypt (high elves)? I want it to be available for everyone. Can I list them all or is there a better way of doing it?
    No, this simply tests if at the moment mithlond belongs to egypt and if it returns true then it will enable the ancillary to be given to the character (providing all other conditions are true as well). I am assuming that you wish only to give the ancillary if a faction owns all the settlements listed. In this case you must also test for the faction type of the character, meaning you need a trigger for each eligible faction:
    Code:
    Trigger lord_lindon_egypt
        WhenToTest CharacterTurnEnd    
        Condition EndedInSettlement    
    and FactionType egypt
          and SettlementName Mithlond
          and I_SettlementOwner Forlond egypt
          and I_SettlementOwner Harlond egypt
          and I_SettlementOwner Elostirion egypt
          and IsFactionLeader
          and not FactionwideAncillaryExists lord_lindon
                  
        AcquireAncillary lord_lindon chance  100
    GED wrote a nifty script replicator that makes creating those triggers an easy affair - it replaces a keyword with words from a list, eg egypt with as many faction names as you wish, each getting their own trigger.

    I am not sure if removing ancillaries is feasible, can't recall a console command to do so - withwnar might know more here.










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

    Default Re: Ancillary triggers.

    I don't know if this is possible, but how can I make it so that the general with an ancillary will lose it if he get a better one?
    Short answer: not possible. Traits are much more flexible.

    Long answer: here but the inevitable conclusion will be that it almost certainly can't be applied to your situation.

    EDIT: "not possible" is incorrect. Not possible with triggers but script can do it, although it can't be done automatically. It requires the player to select the character. See the "this" and CharacterSelected section of that link.

    e.g. Something like this:

    Code:
    monitor_event CharacterSelected HasAncType anc1_type
      and HasAncType anc2_type
      and HasAncType anc3_type
      console_command remove_ancillary this anc1
      console_command remove_ancillary this anc2
      console_command remove_ancillary this anc3
      console_command give_ancillary this anc4
    end_monitor
    Note that each of those ancs will need a unique type for this to work. And it will only work for the player faction.
    Last edited by Withwnar; September 08, 2020 at 05:39 AM.

  6. #6

    Default Re: Ancillary triggers.

    Thank you so much Gigantus and Withwnar. I would have to make (45 minor lordships + 12 major lordships)* 13 factions = 741 triggers then. I can make all the triggers with the scrip replicator or I can make the triggers for one nation first and duplicate them in notepad++ and change all the entries of egypt in one go to something else in e new text document and copy it into the correct file.. I did this when I made changes to the bodyguard switch script. Are there a hardcoded cap on the number of triggers in the game BTW?

    If I can't remove ancillaries with a trigger I would have to change my plans. Maybe I can enable a major lordship when the culture in the settlement(s) have reached a certain percentage? In this scenario the minor lordships will represent conquered lands, while the major lordship would represent additional men you get by consolidation. (Some settlements will not change its culture because there are no buildings available with + culture %. I will have to keep those out of it in case.)

    Is there a trigger for culture? There is one for religion in the original files of the game. I found: and PopulationOwnReligion >= 70

    Maybe there is something like this: and PopulationOwnCulture >= 70

    And in case this is possible, can I add this underneath and I_SettlementOwner Forlond egypt as an additional trigger?

    Like this?


    Code:
    Trigger lord_lindon_egypt
        WhenToTest CharacterTurnEnd    
        Condition EndedInSettlement    
    and FactionType egypt
          and SettlementName Mithlond
          and I_SettlementOwner Forlond = egypt
                and PopulationOwnCulture >= 70
          and I_SettlementOwner Harlond = egypt
                and PopulationOwnCulture >= 70
          and I_SettlementOwner Elostirion = egypt
                and PopulationOwnCulture >= 70
          and IsGeneral
          and not FactionwideAncillaryExists lord_lindon
                  
        AcquireAncillary lord_lindon chance  100
    "Alea iacta est"

  7. #7

    Default Re: Ancillary triggers.

    The number of ancillaries for each general is hardcoded at 8.
    No more, with the M2TWEOP, the maximum is 255 (even if less is adviced).

    With the same tool you can use the new label system to remove and give ancillaries as you want. You just need to create an entry in the config file (labels.yoneuoycfg, in the youneuoy_Data folder), something like this:
    Code:
    ;------------------------------------
    label:
    Lordships unifier
    lordships_unifier
    10
    3
    ancillary
    1
    lordship_1
    ancillary
    1
    lordship_2
    ancillary
    1
    lordship_3
    The second line (Lordships unifier) is just a description for the logs, the third (lordships_unifier) is the name of the label to use in the campaign_script. 10 is the priority (the higher the number the higher the priority), to avoid conflicts. 3 is the number of conditions that must be true (here the character must have the three ancillaries to receive the label). There is tutorial here for more informations.

    Next in the campaign script, you can do this:
    Code:
    monitor_event FactionTurnStart FactionIsLocal    ;    labels are given before the local turn
        if I_CharacterExists lordships_unifier
            console_command remove_ancillary lordships_unifier lordship_1
            console_command remove_ancillary lordships_unifier lordship_2
            console_command remove_ancillary lordships_unifier lordship_3
            console_command give_ancillary lordships_unifier earldom
            console_command give_trait lordships_unifier try_change_this_label    ;    this command will remove the label, which can be reused next
        end_if
    end_monitor

  8. #8
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,121
    Blog Entries
    35

    Default Re: Ancillary triggers.

    Quote Originally Posted by Erken View Post
    No more, with the M2TWEOP, the maximum is 255 (even if less is adviced).
    Well, it's still hard coded (limited in the executable code) but with the tool it can be circumvented. Which means anyone else playing a mod that has edited files based on the use of the tool will have to install it. Gotta keep in mind that even false positive AV warnings tend to scare a good number of people, as that's what happens when you set up the tool.

    That said - not sure it would make sense from a game playing perspective, that would create one heck of a scroll bar.










  9. #9

    Default Re: Ancillary triggers.

    In one of the last updates, the tool was made more friendly with AV (only 5 of them are still detecting it iirc what i have read).

  10. #10
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,121
    Blog Entries
    35

    Default Re: Ancillary triggers.

    That is good news indeed.










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

    Default Re: Ancillary triggers.

    Quote Originally Posted by Strategos Autokrator View Post
    Are there a hardcoded cap on the number of triggers in the game BTW?

    ...

    Is there a trigger for culture? There is one for religion in the original files of the game. I found: and PopulationOwnReligion >= 70


    And in case this is possible, can I add this underneath and I_SettlementOwner Forlond egypt as an additional trigger?

    Like this?


    Code:
    Trigger lord_lindon_egypt
        WhenToTest CharacterTurnEnd    
        Condition EndedInSettlement    
    and FactionType egypt
          and SettlementName Mithlond
          and I_SettlementOwner Forlond = egypt
                and PopulationOwnCulture >= 70
          and I_SettlementOwner Harlond = egypt
                and PopulationOwnCulture >= 70
          and I_SettlementOwner Elostirion = egypt
                and PopulationOwnCulture >= 70
          and IsGeneral
          and not FactionwideAncillaryExists lord_lindon
                  
        AcquireAncillary lord_lindon chance  100
    I don't know if there's a trigger limit. If there is then I expect that it is very high, far beyond what you need.

    In TATW, like the vanilla Brittania campaign, Culture is Religion. It is just renamed to "Culture" in the text\* files. Internally it is still Religion, so you would use Religion conditions. (There is also the true Culture which governs things like portraits, buildings and other UI things. This one has nothing to do with Religion.)

    PopulationOwnReligion applies to the character (see the Docudemons), thus the settlement/region he is currently in, therefore Mithlond in that example. For your proposed trigger conditions above you'd need something like I_SettlementPopulationReligion which does not exist. So no. Essentially, there is no way to find out how much religion some other settlement(s) have, not without some serious scripting which still might not be reliable and would slow down turn ends.

  12. #12

    Default Re: Ancillary triggers.

    Withwnar

    Is there a way to turn off the requirements in your general switch mod? I would want to turn of Black Gate for Morannon guard for Mordor; Fountain guard for Boromir, Faramir and Denethor; Guards of Khazad-dûm for Moria, Dragonslayers of Ered-Mithrin for Dain's Halls and Axemen of Erebor for Erebor.

    I would like to change all the bodyguards. That's not a problem, but the requirements are. For the dwarfs I want pikemen, crossbowmen, two-handed axemen and halberds as an example. I have made new duplicate units to be used by generals only. I want to control the number of men in a general's unit with the ancillaries I have made. The basic breakdown will be 10 men for heavy cavalry and 40-30 men if they are dismounted armoured men. The logic behind that is the cost. Knights were paid 24d per day in the middle ages. Armoured men/armatii were paid 6-8d per day. So we get 10 * 24 = 240 and 240/6 = 40. 3 ancillaries on average will bring the bodyguard size up to 40 heavy cavalry and 70 heavy infantry. I will also disable a few ancillaries in the game. Tutor, Biographer and a few others. They usually make you reach 8 too fast.

    I have made all the triggers, ancillaries, and all the general units. The only thing I have left is to change your scrip (which I have done several times already) and recalculate price and slightly change the general unit stats with 1-2+ attack, 1-2+ moral, 1+ defense and maybe 1+ armour in order make up for the reduction in numbers. Heavy cavalry will be normalized at 8-9 charge for all units. Only Swan knights will have 10 charge.

    Thank you in advance.

    Last edited by Strategos Autokrator; October 28, 2020 at 04:38 PM. Reason: dyslexia lol
    "Alea iacta est"

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

    Default Re: Ancillary triggers.

    Ask it in the submod's thread and I'll answer there.

  14. #14

    Default Re: Ancillary triggers.

    One question. When I play as the Orcs of the Misty Mountains I get a Balrog. But he can't get any ancillaries in general have I noticed. So, is there a chance he or Sauron can get my new Lordship ancillaries with BodyguardSize +. If they can I want to prevent it. If so, how do I go about to do that?

    My sub mod is done. I have made all the Lordships, changed the bodyguards to duplications of top tier units with slightly better stats and balanced them. I have just some icons left. 780 in fact. I believe I can reduce that down to about 360. Orcs of the Misty Mountains, Orcs of Gundabad and Mordor can use the same icons. Harad and Rhun can use the same. Eriador/Arnor, Dale, Rohan and Gondor can use the same. High Elves and Silvan Elves can use the same, if not the same as humans. Isengard and Dwarfs will have icons of their own. So that's still 60 lordships * 6 groups = 360. The best way is probably to make 60 different icons and then duplicate them by changing some colors. Black/red for Orcs, green/blue for good humans and Elves. Yellow/red for Harad/Rhun. White/blue for Dwarfs. Black/white for Isengard.
    "Alea iacta est"

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

    Default Re: Ancillary triggers.

    If this is vanilla TATW then the Balrog is a unit, not a named character, so no, cannot get ancs or traits.

    One way to prevent certain characters from getting certain ancs (or traits) is to create a trait, give it to them, and add a condition to ALL of the triggers of those ancs/traits you don't want them to get:

    Code:
    and Trait xxx = 0
    Where xxx is the name of that new trait, e.g. LordshipAncImmunity. You'd almost certainly want to make that a hidden trait.

  16. #16

    Default Re: Ancillary triggers.

    I have one problem I can not figure out a solution to. The triggers work fine, I get all the bonuses. When I hold the mouse over the ancil the text appear as intended. Everything is fine. But sometimes when I get an ancil there is no notification after end turn. On some of them I get notifications, though. And I can not figure out what it is. Is there a character limit? Is there a limit on the number of underscore I can use? Is there a limit of ancils. I have 780. I have delete the bin file and trimmed export_ancillaries for trailing space in notepad++ as recommended by Gigantus in another thread from 2012. No change.

    Here is an example of one that doesn't give me a notification.

    Code:
    {lord_northern_rhun_venice}Lord of Northern Rhûn
    {lord_northern_rhun_venice_desc}Lord of Kelepar, Mistrand and Rhomen.
    {lord_northern_rhun_venice_effects_desc}+1 Authority, +1 LocalPopularity, +1 TroopMorale, +1 MovementPoints, +1 HitPoints, +2 Loyalty, 4% on Trading, 4% on TaxCollection, +1 Law and BodyguardSize 4.
    Code:
    Ancillary lord_northern_rhun_venice
        Type herald
        Transferable 1
        Image lord_northern_rhun_venice.tga
        Description lord_northern_rhun_venice_desc
        EffectsDescription lord_northern_rhun_venice_effects_desc
        Effect Authority  1
        Effect LocalPopularity  1
        Effect TroopMorale  1
        Effect MovementPoints  1
        Effect HitPoints  1
        Effect Loyalty  2
        Effect Trading  4
        Effect TaxCollection  4
        Effect Law  1
        Effect BodyguardSize  4
    Code:
    Trigger lord_northern_rhun_venice
        WhenToTest CharacterTurnEnd    
        Condition EndedInSettlement    
          and FactionType venice
          and SettlementName Rhun
          and PopulationOwnReligion >= 44
          and I_SettlementOwner Kelepar = venice
          and I_SettlementOwner Mistrand = venice
          and IsGeneral
          and not FactionwideAncillaryExists lord_northern_rhun_venice
                
        AcquireAncillary lord_northern_rhun_venice chance  100
    "Alea iacta est"

Posting Permissions

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