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

Thread: Eliminating Adoptions

Hybrid View

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

    Default Eliminating Adoptions

    I have been trying to find a way to remove the human player's ability to adopt characters into their faction's family. In case you are wondering why it is because I'm working on a RS2 sub-mod in which I want to make keeping Augustus alive one of the conditions for victory. I'm aware of the survivor code in alex, but that only works if the character is the faction leader in descr_strat, and this sub-mod begins with Julius as the faction leader, and Octavius as the heir.

    My first thought was to remove all references to adoptions within every file of the game. This only resulted in an end of turn CTD.


    Then I was thinking one could use select_ui_element with simulate mouse click to make the script automatically decline any offers for adoption. However, I am unable to find anything related to the adoption offer message within the
    available_ui_element_ids.txt file listed here: http://forums.totalwar.org/vb/showth...325#post929325

    Has anyone been able to figure out how to do this or have any suggestions?
    Last edited by CPT Worsham; March 30, 2011 at 09:53 AM.

  2. #2

    Default Re: Eliminating Adoptions

    How about giving Augustus a special ancillary and then testing for it with a script WorldwideAncillaryExists


  3. #3

    Default Re: Eliminating Adoptions

    Quote Originally Posted by Hannibal Smith View Post
    How about giving Augustus a special ancillary and then testing for it with a script WorldwideAncillaryExists
    Hannibal,

    I don't understand your concept. Can you be more specific?
    Last edited by CPT Worsham; March 30, 2011 at 10:13 AM.

  4. #4
    makanyane's Avatar Praeses
    Content Emeritus

    Join Date
    Feb 2006
    Posts
    9,093
    Blog Entries
    1

    Default Re: Eliminating Adoptions

    Presumably that's test the ancillary exists each turn via script and kill the faction if it doesn't?

    Quote Originally Posted by wlesmana
    I know a way to keep any faction from getting any new general ever but not just from adoption.
    failing to give them a general_unit in EDU?
    think I achieved that by mistake a few times

  5. #5

    Default Re: Eliminating Adoptions

    Quote Originally Posted by makanyane View Post
    Presumably that's test the ancillary exists each turn via script and kill the faction if it doesn't?
    Great idea!

  6. #6
    wlesmana's Avatar ILIKE2MOVEITMOVEIT
    Join Date
    Jul 2005
    Location
    Indonesia
    Posts
    411

    Default Re: Eliminating Adoptions

    Another way is to give Augustus a special trait unattainable by anyone else and this trait combined with being a faction leader would produce an ancillary. This way you can check if and when Augustus is made faction leader.

    I don't know of any way to keep the player from adopting. I know a way to keep any faction from getting any new general ever but not just from adoption.

  7. #7
    HouseOfHam's Avatar Primicerius
    Join Date
    Apr 2007
    Location
    Minnesota, USA
    Posts
    3,030

    Default Re: Eliminating Adoptions

    I think it's better to use a trait for it, because player can circumvent the ancillary check by passing it to another character.

    - Create a hidden trait (for example, IAmAugustus), with no triggers
    - Give that trait to Augustus via descr_strat.txt
    - Add a background script to your mod, if it doesn't already have one, and have it check for that trait:
    Code:
    declare_counter isAugustusAlive
    
    ; at the beginning of a new turn, we don't know if Augustus is still alive
    monitor_event FactionTurnStart FactionType romans
      set_counter isAugustusAlive 0
    end_monitor
    
    ; check all characters to see if any of them have that trait
    monitor_event CharacterTurnStart FactionType romans
               and Trait IAmAugustus > 0
      set_counter isAugustusAlive 1
    end_monitor
    
    ; if none of them had it, game is over
    monitor_event FactionTurnEnd FactionType romans
               and I_CompareCounter isAugustusAlive = 0
      console_command kill_faction romans ; or surrender_regions
    end_monitor
    The only downside to this is that player gets to play an extra turn if Augustus dies.

    Last edited by HouseOfHam; March 30, 2011 at 12:26 PM. Reason: Trait > 0
    RTR website/SVN admin

    - Settlement coordinate locator -for RTW/M2TW
    - EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
    - RTW scripting tutorials
    - n-turns per year script generator

  8. #8

    Default Re: Eliminating Adoptions

    Quote Originally Posted by HouseOfHam View Post
    I think it's better to use a trait for it, because player can circumvent the ancillary check by passing it to another character.

    - Create a hidden trait (for example, IAmAugustus), with no triggers
    - Give that trait to Augustus via descr_strat.txt
    - Add a background script to your mod, if it doesn't already have one, and have it check for that trait:
    Code:
    declare_counter isAugustusAlive
    
    ; at the beginning of a new turn, we don't know if Augustus is still alive
    monitor_event FactionTurnStart FactionType romans
      set_counter isAugustusAlive 0
    end_monitor
    
    ; check all characters to see if any of them have that trait
    monitor_event CharacterTurnStart FactionType romans
               and Trait IAmAugustus > 1
      set_counter isAugustusAlive 1
    end_monitor
    
    ; if none of them had it, game is over
    monitor_event FactionTurnEnd FactionType romans
               and I_CompareCounter isAugustusAlive = 0
      console_command kill_faction romans ; or surrender_regions
    end_monitor
    The only downside to this is that player gets to play an extra turn if Augustus dies.

    An even better idea! Thanks all!

  9. #9

    Default Re: Eliminating Adoptions

    Quote Originally Posted by HouseOfHam View Post
    I think it's better to use a trait for it, because player can circumvent the ancillary check by passing it to another character.

    - Create a hidden trait (for example, IAmAugustus), with no triggers
    - Give that trait to Augustus via descr_strat.txt
    - Add a background script to your mod, if it doesn't already have one, and have it check for that trait:
    Code:
    declare_counter isAugustusAlive
    
    ; at the beginning of a new turn, we don't know if Augustus is still alive
    monitor_event FactionTurnStart FactionType romans
      set_counter isAugustusAlive 0
    end_monitor
    
    ; check all characters to see if any of them have that trait
    monitor_event CharacterTurnStart FactionType romans
               and Trait IAmAugustus > 1
      set_counter isAugustusAlive 1
    end_monitor
    
    ; if none of them had it, game is over
    monitor_event FactionTurnEnd FactionType romans
               and I_CompareCounter isAugustusAlive = 0
      console_command kill_faction romans ; or surrender_regions
    end_monitor
    The only downside to this is that player gets to play an extra turn if Augustus dies.

    I didnt realise you could do this with a hidden trait, its a better method if its hidden. I wanted to do a similar thing, but give all starting characters a key character trait. Then kill off the faction if when these influencial characters die/are killed. In an effort to make the player go after characters rather than settlements.


  10. #10
    HouseOfHam's Avatar Primicerius
    Join Date
    Apr 2007
    Location
    Minnesota, USA
    Posts
    3,030

    Default Re: Eliminating Adoptions

    ps: You'll probably also want to add FactionIsLocal condition, since AI wouldn't know it's supposed to keep Augustus alive.
    RTR website/SVN admin

    - Settlement coordinate locator -for RTW/M2TW
    - EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
    - RTW scripting tutorials
    - n-turns per year script generator

  11. #11

    Default Re: Eliminating Adoptions

    Well it seems like a pretty straight forward concept, but it is not working for me as I get an instant CTD as soon as I hit the end of turn button. Here is what I got:

    background_script.txt
    Spoiler Alert, click show to read: 
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Augustus Survivor

    declare_counter isAugustusAlive

    ; at the beginning of a new turn, we don't know if Augustus is still alive
    monitor_event FactionTurnStart FactionType romans_brutii
    and FactionIsLocal
    set_counter isAugustusAlive 0
    end_monitor

    ; check all characters to see if any of them have that trait
    monitor_event CharacterTurnStart FactionType romans_brutii
    and FactionIsLocal
    and Trait IAmAugustus > 1
    set_counter isAugustusAlive 1
    end_monitor

    ; if none of them had it, game is over
    monitor_event FactionTurnEnd FactionType romans_brutii
    and FactionIsLocal
    and I_CompareCounter isAugustusAlive = 0
    console_command kill_faction romans_brutii
    end_monitor

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End Augustus Survivor


    export_descr_character_traits.txt
    Spoiler Alert, click show to read: 
    ;------------------------------------------
    Trait IAmAugustus
    Characters family
    Hidden
    ExcludeCultures carthaginian, eastern, egyptian, barbarian, greek
    NoGoingBackLevel 1

    Level IAmAugustus
    Description IAmAugustus_desc
    EffectsDescription IAmAugustus_effects_desc
    Threshold 10

    Effect Influence 1
    Effect TroopMorale 1

    ;------------------------------------------


    export_VnVs.txt

    Spoiler Alert, click show to read: 
    ¬--------------------

    {IAmAugustus} Survivor

    {IAmAugustus_desc}
    .

    {IAmAugustus_effects_desc}
    .

    ¬--------------------


    descr_strat.txt

    Spoiler Alert, click show to read: 
    ; --------------------
    character GaiusA Julius_Caesar, named character, heir, age 16, , x 170, y 125, portrait Octavius
    traits StayingAlive 1 , NightBattleCapable 1 , Patrician 1 , Quaestor 1 , IAmAugustus 1 , Civil_Career_Restriction 5 , RomanCivilPrestiage 4 , Personality_Intelligent 2 , Disciplinarian 2 , PublicFaith 4 , GoodAdministrator 3 , InspiringSpeaker 2 , RhetoricSkill 2 , NaturalPhilosophySkill 3 , PoliticsSkill 3 , PlainRomanVirtue 3 , Secretive 3 , TurnsAlive 1 , CharacterAges 1 , Sobriety 3 , Xenophobia 3 , PoeticSkill 1 , MathematicsSkill 2 , PhilosophySkill 1 , ArchitectSkill 3 , Austere 3 , CounterSpy 3 , HighPersonalSecurity 3 , Authoritarian 1 , GoodFarmer 3 , GoodTrader 2 , GoodBuilder 3 , GamesHaterRomanVice 3 , Handsome 3 , Pious_One 3 , Personality_Honest 1 , Personality_Confident 1 , Personality_Considerate 3 , Personality_HardWorking 1 , Personality_Passionate 2 , Personality_Stoic 1 , Personality_Loyal 2 , HatesRomanRebels 1 , Loyal 1
    army
    unit roman armoured general exp 0 armour 0 weapon_lvl 0


    Anyone see a where I did something that would cause an instant CTD upon end of turn?

  12. #12

    Default Re: Eliminating Adoptions

    I am able to get the WorldwideAncillaryExists method to work, but the trait trick only results in CTD for me.

  13. #13
    HouseOfHam's Avatar Primicerius
    Join Date
    Apr 2007
    Location
    Minnesota, USA
    Posts
    3,030

    Default Re: Eliminating Adoptions

    1. Did you remember to remove map.rwm after adding the trait?
    2. Change the trait check to > 0
    3. Comment out the hidden line in trait definition and make sure he actually has the trait and it's not the vnv entry that's causing the CTD
    4. Add console_command give_money romans_brutii, 1 to the 1st 2 monitors to make sure they're working before you hit the end turn button
    RTR website/SVN admin

    - Settlement coordinate locator -for RTW/M2TW
    - EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
    - RTW scripting tutorials
    - n-turns per year script generator

  14. #14

    Default Re: Eliminating Adoptions

    Quote Originally Posted by HouseOfHam View Post
    1. Did you remember to remove map.rwm after adding the trait?
    2. Change the trait check to > 0
    3. Comment out the hidden line in trait definition and make sure he actually has the trait and it's not the vnv entry that's causing the CTD
    4. Add console_command give_money romans_brutii, 1 to the 1st 2 monitors to make sure they're working before you hit the end turn button
    1. Yes
    2. Done
    3. The trait shows up correctly in the character scroll when I comment out the hidden line.
    4. This part seems to be the problem. The console_command add_money romans_brutii, 40000 never activated. Then same as before the game instantly CTD upon hitting the end of turn button.

  15. #15
    makanyane's Avatar Praeses
    Content Emeritus

    Join Date
    Feb 2006
    Posts
    9,093
    Blog Entries
    1

    Default Re: Eliminating Adoptions

    Quote Originally Posted by CPT Worsham View Post
    4. This part seems to be the problem. The console_command add_money romans_brutii, 40000 never activated. Then same as before the game instantly CTD upon hitting the end of turn button.
    have you tried commenting out the kill_faction section - your CTD could perhaps be the faction dying - but not gracefully!

    not sure why the add money isn't working though.... is the script new or is this just something added to an existing working bg script?


    Also HoH - do you know what the 'turn start' order is for RTW - according to Alpaca it's
    The loading order for the TurnStart and TurnEnd events is: CharacterTurn[Start/End], SettlementTurn[Start/End], FactionTurn[Start/End]
    for M2TW - I can't remember or find the info for RTW at the moment - but if it was the same as that you'd be resetting the counter back to zero before turn end......

  16. #16

    Default Re: Eliminating Adoptions

    have you tried commenting out the kill_faction section - your CTD could perhaps be the faction dying - but not gracefully!
    This is in fact the piece of code that creates the CTD. When I comment out kill_faction the CTD goes away, but then again removing that piece defeats the purpose of the monitor.

    not sure why the add money isn't working though.... is the script new or is this just something added to an existing working bg script?
    I added this to my pre-existing bg script. The script works fine without this piece of code. However, it would be nice if this trait check code were to work as it would be a great way to accomplish the intent, and unlike the ancillary the player cannot circumvent it without modding the files.

  17. #17
    HouseOfHam's Avatar Primicerius
    Join Date
    Apr 2007
    Location
    Minnesota, USA
    Posts
    3,030

    Default Re: Eliminating Adoptions

    Quote Originally Posted by CPT Worsham View Post
    This is in fact the piece of code that creates the CTD. When I comment out kill_faction the CTD goes away, but then again removing that piece defeats the purpose of the monitor.
    Try replacing it with surrender_regions. Unless it's a horde faction, it will have the same effect.

    Quote Originally Posted by makanyane View Post
    Also HoH - do you know what the 'turn start' order is for RTW - according to Alpaca it's
    for M2TW - I can't remember or find the info for RTW at the moment - but if it was the same as that you'd be resetting the counter back to zero before turn end......
    I don't believe that's correct. AFAIK, it's FactionTurnStart, SettlementTurnStart, CharacterTurnStart ... CharacterTurnEnd, SettlementTurnEnd, FactionTurnEnd

    But, with minimal changes, you can make it work regardless of what the actual order is. You could even get rid of one monitor:
    Code:
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Augustus Survivor
    
    declare_counter isAugustusAlive
    set_counter isAugustusAlive 0
    
    ; check all characters to see if any of them have that trait
    monitor_event CharacterTurnStart FactionType romans_brutii
              and FactionIsLocal
              and Trait IAmAugustus > 0
        set_counter isAugustusAlive 1
    end_monitor
    
    ; if none of them had it, game is over
    monitor_event FactionTurnEnd FactionType romans_brutii
              and FactionIsLocal
        if I_CompareCounter isAugustusAlive = 0
            console_command surrender_regions romans_brutii
        end_if
        set_counter isAugustusAlive 0
    end_monitor
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End Augustus Survivor
    Last edited by HouseOfHam; March 31, 2011 at 10:59 AM.
    RTR website/SVN admin

    - Settlement coordinate locator -for RTW/M2TW
    - EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
    - RTW scripting tutorials
    - n-turns per year script generator

  18. #18

    Default Re: Eliminating Adoptions

    Try replacing it with surrender_regions. Unless it's a horde faction, it will have the same effect.
    I did this and it did not CTD, and while the end of turn experience was quite amusing it was still not what we are trying to achieve:

    It seems that the monitor does not recognize that the trait exists even though Octavian has it.

  19. #19
    makanyane's Avatar Praeses
    Content Emeritus

    Join Date
    Feb 2006
    Posts
    9,093
    Blog Entries
    1

    Default Re: Eliminating Adoptions

    how's about trying adding

    and I_TurnNumber > 0

    to both monitors - I still suspect the problem is to do with the order somehow

    or just change the initial set clause
    set_counter isAugustusAlive 1

    the second monitor will re-set it to 0 after first turn

  20. #20

    Default Re: Eliminating Adoptions

    Well, my friends, we finally have success as this code is now working as intended. Thank you for your support! I will certainly give you both credit for the functionality of this code when I release the sub-mod.

    Below is how the code is now written in its functioning state. Thanks again!

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Augustus Survivor

    declare_counter isAugustusAlive
    set_counter isAugustusAlive 0

    ; check all characters to see if any of them have that trait
    monitor_event CharacterTurnStart FactionType romans_brutii
    and FactionIsLocal
    and I_TurnNumber > 0
    and Trait IAmAugustus > 0
    set_counter isAugustusAlive 1
    end_monitor

    ; if none of them had it, game is over
    monitor_event FactionTurnEnd FactionType romans_brutii
    and FactionIsLocal
    and I_TurnNumber > 0
    if I_CompareCounter isAugustusAlive = 0
    console_command surrender_regions romans_brutii
    end_if
    set_counter isAugustusAlive 0
    end_monitor

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End Augustus Survivor. Thanks HouseOfHam & Makanyane!

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
  •