Page 1 of 3 123 LastLast
Results 1 to 20 of 56

Thread: recruitment via trait or ancillary

  1. #1
    Cesco's Avatar Decanus
    Join Date
    Apr 2013
    Location
    Italia
    Posts
    595

    Default recruitment via trait or ancillary

    I might have already asked this question in the past, but anyway: I would like to relate the recruitment of certain units to a specific trait or ancillaries. Is that possible?
    Huic ab adulescentia bella intestina, caedes, rapinae, discordia civilis grata fuerunt ibique iuventutem suam exercuit

  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: recruitment via trait or ancillary

    I vaguely remember a script that enabled recruitment when a governor was present, I think it was Pro Deo et Rege. Shouldn't be too difficult to add a trait condition. Lemme check if I can find it.

    Spoiler for invalid idea
    Edit: it was building, not recruiting and the event (SettlementSelected) does not export character traits. It does however export character attributes (and loyalty level of his settlement) if that is of any help:
    Code:
    monitor_event FactionTurnEnd FactionIsLocal
        set_event_counter governor_present 1
    end_monitor
    
    monitor_event SettlementSelected GovernorInResidence
        and FactionIsLocal
        and GovernorAttribute  chivalry >= 1    ; requires attribute name, a token (> < =) and the level of the attribute
        set_event_counter governor_present 1
    end_monitor
    
    monitor_event SettlementSelected not GovernorInResidence
        and FactionIsLocal
        set_event_counter governor_present 0
    end_monitor
    This was the easy part - now you will have to add the following condition at the end of EACH recruitment line in the EDB file, sample:
    Code:
    recruit_pool "Jerusalem Sergeants"  1   0.05   1  0  requires factions { england, } and event_counter governor_present 1
    This will only affect the player, the AI will recruit as normal.


    Just remembered that the resetting of the recruit condition will also reset the pool to zero. I am afraid this is a no go: while the recruitment is enabled there will be no one to recruit. To counter that (with a recruit pool resetting script) will require a massive script that has a number of draw backs.
    Last edited by Gigantus; March 02, 2020 at 11:31 PM.










  3. #3
    Titus le Chmakus's Avatar Biarchus
    Join Date
    Aug 2014
    Location
    Skiing on the Spine of the World or hunting in Lurkwood
    Posts
    648

    Default Re: recruitment via trait or ancillary

    Can't he add a "HasAncType" and set his Ancillary type to Recruitment ?

    Code:
    monitor_event FactionTurnEnd FactionIsLocal
        set_event_counter governor_present 1
    end_monitor
    
    monitor_event SettlementSelected GovernorInResidence
        and FactionIsLocal
        and GovernorAttribute  chivalry >= 1    ; requires attribute name, a token (> < =) and the level of the attribute
        and HasAncType recruitment ;(to be set in each required Ancillary)
        set_event_counter governor_present 1
    end_monitor
    
    monitor_event SettlementSelected not GovernorInResidence
        and FactionIsLocal
        set_event_counter governor_present 0
    end_monitor
    And why do you set FactionIsLocal ?

  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: recruitment via trait or ancillary

    FactionIsLocal is the player - the AI can't handle the requirement of a named character needing to be present (nor can he 'select' a settlement). It's absence in the third monitor would mean that clicking on an AI settlement without a governor would set the counter to false for all AI turns until the player's turn.
    The SettlementSelected event does not export character details, which HasANCType requires. Unfortunately there is no GovernorTrait condition, only attribute and loyalty (of the settlement) that can be tested.

    some info on the monitors:

    #1 - sets the counter to true at the player's turn end to enable regular AI recruitment
    #2 - sets the counter to true if the conditions are met in the player's settlement
    #3 - sets the counter to false if no governor is present in the player's settlement










  5. #5
    Cesco's Avatar Decanus
    Join Date
    Apr 2013
    Location
    Italia
    Posts
    595

    Default Re: recruitment via trait or ancillary

    That's a pity, making units recruitable only by general with a specific traits/ancillaries would be a nice detail to many mods.
    Huic ab adulescentia bella intestina, caedes, rapinae, discordia civilis grata fuerunt ibique iuventutem suam exercuit

  6. #6
    z3n's Avatar State of Mind
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: recruitment via trait or ancillary

    Didnt BGR do what you are looking for?

    http://www.twcenter.net/forums/showt...GRIV-Enhanced)
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  7. #7
    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: recruitment via trait or ancillary

    Looks promising, he most likely used a different event to limit recruitment if it is religion based. My bet however is on the "region_religion" EDB condition - which isn't character based. But then he talks about traits....

    The download links to nerazzi,net (spelling?) are dead on that page. Seems this is the place to download. I'll download and have a look if I can identify how and what he did regarding the "Dynamic Religious Area of Recruitment, Recruitment by Rank" part.










  8. #8
    z3n's Avatar State of Mind
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: recruitment via trait or ancillary

    Ah yeah, I was on my phone or I would have linked this post I made a while back with a working download link.
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  9. #9
    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: recruitment via trait or ancillary

    Given the size and filename it would appear the same, I guess that's the link to your mirror on the original page?

    I came across some 'freeze' and 'recruit_pool' stuff but that only triggers based on finances and settlements held.
    Nothing in the EDB that indicates conditions based on character stuff, can't see anything in the script either.

    Found a 'RecruitmentAbility' trait but no indication yet how it is incorporated, not referenced in the campaign script. there is however a 'Byg's Grim Reality Recruitment' header in there with a blank space underneath it. Next script part is the season (tpy) script. Can't find anything that might get merged\copied there via launcher: the launcher script only amends two sections of the AI file, all others are copied as it.

    I think I'll leave it at that, it would require actually installing Stainless Steel and Byg to get a basic idea, but my wisdom stops at recruit pool manipulation if it is trait or anc based. Which still is a mystery because testing a governor's trait\anc, eg when you open the settlement panel (which gives access to building\recruiting) isn't possible - at least not without massive conditional scripting.
    It is not required to select a character for recruitment in a settlement, which would enable trait checks.

    Which suggests that there must be a different approach and I have no idea how to search for it. Maybe this version simply hasn't got the recruitment script stuff?










  10. #10
    z3n's Avatar State of Mind
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: recruitment via trait or ancillary

    He may have used a more subtle approach based on trait and ancillary interactions with zeal or something similar.

    I can try to take a look tomorrow, as I believe I have that implemented in a mod I made some time ago based on SS and BGR.
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  11. #11
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: recruitment via trait or ancillary

    I got those system in my mod, Withwnar made it for me. I got ancillary of lordship for every settlement with different attribute Magic, so this way we can detect who is in the settlement. In my case we have 3 situations - lord pf current settlemet can recruit and build everything, any other governor can only hire mercs and levies, without governor - nothing possible to do.

    Here we go
    https://www.twcenter.net/forums/show...ork&highlight=
    Last edited by bitterhowl; March 04, 2020 at 01:39 AM.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  12. #12
    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: recruitment via trait or ancillary

    Quote Originally Posted by bitterhowl View Post
    I got those system in my mod, Withwnar made it for me. I got ancillary of lordship for every settlement with different attribute Magic, so this way we can detect who is in the settlement. In my case we have 3 situations - lord pf current settlemet can recruit and build everything, any other governor can only hire mercs and levies, without governor - nothing possible to do.

    Here we go
    https://www.twcenter.net/forums/show...ork&highlight=
    Ah yes, I was on the right track with the GovernorAttribute approach, but saw it as the solution and not a step in defining a new\next step condition. filter_settlement_command is the magic bullet for disabling recruiting\building used here. Won't help with staggered\level recruiting though as it totally disables the function.

    Basically two steps:

    1. check if a character with specific\unique anc is in a specific settlement and set a counter
    2. if a specific settlement is selected and the specific counter is set then enable the interface

    4 monitors per settlement - that's going to take a toll on processing speed.










  13. #13
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: recruitment via trait or ancillary

    Using event_counter in EDB has an issue - when you set it to 0 and back to 1 - you need to replenish recruit pool, so if it's replenish rate less than 1.0 you need time to wait. In my scritp system character may re-enter settlement multiple times during one turn without loosing recruit ability.

    As for script executing time - I didn't see strong influence on performance.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  14. #14
    Titus le Chmakus's Avatar Biarchus
    Join Date
    Aug 2014
    Location
    Skiing on the Spine of the World or hunting in Lurkwood
    Posts
    648

    Default Re: recruitment via trait or ancillary

    How about something like ?

    Code:
    monitor_event FactionTurnStart 
        set_event_counter governor_present 0
    end_monitor
    
    monitor_event SettlementTurnStart
        and GovernorInResidence
        set_event_counter governor_present 1
    end_monitor
    
    monitor_event CharacterTurnStart
        and event_counter governor_present 1
        and HasAncType MagicalDeadlySword ; to replace with the Ancillary Type you have set in EDA (can be anything you like)
        set_recruit_pool York_Province 5 temp heavy spearmen
    end_monitor

  15. #15
    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: recruitment via trait or ancillary

    You need to establish a counter that is restricted to a governor being present in a particular settlement - in your case the counter will be set by a governor in, let's say Nottingham if it is in the processing line before York. Something tells me that your setting of the recruit pool will enable the recruiting of those 5 units even if the settlement hasn't got any buildings, I think you will need to use the generic 'switch on recruit pool' setting. bitterhowl might have more pertinent info on that.










  16. #16
    Titus le Chmakus's Avatar Biarchus
    Join Date
    Aug 2014
    Location
    Skiing on the Spine of the World or hunting in Lurkwood
    Posts
    648

    Default Re: recruitment via trait or ancillary

    You mean that the game will not check the building level to allow recruitment or not ? If the monitors are all true, the recruitment will be enabled, no matter of any building level ?

    That makes sense ! I had not thought about it.

    But does the author need a certain building level to enable the recruitment or does he just need the Governor to have a certain ancillary ? Because if he only needs the second option, then my script would work don't you think ?

  17. #17
    z3n's Avatar State of Mind
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: recruitment via trait or ancillary

    Quote Originally Posted by bitterhowl View Post
    I got those system in my mod, Withwnar made it for me. I got ancillary of lordship for every settlement with different attribute Magic, so this way we can detect who is in the settlement. In my case we have 3 situations - lord pf current settlemet can recruit and build everything, any other governor can only hire mercs and levies, without governor - nothing possible to do.

    Here we go
    https://www.twcenter.net/forums/show...ork&highlight=
    This would be OPs best option. Just make one or a few specific towns where the recruitment can happen and give an event message letting the player know only those towns are available with the specific ancillary or trait.

    It is very easy to cook up lore reasons about why. Even for historical games.
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  18. #18
    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: recruitment via trait or ancillary

    Quote Originally Posted by Titus le Chmakus View Post
    You mean that the game will not check the building level to allow recruitment or not ? If the monitors are all true, the recruitment will be enabled, no matter of any building level ?

    That makes sense ! I had not thought about it.

    But does the author need a certain building level to enable the recruitment or does he just need the Governor to have a certain ancillary ? Because if he only needs the second option, then my script would work don't you think ?
    You could go for a 'min building level' check, but then the recruitment buildings have different names in settlement and castle, that would mean two monitors instead of one as the condition can not be used in a IF loop.










  19. #19
    Cesco's Avatar Decanus
    Join Date
    Apr 2013
    Location
    Italia
    Posts
    595

    Default Re: recruitment via trait or ancillary

    Quote Originally Posted by Titus le Chmakus View Post

    But does the author need a certain building level to enable the recruitment or does he just need the Governor to have a certain ancillary ? Because if he only needs the second option, then my script would work don't you think ?
    I had in mind to use a certain building and the general with a specific trait to enable the recruitment, but I could use the general alone as well...

    By the way, I would like to thank all of you for your help. Unfortunately, I'm not able to script, but I'm trying to learn and to use your suggestions.
    Huic ab adulescentia bella intestina, caedes, rapinae, discordia civilis grata fuerunt ibique iuventutem suam exercuit

  20. #20
    Titus le Chmakus's Avatar Biarchus
    Join Date
    Aug 2014
    Location
    Skiing on the Spine of the World or hunting in Lurkwood
    Posts
    648

    Default Re: recruitment via trait or ancillary

    Yeah no worries, I'm not an expert as the 2 legends we have here !

    Do you want to use a certain building or a certain building tree ? It is not the same at all. And do you want to use Traits or Ancillaries ? It is also not the same at all ! Traits are unlimited, ancillaries are limited to 8 per general ! We need more precisions here !


    Quote Originally Posted by Gigantus View Post
    You could go for a 'min building level' check, but then the recruitment buildings have different names in settlement and castle, that would mean two monitors instead of one as the condition can not be used in a IF loop.
    Right, he can do one monitor for every building he needs. Fastidious but doable !

Page 1 of 3 123 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
  •