Page 1 of 2 12 LastLast
Results 1 to 20 of 25

Thread: Question about ancillaries

Hybrid View

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

    Default Question about ancillaries

    Hi again.

    In the mod I'm working, ancillaries are substituted by "titles", acquired when a general conquers a given settlement. As only one character can be "Lord of SettlementX", I've given those ancillaries the Unique and Transferable 0 as properties. But I'd like that, if the other faction in conflict conquest back the settlement, the title/ancillary disappears from the first faction and change to another different title for the new general that conquered the settlement.

    I haven't seen any similar to the antitrait (antiancillary?) and all the triggers use AcquireAncillary, but no "DeleteAncillary" command.

    Is there any method to eliminate one ancillary?
    I've seen somewhere the console_command remove_ancillary, but it requires the character name (if I'm not wrong). However my problem would be that I don't know "a priori" which character will have this ancillary.:hmmm:

  2. #2
    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: Question about ancillaries

    Revealing some secrets here that maybe I shouldnt yet lol

    I am using a similar system for the Feudal script in 1066 Conquests.

    The only way to remove an ancillary is by script with the console_command. But as you say, you have to know the characters name, or have him physically selected on the strat map. This presents a problem for AI characters, we can remove the ancillary easily from local characters, but AI characters are rarely selected by the player.

    I handled it by creating a set of Titles for each faction:
    Duke Region1 for Faction1
    Earl Region1 for Faction2

    This way of one faction controls London, they can assign the Duke of London title, but nobody else in the faction can have it. When Faction2 takes London, they also get to assign a Title to it. So now we have 2 Lords of London running around the map.

    Historically this would be accurate. A person that was Lord of Whatever is still the Lord of Whatever as far as his king is concerned, they just have to take back the province. When they get the city back, his title would be reinstated. (well most of the time).

    But we need to remove the bonuses that go with the title, so do it with a Trait. If a character is Lord of Whatever, and Whatever is conquered by another faction, then give him a Trait of Lord in Exile that counters the bonuses he gets from the Ancillary, a penalty trait.

  3. #3

    Default Re: Question about ancillaries

    Ok. I see.

    Your system gives more options to the human player to give the title to one character of choice. In my case the idea is that the title will be given automatically to the general that conquered the settlement.

    Now my concern is (let's see if I can explain myself): settlement is owned by faction1 at the beginning. Then faction2 conquers it and the title is given to generalA. But faction1 conquers again the settlement, although generalA keeps the "honorific" title (in exile as you say). But faction2 is able to conquer the settlement again, but now is generalB who conquers. Is it enough the Unique property of ancillary to prevent that the title is assigned to generalB? As the conditions to acquire the ancillary are again fulfiled, will it be acquired by generalB in detriment of generalA?

  4. #4

    Default Re: Question about ancillaries

    The only way to remove an ancillary is by script with the console_command. But as you say, you have to know the characters name, or have him physically selected on the strat map. This presents a problem for AI characters, we can remove the ancillary easily from local characters, but AI characters are rarely selected by the player.
    I've never tried it, but shouldn't it be possible to remove an ancillary by selecting an character with
    'e_select_character' (selects a character referred to in the current event context on the campaign map)
    and then removing the acillary with
    console_comand remove_ancillary this ...

  5. #5
    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: Question about ancillaries

    Quote Originally Posted by Hossi View Post
    I've never tried it, but shouldn't it be possible to remove an ancillary by selecting an character with
    'e_select_character' (selects a character referred to in the current event context on the campaign map)
    and then removing the acillary with
    console_comand remove_ancillary this ...
    It would be possible if that command worked, but it doesnt.

  6. #6

    Default Re: Question about ancillaries

    and not FactionwideAncillaryExists Duke_York

    For example?

  7. #7
    Opifex
    Join Date
    Feb 2005
    Location
    New York, USA
    Posts
    15,154

    Default Re: Question about ancillaries

    e_select_character works for a few Events. I've seen it done. It doesn't work universally, of that I'm pretty sure, so we just need to compile all the events it works with (or at least the major ones).


    "If ye love wealth greater than liberty,
    the tranquility of servitude greater than
    the animating contest for freedom, go
    home from us in peace. We seek not
    your counsel, nor your arms. Crouch
    down and lick the hand that feeds you,
    and may posterity forget that ye were
    our countrymen."
    -Samuel Adams

  8. #8
    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: Question about ancillaries

    I have never gotten it to work for anything. It fools you into thinking it works if you use it with CharacterSelected, but you dont have to use it for that.

  9. #9

    Default Re: Question about ancillaries

    We have it working for assigning trait titles in EB2. It usually likes CharacterTurnStart, but you have to test every time you add/change a condition in the monitor for it can stop working for no reason.

  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: Question about ancillaries

    Are you sure its not assigning the trait to the character who happens to be selected and not the one the event references? I did some testing and the e_select will work, but a physically selected character takes precedence over the referenced character.

  11. #11

    Default Re: Question about ancillaries

    Ops. No. It works if you don't have any character selected, or if you select the right one before ending the turn.

  12. #12
    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: Question about ancillaries

    Quote Originally Posted by BozosLiveHere View Post
    Ops. No. It works if you don't have any character selected, or if you select the right one before ending the turn.
    This is the problem with the e_select. You have no idea which character the player is going to have selected, and no way to control it.

  13. #13

    Default Re: Question about ancillaries

    Yeah, but it works fine if there are no characters selected. Which brings me to idea number one:

    Code:
    monitor_event ButtonPressed ButtonPressed end_turn
    
    call_object_shortcut card_manager deselect_all
    
    end_monitor
    Unfortunately, that doesn't work. I hope I'm doing something wrong and you'll correct me.

    Anyway, idea number two, aka second-best solution:

    Code:
    declare_counter CharacterSelected
    
    monitor_event FactionTurnStart FactionIsLocal
    set_counter CharacterSelected 0
    end_monitor
    
    monitor_event CharacterTurnStart FactionIsLocal
     and (bunch of other conditions go here)
    
    if I_CompareCounter CharacterSelected = 0
    e_select_character
    give_trait this TraitName 1
    end_if
    
    if I_CompareCounter CharacterSelected = 1
    historic_event TEACH_PLAYER_HOW_TO_BEHAVE factions { all, }
    end_if
    end_monitor
    
    monitor_event ButtonPressed ButtonPressed end_turn
    
    	  if I_AgentSelected spy
    	  	set_counter CharacterSelected 1
    	  end_if
    	  if I_AgentSelected assassin
    	  	set_counter CharacterSelected 1
    	  end_if
    	  if I_AgentSelected diplomat
    	  	set_counter CharacterSelected 1
    	  end_if
    	  if I_AgentSelected admiral
    	  	set_counter CharacterSelected 1
    	  end_if
    	  if I_AgentSelected general
    	  	set_counter CharacterSelected 1
    	  end_if
    	  if I_AgentSelected named_character
    	  	set_counter CharacterSelected 1
    	  end_if
    end_monitor
    This at least blocks the trait from being assigned to the wrong character and scolds the player to press Enter before ending his turn so that the trait can be assigned correctly. It's not ideal, but it's better than nothing.

  14. #14
    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: Question about ancillaries

    deselect_all isnt a valid command, so of course it doesnt work.

    Thats a very ugly solution. I for one wouldnt be able to stand having a damn popup every turn I had a character selected when I hit end turn.

    The best solution is to figure out a way to build a proper trigger that works. When are you trying to give this trait to a character?

  15. #15

    Default Re: Question about ancillaries

    There's nothing obvious about it, deselect_all is supposedly a valid shortcut element (check descr_shortcuts). If you don't want a popup every turn don't use that if. The trait will be assigned normally next time you end a turn with nothing selected. Or make it an advisor and control how many times you want it to show up.

    I still hope that someone will know how to make the game simulate an Enter key press.
    Last edited by BozosLiveHere; September 08, 2008 at 10:39 PM.

  16. #16
    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: Question about ancillaries

    Quote Originally Posted by BozosLiveHere View Post
    There's nothing obvious about it, deselect_all is supposedly a valid shortcut element (check descr_shortcuts).
    Just because something appears in a file someplace, does not mean its a valid scripting command. Take the AcquireAncillary or Effect tags. They work in the traits/vnv files because they were hardcoded into them, but use them in a campaign_script and the script fails. The ONLY commands you can use in a script, are the ones released by CA that were designed for the script. They have specific export and trigger requirements that commands in other files do not have. You simply cannot pull stuff from other files and expect it to work in a script.


    If you don't want a popup every turn don't use that if. The trait will be assigned normally next time you end a turn with nothing selected. Or make it an advisor and control how many times you want it to show up.
    Maybe, but its rare that you end a turn with nothing at all selected. How many times do you click in the middle of the map on nothing right before you end your turn? Few if any. Most people will have something selected, a city, a character, a unit. Its natural that when you finish changing stuff you go right to turn end, not click in the middle of the map.

    I still say the best way is to build a proper trigger unless you are doing something that requires the character to be selected, like my Hire Ancillaries script. Otherwise narrow down the conditions so you can apply a trigger to a single character.

    I still hope that someone will know how to make the game simulate an Enter key press.
    Not that I know of.

  17. #17

    Default Re: Question about ancillaries

    Quote Originally Posted by GrnEyedDvl View Post
    Just because something appears in a file someplace, does not mean its a valid scripting command. Take the AcquireAncillary or Effect tags. They work in the traits/vnv files because they were hardcoded into them, but use them in a campaign_script and the script fails. The ONLY commands you can use in a script, are the ones released by CA that were designed for the script. They have specific export and trigger requirements that commands in other files do not have. You simply cannot pull stuff from other files and expect it to work in a script.
    Dude, drop the attitude, I'm not an idiot. I was following CA's docudemons. call_object_shortcut asks as parameters the ui object name and the shortcut name. In this case, card_manager and deselect_all, as you could have seen by checking descr_shortcuts. Now, CA's documentation is full of stuff that doesn't work as advertised and so my hope would be that someone had a better idea on the subject - like to say that it worked without the ui object name, or that the shortcut should be called strat_deselect_cards (there is such string inside the kingdoms .exe, btw) or something.



    Quote Originally Posted by GrnEyedDvl View Post
    I still say the best way is to build a proper trigger unless you are doing something that requires the character to be selected, like my Hire Ancillaries script. Otherwise narrow down the conditions so you can apply a trigger to a single character.
    I need the assignment via script, otherwise I can't guarantee uniqueness.

  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: Question about ancillaries

    Quote Originally Posted by BozosLiveHere View Post
    Dude, drop the attitude, I'm not an idiot.
    There is no attitude here, except yours. If you felt I was talking down by trying to explain something, that is your fault, not mine. I have no idea what you do or do not know, so I stated the obvious.



    I was following CA's docudemons. call_object_shortcut asks as parameters the ui object name and the shortcut name. In this case, card_manager and deselect_all, as you could have seen by checking descr_shortcuts.
    You were trying to call a battle map shortcut on the strat map. The card_manager only appears on the battle map. On the strat map its called the campaign_hud.




    Now, CA's documentation is full of stuff that doesn't work as advertised and so my hope would be that someone had a better idea on the subject - like to say that it worked without the ui object name, or that the shortcut should be called strat_deselect_cards (there is such string inside the kingdoms .exe, btw) or something.
    I doubt that will work either, as you are talking about cards not characters. The SelectCharacter does not fire when you select his card. You have to select him on the strat map, or through the Armies interface. If he is inside a city and you select his card, the event reference is still SettlementSelected, not CharacterSelected.



    I need the assignment via script, otherwise I can't guarantee uniqueness.
    What kind of trait are you giving that has to be that unique?? Traits arent designed to be for single characters, though you can make a few that way.


    There are two ways to handle it. First is by firing the conditions when you select the character. But that doesnt work for AI characters.

    Second is add more conditions or even set an EventCounter then use that as your event for assigning the trait. Without knowing what you are trying to assign, I cant be more specific, but I can give a few examples.

    If you are trying to assign it to the governor of a specific settlement, use GovernorAttrribute along with the SettlementName. It doesnt matter if there are 20 characters in the settlement, only 1 can be governor.

    Build several triggers and tie it to region by using the IsRegionOneOf. Long but it works.

    Do it in stages. Build some hidden traits that have no real effect on anything, but can be used as a check for future traits. I use magic for this. Magic doesnt work for any agent type other than priests, so you can give a general +10 magic and it doesnt do a damn thing for him, but you can check his magic level when assigning future traits.

  19. #19

    Default Re: Question about ancillaries

    This may be a little over my head at the moment, but what about the stuff in the campaign_script at the starting script for new campaign part.

    select_ui_element faction_button
    simulate_mouse_click lclick_up

    Couldn't that be put to use here? Not neccecarily all of it but the simulate_mouse_click ?

  20. #20
    Opifex
    Join Date
    Feb 2005
    Location
    New York, USA
    Posts
    15,154

    Default Re: Question about ancillaries

    Wait, someone tell me why can't you like, create a dummy character, select it, then kill it?


    "If ye love wealth greater than liberty,
    the tranquility of servitude greater than
    the animating contest for freedom, go
    home from us in peace. We seek not
    your counsel, nor your arms. Crouch
    down and lick the hand that feeds you,
    and may posterity forget that ye were
    our countrymen."
    -Samuel Adams

Page 1 of 2 12 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
  •