Results 1 to 4 of 4

Thread: Trait Trigger Structure Question

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Live2sculpt's Avatar Senator
    Join Date
    Sep 2009
    Location
    MI, U.S.A.
    Posts
    1,146

    Default Trait Trigger Structure Question

    I am moving through educating myself on the function of various lines in triggers and traits. Catching on well in some cases. But one part that I haven't caught on is the loss of traits.

    There are Levels to traits, there are Antitraits, and I've noticed Triggers to traits called Cleanup. But I'm not catching on yet.

    How should I go about making a one-turn-only trait remove itself in the following turn?

    And is it possible to give a character a trait within the same turn it is assigned anyway?

    The objective being to affect a character with a special seasonal condition on a single turn. Would I have to structure the trigger to fire in the previous turn for it to take affect within the turn intended?

    This is the current trigger structure.

    Spoiler Alert, click show to read: 
    ;-------------
    Trigger Miserable1
    WhenToTest CharacterTurnEnd

    Condition IsGeneral
    and not FactionReligion islam
    and RandomPercent < 21
    and not EndedInSettlement
    and EventCounterType season_miserable
    and not FactionType slave
    and IsRegionOneOf 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83 ,84, 85, 86, 87, 88, 89, 90, 92, 93, 95, 96, 97, 98, 99, 101, 102, 103, 104, 105, 108, 119

    Affects Miserable Chance 100


    Thanks.
    Last edited by Live2sculpt; February 07, 2011 at 12:19 PM.

  2. #2
    Darkstar's Avatar Senator
    Join Date
    Feb 2007
    Location
    Massachusetts, USA
    Posts
    1,032

    Default Re: Trait Trigger Structure Question

    Use WhenToTest CharacterTurnStart to fire your trigger and then use the cleanup trigger below to remove it.

    Here's a simple cleanup trigger:

    ;------------------------------------------
    Trigger cleanup_miserable
    WhenToTest CharacterTurnEnd

    Condition Trait Miserable = 1

    Affects Miserable -1 Chance 100
    Last edited by Darkstar; February 07, 2011 at 01:49 PM.

  3. #3
    Live2sculpt's Avatar Senator
    Join Date
    Sep 2009
    Location
    MI, U.S.A.
    Posts
    1,146

    Default Re: Trait Trigger Structure Question

    Hmmmmm.. I did this....

    Spoiler Alert, click show to read: 
    ;;;;;;;;;;;;;;;;;;;;;;EXPORT_VNVS.TXT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    {Season_miserable} Plagued by Terrible Conditions
    {Season_Miserable_desc} The soldiers are falling ill to the unexpectedly miserable weather.
    {Season_Miserable_effects_desc} Greatly lowered Command, Morale, and Loyalty. Movment reduced.
    {Season_Desert} The Sun's Anvil
    {Season_Desert_desc} The summer air is smothering. Weapons and armor burn to the touch. Soldiers show wisdom in clinging to the shade.
    {Season_Desert_effects_desc} Greatly lowered Morale and Loyalty. Movement reduced.
    {Season_Sandstorms} Thwarted by Sandstorms
    {Season_Sandstorms_desc} Seasonal winds have buffeted this force with blinding Sandstorms.
    {Season_Sandstorms_effects_desc} Line of Sight reduced. Morale lowered. Movment slowed to a crawl.

    ;;;;;;;;;;;;;;;;;;;;;;EXPORT_DESCR_VNVS_ENUMS.TXT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    Season_Miserable
    Season_Miserable_desc
    Season_Miserable_effects_desc
    Season_Desert
    Season_Desert_desc
    Season_Desert_effects_desc
    Season_Sandstorms
    Season_Sandstorms_desc
    Season_Sandstorms_effects_desc


    ;;;;;;;;;;;;;;;;;;Traits;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    ;---------------
    Trait Miserable
    Characters family

    Level Season_miserable
    Description Season_Miserable_desc
    EffectsDescription Season_Miserable_effects_desc
    Threshold 1

    Effect Command -6
    Effect TroopMorale -6
    Effect Loyalty -6
    Effect Unrest 6
    Effect MovementPoints -10

    ;This Trait is for Characters leading armies through cold and miserable Winter weather.

    ;---------------
    Trait Desert
    Characters family

    Level Season_Desert
    Description Season_Desert_desc
    EffectsDescription Season_Desert_effects_desc
    Threshold 1

    Effect Command -4
    Effect TroopMorale -6
    Effect Loyalty -8
    Effect Unrest 8
    Effect MovementPoints -20

    ;This Trait is for Characters leading armies through a desert region during Summer.

    ;---------------
    Trait Sandstorm
    Characters family

    Level Season_Sandstorms
    Description Season_Sandstorms_desc
    EffectsDescription Season_Sandstorms_effects_desc
    Threshold 1

    Effect LineOfSight -20
    Effect TroopMorale -4
    Effect Loyalty -4
    Effect Unrest 4
    Effect MovementPoints -30

    ;;;;;;;;;;;;;;;;;;;;;;;;;;Triggers;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    ;-------------
    Trigger Miserable1
    WhenToTest CharacterTurnStart

    Condition IsGeneral
    and not FactionReligion islam
    and RandomPercent < 21
    and not EndedInSettlement
    and EventCounterType season_miserable
    and not FactionType slave
    and IsRegionOneOf 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83 ,84, 85, 86, 87, 88, 89, 90, 92, 93, 95, 96, 97, 98, 99, 101, 102, 103, 104, 105, 108, 119

    Affects Miserable Chance 100
    ;-------------

    Trigger Sandstorms1
    WhenToTest CharacterTurnStart

    Condition IsGeneral
    and not FactionReligion islam
    and RandomPercent < 51
    and not EndedInSettlement
    and EventCounterType season_sandstorms
    and not FactionType slave
    and IsRegionOneOf 160, 164, 169, 173, 174, 177, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 192, 193, 194, 195, 196, 198, 199

    Affects Sandstorms Chance 100
    ;-------------

    Trigger Desert1
    WhenToTest CharacterTurnStart

    Condition IsGeneral
    and not FactionReligion islam
    and RandomPercent < 51
    and not EndedInSettlement
    and EventCounterType season_desert
    and not FactionType slave
    and IsRegionOneOf 160, 164, 169, 173, 174, 177, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 192, 193, 194, 195, 196, 198, 199

    Affects Desert Chance 100
    ;-------------

    Trigger Miserable2
    WhenToTest CharacterTurnStart

    Condition IsGeneral
    and FactionReligion islam
    and RandomPercent < 51
    and not EndedInSettlement
    and EventCounterType season_miserable
    and not FactionType slave
    and IsRegionOneOf 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83 ,84, 85, 86, 87, 88, 89, 90, 92, 93, 95, 96, 97, 98, 99, 101, 102, 103, 104, 105, 108, 119

    Affects Miserable Chance 100
    ;-------------

    Trigger Sandstorms2
    WhenToTest CharacterTurnStart

    Condition IsGeneral
    and FactionReligion islam
    and RandomPercent < 21
    and not EndedInSettlement
    and EventCounterType season_sandstorms
    and not FactionType slave
    and IsRegionOneOf 160, 164, 169, 173, 174, 177, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 192, 193, 194, 195, 196, 198, 199

    Affects Sandstorms Chance 100
    ;-------------

    Trigger Desert2
    WhenToTest CharacterTurnStart

    Condition IsGeneral
    and FactionReligion islam
    and RandomPercent < 21
    and not EndedInSettlement
    and EventCounterType season_desert
    and not FactionType slave
    and IsRegionOneOf 160, 164, 169, 173, 174, 177, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 192, 193, 194, 195, 196, 198, 199

    Affects Desert Chance 100

    Trigger cleanup_miserable
    WhenToTest CharacterTurnEnd

    Condition Trait Miserable = 1

    Affects Miserable -1 Chance 100

    Trigger cleanup_desert
    WhenToTest CharacterTurnEnd

    Condition Trait Desert = 1

    Affects Desert -1 Chance 100

    Trigger cleanup_sandstorms
    WhenToTest CharacterTurnEnd

    Condition Trait Sandstorms = 1

    Affects Sandstorms -1 Chance 100



    And the Error log gives me this......

    Spoiler Alert, click show to read: 
    11:12:17.135 [system.rpt] [always] CPU: SSE2
    11:12:17.137 [system.rpt] [always] ==== system log start, build date: Feb 25 2008 version development ===
    11:12:17.159 [system.io] [always] mounted pack packs/data_0.pack
    11:12:17.159 [system.io] [always] mounted pack packs/data_1.pack
    11:12:17.159 [system.io] [always] mounted pack packs/data_2.pack
    11:12:17.159 [system.io] [always] mounted pack packs/data_3.pack
    11:12:17.159 [system.io] [always] mounted pack packs/data_4.pack
    11:12:17.169 [system.io] [always] mounted pack packs/localized.pack
    11:12:55.614 [game.script] [error] Condition parsing error in mods/DLV_ext/data/export_descr_character_traits.txt, at line 40486, column 21
    Trait not recognised
    11:19:33.380 [game.script] [error] Trigger processing error in <Miserable1>
    : <event_counter> is unavailable from event <CharacterTurnStart>
    when testing <EventCounterType> condition
    11:19:33.381 [game.script] [error] Trigger processing error in <Desert1>
    : <event_counter> is unavailable from event <CharacterTurnStart>
    when testing <EventCounterType> condition
    11:23:18.502 [system.rpt] [error] Medieval 2: Total War encountered an unspecified error and will now exit.


    Gotta go to a meeting and then the gym.
    I hope someone can tell me where i went wrong when I get back to it tonight.
    Last edited by Live2sculpt; February 09, 2011 at 01:35 PM.

  4. #4
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,751
    Blog Entries
    3

    Default Re: Trait Trigger Structure Question

    The message you got specifically means that the export list for the event CharacterTurnStart does not contain event_type which specified by the EventCounterType condition as being a requirement. Run it through my ATVTW validator and it will catch these types of errors.
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

Posting Permissions

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