Page 2 of 2 FirstFirst 12
Results 21 to 33 of 33

Thread: Bonus when army reaches a specific location

  1. #21
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: Bonus when army reaches a specific location

    Ok, so now I see some light in the end of the tunnel, thanks guys.

    My plans changed.
    I will no more use forts, since I cant spawn armies inside them via script. I actually dont need forts since my ruins have no walls, gates or arrow towers.
    So I think I will use custom tiles instead, spawn the army of the new faction over it, make it "locked", and change the ancillaries file so anciallies will only be give when a general wins a battle against that new faction.

    Two things come to mind. Will the AI eventually attack these armies? Would they do if they were inside forts instead of the custom tile?
    Is there a way how to avoid these armies from fleeing from battle field and consequently moving away in the strat map after the battle? (maybe "cant_withdraw" in EDU for the units)

  2. #22
    nadalio's Avatar Civis
    Join Date
    Apr 2016
    Location
    Where the nameless things gnawing the earth
    Posts
    116

    Default Re: Bonus when army reaches a specific location

    Amazing Features!!!
    I have this ideas...i hope could be useful..
    When an army reach a place..

    Rewards:


    Ancillaries (Reliquaries of the first age, magic ring's ecc) and traits that trigger if the general enters the place or defeat the enemy of the place.

    -Money

    -knowledge to build special buildings or weapons and armors upgrade

    -special units / heroes (A powerful general with high traits)

    -Allies: Ex. Mordor conquer and hold a ruin where lives a dragon. The faction could ask alliance with it and have it as a unit.

    -Resources


    Dangers:


    -Death: An assassin agent (custom Strat model of a wraith/lich) limited to the settlement that will try to kill the captain or the general.
    This will make things more interesting, because you will have to visit the place with powerful characters to resist the attempt of assassination (Special traits and ancillaries). More you remain near the cursed place, more the wraith (assassin) will try to kill the charaters.
    Example:
    Barrow downs, you can go there and try to find treasures etc..
    with a hobbit general. It could be killed by the wraith.

    N.B
    Could be a version where a unit attack the general.
    Example:
    Stone troll lair custom tile, a general unit goes there, if they beat the stone trolls they coluld find old swords and chain mails Ancillaries. Like the hobbit

    -Bribe: A diplomat will bribe the general/captain that will pass to the "dark side". It could be for different reasons:
    A)The find a treasure, so they could rebel if they haven't enough loyality.

    B)A spell from a witch that "zombificate" the unit.

    C)werewolf curse from the attack by a werewolf unit: if the player/AI loose, the survived units will become formed by werewolves. (Spawn a new werewolf unit maybe?)

    These reasons will make the game play more interesting because every time that AI or player visit the unit it will make the place more dangerous.


    Let me know if i could give you my help in some way

  3. #23
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: Bonus when army reaches a specific location

    nevermind
    Last edited by leo.civil.uefs; August 26, 2019 at 10:45 PM.

  4. #24
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: Bonus when army reaches a specific location

    As far as I know, enemy armies over roads or ports will block them, preventing trade with neighboor regions and thus reducing profit.

    Is it possible to somehow have the same effect over resources itself?
    I mean, when an army is over the resource, it gets blocked and excluded from the trade until the army is removed.

    Maybe using the merchant mechanics...

    Any ideas?
    Last edited by leo.civil.uefs; August 27, 2019 at 04:21 PM.

  5. #25
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: Bonus when army reaches a specific location

    As you know what I want is:

    If the player/or the AI wins a battle against an specific army, the ancillaries will be given to the victorious general.
    Now, that could be made using conditions that simply says "wins against specific faction" (I would implement a new faction in the game), but if not possible, it could be something related to units (I could simply create new units to be used specifically on this), so the conditions would be something like "destroys specified unit".

    So I've made some research in the docudemons file looking for a condition to be used in the descr_export_ancillaries.txt file and found the following.


    Code:
    Identifier:    I_BattnemyArmyNumberOfUnitsSample use:    I_BattnemyArmyNumberOfUnits > 5
    Description:    Test size of army
    Battle or Strat:    Battle
    Class:    BATTLE_ENEMY_ARMY_NUMBER_UNITS
    
    
    Identifier:    NumKilledGenerals
    Trigger requirements:    character_record
    Parameters:    logic token, test value
    Sample use:    NumKilledGenerals > 3
    Description:    Test to see how many generals were killed
    Battle or Strat:    Either
    Class:    GENERALS_ARMY_KILLED_GENERALS_TEST
    
    
    Identifier:    PercentageEnemyKilled
    Trigger requirements:    character_record
    Parameters:    logic token, test value
    Sample use:    PercentageEnemyKilled > 35.8
    Description:    Test to see what percentage of the enemy was killed in the prior battle
    Battle or Strat:    Either
    Class:    PERCENTAGE_OF_ENEMY_KILLED_TEST
    
    
    Identifier:    I_PercentageOfArmyKilled
    Trigger requirements:    
    Parameters:    alliance_index army_index logic_token percentage
    Sample use:    I_PercentageOfArmyKilled 1 0 < 50
    Description:    Tests the percentage of casualties taken by the specified army during this battle
    Battle or Strat:    Battle
    Class:    BATTLE_PERCENTAGE_OF_ARMY_KILLED
    
    
    Identifier:    I_WonBattle
    Trigger requirements:    
    Parameters:    None
    Sample use:    I_WonBattle romans_julii
    Description:    Did the faction win the battle just fought?
    Battle or Strat:    Either
    Class:    I_WON_BATTLE
    
    
    
    
    Identifier:    I_PercentageUnitGroupKilled
    Trigger requirements:    
    Parameters:    group_label logic_token percentage
    Sample use:    I_PercentageUnitGroupKilled roman_archers < 50
    Description:    Tests the percentage of men lost from the unit group
    Battle or Strat:    Battle
    Class:    PERCENTAGE_UNIT_GROUP_KILLED
    
    
    Identifier:    I_IsUnitGroupDestroyed
    Trigger requirements:    
    Parameters:    group_label
    Sample use:    I_IsUnitGroupDestroyed group1
    Description:    Is the unit group destroyed (killed or routed)
    Battle or Strat:    Battle
    Class:    IS_UNIT_GROUP_DESTROYED
    
    
    Identifier:    I_UnitDestroyed
    Trigger requirements:    
    Parameters:    unit_label
    Sample use:    I_UnitDestroyed roman_archers
    Description:    Has the specified unit been wiped out?
    Battle or Strat:    Battle
    Class:    UNIT_DESTROYED
    
    
    Identifier:    I_PercentageUnitKilled
    Trigger requirements:    
    Parameters:    unit_label logic_token percentage
    Sample use:    I_PercentageUnitKilled roman_archers > 50
    Description:    Tests the percentage of men lost from the specified unit
    Battle or Strat:    Battle
    Class:    PERCENTAGE_UNIT_KILLED
    
    
    Identifier:    GeneralFoughtFaction
    Trigger requirements:    character_record
    Parameters:    faction type
    Sample use:    GeneralFoughtFaction romans_julii
    Description:    Test to see whether the opponent was of a particular faction in the prior battle
    Battle or Strat:    Either
    Class:    FOUGHT_FACTION
    Any hint from the code masters? I'm in the darkness here, guys.
    Last edited by leo.civil.uefs; September 07, 2019 at 01:36 AM.

  6. #26

    Default Re: Bonus when army reaches a specific location

    I will check the eb ii triggers to see if something comes up as well a few other mods. Honestly though I am not sure it can be done without knowing who the victorious general is. It may take a few days due to the hurricane that just passed by, there is a lot of yard cleanup to do. It may be easier to tie the ancillary down to a location then a person.

  7. #27

    Default Re: Bonus when army reaches a specific location

    In EBII if you defeatet pikemanunits,
    some factions can recrute these units,
    thanks to an custom attributes.

  8. #28
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: Bonus when army reaches a specific location

    OK, I always get amazed when something is so simple to do.

    It seems to work perfectly. I did this as a test.
    Everytime any general fights and win a battle against milan, the ancillary is given to him. Exactly what I wanted.
    Now I just need to use a non playbale faction in place of milan.
    I think I will use the PAPAL_ESTATES from TATW since they are not playable by player or AI, I guess.

    Any warnings?

    Code:
    Trigger emeralds_girion
        WhenToTest PostBattle
        Condition IsGeneral
        and WonBattle
    	and GeneralFoughtFaction milan
    
    
        AcquireAncillary emeralds_girion chance  100

  9. #29
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: Bonus when army reaches a specific location

    This is something different.
    Im now trying to create a TRAIT.

    Here's what I have:

    The Trait in export_descr_character_traits.txt

    Code:
    Trait Blessed_in_men_temple
        Characters family
        ExcludeCultures greek, southern_european, eastern_european, middle_eastern
        Hidden
            AntiTraits Drink, Arse, BadDisciplinarian, Coward, Slothful, Xenophilia, PublicAtheism, Aesthetic, Ignorance, Gambling, Liar, Embezzler, Corrupt, Disloyal, Unjust, Perverted, Talkative, Superstitious, ExpensiveTastes, Insane, Lewd, ExoticTastes, Corrupted, WaveringFaith, Doomsayer, WaningConviction, Cursed, ReligiousInactivity
    
    
        Level Blessed_in_men
            Description Blessed_in_men_desc
            EffectsDescription Blessed_in_men_effects_desc
        GainMessage Blessed_in_men_gain_desc
            Threshold  1
    The Trigger in export_descr_character_traits.txt

    Code:
    Trigger Blessed_in_men_temple
    
    
        WhenToTest CharacterTurnEnd
        
        Condition IsGeneral
        and EndedInSettlement 
        and SettlementName Ithilien_Temple
        and CharacterIsLocal
    
    
        Affects Blessed_in_men_temple  1  Chance  100
    Code:
    The entry in export_VnVs.txt
    
    {Blessed_in_men}    Blessed
    
    
    {Blessed_in_men_desc}
    This general was blessed in a temple of his ancestors and got rid of vices
    
    
    {Blessed_in_men_gain_desc}
    This general was blessed in a temple of his ancestors and got rid of vices
    
    
    {Blessed_in_men_effects_desc}
    Clean of vices
    To test, I conquer the settlement with a general but when I press the end turn button the game crashes.

  10. #30

    Default Re: Bonus when army reaches a specific location

    Well, first you should use always Capital letters in the trait, so instead of Blessed_in_men it should be Blessed_In_Men
    Second, don't use Antitraits, in fact, remove that line entirely, Antitraits are broken in M2TW. You should use the triggers to avoid giving that trait to Generals with traits that you don't want or create more triggers to remove the bad traits when a General has the blessed trait.
    Thirdly, you have the trait set as Hidden but then you added a description, so I guess the trait is meant to appear right? So delete the Hidden line too.

    The rest should work but you will need to add more triggers to remove the bad traits if a General has the Blessed one.

  11. #31
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: Bonus when army reaches a specific location

    Thanks for the simple but very useful answer!

    Quote Originally Posted by Lusitanio View Post
    The rest should work but you will need to add more triggers to remove the bad traits if a General has the Blessed one.
    Would you show me a sample of how to do this?

  12. #32

    Default Re: Bonus when army reaches a specific location

    Quote Originally Posted by leo.civil.uefs View Post
    Thanks for the simple but very useful answer!



    Would you show me a sample of how to do this?
    See this example, I renamed your trait to Temple_Blessed because it is easier and it's never good to have long trait names. The FM gets the Blessed trait at turn end and at turn start there is a series of triggers that remove his bad traits, you have to put the exact level and the threshold. Hope this example helps, you can already put it since I used the TATW edct.

    Spoiler Alert, click show to read: 
    Code:
    Trigger Blessed1
        WhenToTest CharacterTurnEnd
        
        Condition IsGeneral
              and EndedInSettlement 
              and SettlementName Ithilien_Temple
              and CharacterIsLocal
    
    
    
    
        Affects Temple_Blessed  1  Chance  100
    ;------------------------------------------
    Trigger Blessed2
        WhenToTest CharacterTurnStart
    
    
        Condition CharacterIsLocal
              and Trait Temple_Blessed > 0
              and Trait Drink = 4
    
    
    
    
      Affects Drink  -6 Chance 100
    
    
    ;------------------------------------------
    Trigger Blessed3
        WhenToTest CharacterTurnStart
    
    
        Condition CharacterIsLocal
              and Trait Temple_Blessed > 0
              and Trait Drink = 5
    
    
    
    
      Affects Drink  -12 Chance 100
    
    
    ;------------------------------------------
    Trigger Blessed4
        WhenToTest CharacterTurnStart
    
    
        Condition CharacterIsLocal
              and Trait Temple_Blessed > 0
              and Trait Drink = 6
    
    
    
    
      Affects Drink  -30 Chance 100
    
    
    ;------------------------------------------
    Trigger Blessed5
        WhenToTest CharacterTurnStart
    
    
        Condition CharacterIsLocal
              and Trait Temple_Blessed > 0
              and Trait Arse = 1
    
    
    
    
      Affects Arse  -1 Chance 100
    
    
    ;------------------------------------------
    Trigger Blessed6
        WhenToTest CharacterTurnStart
    
    
        Condition CharacterIsLocal
              and Trait Temple_Blessed > 0
              and Trait Arse = 2
    
    
    
    
      Affects Arse  -4 Chance 100
    
    
    ;------------------------------------------
    Trigger Blessed7
        WhenToTest CharacterTurnStart
    
    
        Condition CharacterIsLocal
              and Trait Temple_Blessed > 0
              and Trait Arse = 3
    
    
    
    
      Affects Arse  -8 Chance 100
    
    
    ;------------------------------------------
    Trigger Blessed8
        WhenToTest CharacterTurnStart
    
    
        Condition CharacterIsLocal
              and Trait Temple_Blessed > 0
              and Trait Arse = 4
    
    
    
    
      Affects Arse  -16 Chance 100
    
    
    ;------------------------------------------
    Trigger Blessed9
        WhenToTest CharacterTurnStart
    
    
        Condition CharacterIsLocal
              and Trait Temple_Blessed > 0
              and Trait BadDisciplinarian = 1
    
    
    
    
      Affects Drink  -2 Chance 100
    
    
    ;------------------------------------------
    Trigger Blessed10
        WhenToTest CharacterTurnStart
    
    
        Condition CharacterIsLocal
              and Trait Temple_Blessed > 0
              and Trait BadDisciplinarian = 2
    
    
    
    
      Affects Drink  -4 Chance 100
    
    
    ;------------------------------------------
    Trigger Blessed11
        WhenToTest CharacterTurnStart
    
    
        Condition CharacterIsLocal
              and Trait Temple_Blessed > 0
              and Trait BadDisciplinarian = 3
    
    
    
    
      Affects Drink  -8 Chance 100
    
    
    ;------------------------------------------

  13. #33
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: Bonus when army reaches a specific location

    Quote Originally Posted by nadalio View Post
    Amazing Features!!!
    I have this ideas...i hope could be useful...
    Sorry man, only now I saw your comment, my bad.

    Thanks for the ideas.
    After studying the possibilities I've implemented the new system as possible in the game, with everything I could include.

Page 2 of 2 FirstFirst 12

Posting Permissions

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