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

Thread: Hiring Ancillaries

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Hiring Ancillaries

    I dont usually share new scripting ideas right away but I had a thought today, all Ancillaries (and traits) are awarded by random chance. For most of them that is fine, thought I dont see why a king would tolerate having some of them around, and you cant really "fire" them other than to give them to a bad general and send them on a death cruise.

    So I was thinking it would be cool to have some uber ancillaries that you had to hire and pay a maintenance fee for. But how to do it?

    Via a combination of campaign_script, showme_script, buildings, and trigger.

    We already have Actor, lets add Playwright and Troupe of Performers.

    First you create your new ancillaries, and the new triggera, inside the trigger is an event_counter requirement, and the chance is set at 100. To hire the Troupe of Performers you would also have to already have Playwright.

    In the campaign_script you set a monitor on settlements that have a particular building, a top level Theater. From there you get a random chance of getting Playwright, and after that a random offer to hire a VERY expensive Troupe of Performers. This pops the showme script.

    Clicking yes on the showme script deducts money, lowers the kings ransom, and sets the event_counter required for the trigger. At turn end the 100 chance is applied and your faction leader now has the Troupe of Performers.

    You could assign some awesome benefits to the ancillary to make it worth the money, and then script some other stuff around the ancillary such as random shows when ending a turn in a settlement. The show would bring income via add_money, or maybe you could script another showme to actually hold the show when you wanted, and then give some temporary bonuses.

    Any thoughts on this before I try to make it work? Anyone interested in something like this? Other thoughts, ideas?

  2. #2

    Default Re: Hiring Ancillaries

    I like it, but would the AI always hire them or would they just never get them?

  3. #3
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Hiring Ancillaries

    You would probably have to make another set of triggers strictly for the AI and then figure out when you wanted the AI to have them.

  4. #4
    Matz's Avatar Civis
    Join Date
    Oct 2007
    Location
    Low Lands
    Posts
    120

    Default Re: Hiring Ancillaries

    Sounds like a great idea in my book, the only two issues I can think of is that the new ancillaries might confer too big of a bonus, and the ai might indeed not have the brains to exploit it.. Cool thing is that you could then make special guards for generals etc.

    Second issue is timing, how do you script a certain duration of a trait? Because it would be irrealistic to pay the "ancillary" once and then they stay on for life without being re-hired. Or an amount of money could be deducted every turn. Think something like that should be included

    Matz
    If brute force doesn't work, ur not doin it rite!

  5. #5

    Default Re: Hiring Ancillaries

    Quote Originally Posted by Matz View Post
    Second issue is timing, how do you script a certain duration of a trait? Because it would be irrealistic to pay the "ancillary" once and then they stay on for life without being re-hired. Or an amount of money could be deducted every turn. Think something like that should be included
    If you decrease the king's purse, you lower the amount of cash a faction gets for each turn (so it would work out the same as upkeep).

  6. #6
    wilddog's Avatar Paintedwolves run free
    Join Date
    Jan 2005
    Location
    UK
    Posts
    2,337

    Default Re: Hiring Ancillaries

    GrnEyedDvl - not sure why you need a show me script. Just use an event with an event counter (available in Kingdoms so should also be there for v1.3). I use that for feudal relief in my mod albeit my counters are faction specific as its tied to faction titles .. but thats what you would need also... and I lower the Kings purse and you pay for it.. and you have the option to defer it... so its all fairly simple and quite possible.

  7. #7
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Hiring Ancillaries

    Well the show me could be used for several things, and as I said this is the first iteration of the idea. I even have a way that you might be able to fire the same ancillary in mid turn so you could get a different one, and limit the number of super ancillaries. I would be interested in seeing how you did the feudal relief though, it sounds similar to something else I have in the works.

    Matz as has been stated you simply lower the kings purse to simulate employment costs. With the AI you make the bonuses automatic, so the AI gets the same bonuses without having to make any choices, which would actually give the AI an advantage in certain areas, depending on what the ancillary was.

    Any ideas on what some of the ancillaries should be?

  8. #8
    Matz's Avatar Civis
    Join Date
    Oct 2007
    Location
    Low Lands
    Posts
    120

    Default Re: Hiring Ancillaries

    Thanks for clearing the questions up for me guys :-).

    some ideas:

    Personal Guard/Escort : security for generals
    Insider: increase line of sight? (bribed the guy into spying for you)
    Choir: increase piety for generals or priests
    Personal Smith: increase hit points
    shady dealer: reduce mercenary hiring costs

    Thats all I can come up with off the top of my head, dunno if they're useful or would work ingame.

    It might as a matter of fact make sense to have some of the existing ancillaries hire-able, like a drillmaster or mercenary captain.

    Matz
    If brute force doesn't work, ur not doin it rite!

  9. #9
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Hiring Ancillaries

    It might as a matter of fact make sense to have some of the existing ancillaries hire-able, like a drillmaster or mercenary captain.
    That it might. If I get it to work the way I want with one, then I will look at expanding it.

  10. #10
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Hiring Ancillaries

    Well it works

    Right now I have the option to hire a playwright firing on FactionTurnEnd, but you can set whatever conditions you want. Note that this is designed only to work with the faction leader because otherwise you have to know a characters name, especially since e_select_character is kind of flawed. Also note that this only works for Kingdoms as vanilla M2 doesnt have the accept/decline scroll. You would have to do it through a show_me.
    Spoiler Alert, click show to read: 


    Click Accept, and you get the ancillary when you click end turn.
    Spoiler Alert, click show to read: 


    Selecting your faction leader and opening his information scroll when you are not inside a settlement gives you the option to fire the ancillary. Because there is a limit on the number of ancillaries I thought it best if you could get rid of him and make room for a better one, and limit the number of super ancillaries.
    Spoiler Alert, click show to read: 


    Click Accept to fire him and he is immediately gone. The e_select works perfectly for this, partially because you already have the character selected in order to open his scroll.

    When you are inside a settlement, or in an army with more than one character, you have to select the scroll from here. This also makes the pop up for the choices appear less often, it would tend to get annoying if it popped every single time you opened the scroll to view your character. This way you have a bit more control over how often it pops up.
    Spoiler Alert, click show to read: 


    Click Accept and get the bonuses for holding the plays. I also built in a limit so you can only hold them every 3 turns, so it cant be abused, but that number is easily changed. I also have an idea in mind where if you max out the use of your ancillary he gets pissed and quits, but I havent totally worked it out yet.
    Spoiler Alert, click show to read: 



    Finally I will post the script, you will have to create your own ancillaries, trigger, event descriptions, and conditions for the AI to take advantage of it. Its also quite possible someone will be able to improve this so if you have ideas lets hear them. Its only about 70 lines long so you could easily have a bunch of unique ancillaries without a big performance hit.
    Spoiler Alert, click show to read: 
    monitor_event FactionTurnEnd FactionIsLocal ;if playwright has not currently employed give option to hire
    and I_EventCounter playwright_hired = 0
    add_events
    event counter hire_playwright_accepted
    event counter hire_playwright_declined ; might add an event here, a notice of some sort
    date 0
    end_add_events
    historic_event hire_playwright true
    end_monitor

    monitor_conditions I_EventCounter hire_playwright_accepted = 1 ; player has clicked Accept
    set_event_counter hire_playwright_accepted 0 ; reset the counter
    add_money Andor -5000 ;; add I_LocalFaction conditions for each faction
    set_event_counter playwright_hired 1 ;this is a condition in the trigger
    end_monitor

    monitor_event CharacterSelected CharacterIsLocal ; gives option to fire this character, only works when not inside settlement
    and IsFactionLeader
    and FactionwideAncillaryExists playwright true
    and not EndedInSettlement
    set_event_counter fire_playwright 1
    end_monitor

    monitor_event ScrollOpened character_info_scroll_character_panel
    and I_EventCounter fire_playwright = 1
    add_events
    event counter fire_playwright_accepted
    event counter fire_playwright_declined
    date 0
    end_add_events
    historic_event fire_playwright true
    end_monitor

    monitor_conditions I_EventCounter fire_playwright_accepted = 1
    e_select_character ;yes this actually works because the character is already selected
    console_command remove_ancillary this playwright ;removes playwright
    set_event_counter playwright_hired 0 ;re-enables the hiring of playwright
    set_event_counter fire_playwright_accepted 0
    end_monitor

    monitor_event CharacterSelected CharacterIsLocal ; enables option to hold plays when inside settlement
    and IsFactionLeader
    and FactionwideAncillaryExists playwright true
    and EndedInSettlement
    set_event_counter stage_plays 1
    end_monitor

    monitor_event ScrollOpened character_info_scroll_character_panel ;opening the character panel gives option to hold plays
    and I_EventCounter stage_plays = 1
    and I_EventCounter turns_since_play = 0 ; here you can set a counter to only allow plays every x amount of turns
    add_events
    event counter stage_plays_accepted
    event counter stage_plays_declined
    date 0
    end_add_events
    historic_event stage_plays true
    end_monitor

    monitor_conditions I_EventCounter stage_plays_accepted = 1 ;player decides to hold plays
    add_money Andor 500 ; add I_LocalFaction condition for each faction and any other bonuses you wish
    set_event_counter stage_plays_accepted 0
    set_event_counter turns_since_play 3 ; only allow plays every 4 turns
    end_monitor

    monitor_event FactionTurnEnd FactionIsLocal
    if I_EventCounter turns_since_play > 0
    inc_event_counter turns_since_play -1 ;countdown to enable plays again
    end_if
    end_monitor

  11. #11
    wilddog's Avatar Paintedwolves run free
    Join Date
    Jan 2005
    Location
    UK
    Posts
    2,337

    Default Re: Hiring Ancillaries

    @GrnEyedDvl - well done.
    The bit that was new for me was that I hadn't realised you could remove ancillaries.

  12. #12

    Default Re: Hiring Ancillaries

    Quote Originally Posted by GrnEyedDvl View Post
    Well it works

    monitor_event CharacterSelected CharacterIsLocal ; gives option to fire this character, only works when not inside settlement
    and IsFactionLeader
    and FactionwideAncillaryExists playwright true
    and not EndedInSettlement
    set_event_counter fire_playwright 1
    end_monitor
    And if you use IsGeneral? Will it work for ordinary generals?

    TTW GRANDMASTER

  13. #13
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Hiring Ancillaries

    I think you have been able to since RTW, but the accept/decline historic event is new for Kingdoms.

  14. #14
    wilddog's Avatar Paintedwolves run free
    Join Date
    Jan 2005
    Location
    UK
    Posts
    2,337

    Default Re: Hiring Ancillaries

    I think you have been able to since RTW, but the accept/decline historic event is new for Kingdoms.
    I don't think I came across the consol command for it and had assumed it didn't exist (nevr did much scripting in RTW).

    Yep the accept/decline historic event was the main thing I wanted as a change to scripting. Allows you to do quite a few things as decision events. That was what I used for my Feudal Relief script... although I have a 1 turn delay before the ancillary is generated (most of my triggers were monitor event rather than monitor condition but I don't think I actually got an acceptance of the condition prior to being within the factionturn).

  15. #15

    Default Re: Hiring Ancillaries

    Quote Originally Posted by GrnEyedDvl View Post
    I think you have been able to since RTW, but the accept/decline historic event is new for Kingdoms.
    The problem was that in RTW we couldn't use this instead of the name of the selected character, which made such scripting impossible.

  16. #16

    Default Re: Hiring Ancillaries

    Good job, GrnEyedDvl.

    I like it.

    TTW GRANDMASTER

  17. #17
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Hiring Ancillaries

    Quote Originally Posted by BozosLiveHere View Post
    The problem was that in RTW we couldn't use this instead of the name of the selected character, which made such scripting impossible.
    You cant always do it in M2 either, that stuff is very buggy. I did a lot of testing with the e_selects when I was trying to move a character via script. I cant speak for RTW on this issue, but on M2 you can use the e_select and the "this" tag all day long and it will work just fine, as long as you dont have anything selected with the mouse at the same time.

    But if you have say a priest selected because you just moved him, hit EndTurn and it fired the condition to give the trait/ancillary to your faction leader, it will give the trait/ancillary to the priest because the physically selected character seems to take precedence over the e_selected character, even if you put a condition in like IsFactionLeader. It really pissed me off when I discovered that, and I posted about it in another thread someplace.

    But I figured out that if you are forcing the player to select the character manually, like in this script, because you need the player to actually choose something, and then check the conditions immediately through monitor_conditions instead of monitor_events, you can make it do what you want.

    btw I am not sure that having the choices fire when you open the characters scroll is the best way to go on this, it just seemed the simplest. If anyone has a better idea for when to offer the player the choice to fire/hold plays I would love to hear it. If we can figure out a better way offer the choices then we could possibly have more than two. Two for this ancillary is probably fine, but there are some other anciallry ideas that could definitely use a few more choices. Just keep in mind that whatever you fire the choice off of, the player has to physically select the character first.

  18. #18
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Hiring Ancillaries

    Yes and no. The reason I used IsFactionLeader is because there is only one of them, I dont have to know his name. The condition IsGeneral could apply to 20 characters, and the conditions could be true for 2 or 3 of them, maybe even more. If you used e_select_character, but the player actually had another character selected, you couldnt be for certain which character it would apply to. It would fire for the physically selected character.

    Now the part you quoted applies when CharacterIsSelected so that would still work (probably). The problem comes in when trying to hire the ancillary and give him to the general before we even get to the choices section.

    Currently I have the hire_ancillary set to FactionTurnEnd just so I could test it without having to meet a bunch of conditions. In a real application you wouldnt do it that way. You would set it to CharacterTurnEnd and then apply a bunch of other stuff, like BuildingExists or check other traits or whatever. Unless you put a BUNCH of conditions on it, they could be true for more than one character, so you would never know who you were hiring the ancillary for. For now I thought it best to assign it only to FactionLeader.

    I suppose you could trigger the hire_ancillary when you opened his scroll, and he EndedInSettlement, and X and Y. And then set a counter so that the next time you opened his scroll it wouldnt trigger the hire_ancillary but would trigger another choice. I guess the thing you have to balance is how often a player really wants a popup message when hes trying to do something else. I will work on some other options for this soon.

  19. #19
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: Hiring Ancillaries

    I'd probably do this similar to the title script I have been working on for Italia Invicta. You let the player select the character he wants to assign the ancillary or trait to via the army overview and trigger on the CharacterSelected event.

    Just a reminder: CharacterSelected doesn't work in settlements unless the character is selected through the army overview scroll, but since you do it a bit differently that's probably fine.

    No thing is everything. Every thing is nothing.

  20. #20
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Hiring Ancillaries

    Quote Originally Posted by alpaca View Post
    Just a reminder: CharacterSelected doesn't work in settlements unless the character is selected through the army overview scroll, but since you do it a bit differently that's probably fine.
    I figured that out though I didnt know that when I started. There are probably a few other things I will do as well, just a rough first version for now. Now that we have an accept/decline, I wish there was an easy way to make more than one choice lol

    I figured out a way to have as many choices as you want by triggering another option off the declined counter, but its slow and lots of extra code.

Page 1 of 4 1234 LastLast

Tags for this Thread

Posting Permissions

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