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

Thread: Traits and triggers

Hybrid View

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

    Default Traits and triggers

    Hi

    In the export_descr_character_traits.txt file traits and their triggers are seperate, all traits first then all triggers. Does this need to be this way or can I write some traits, then their triggers, then more traits ect.,?

    Any help is appreciated greatly.

  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: Traits and triggers

    The traits have to be first. You cant mix them up.

  3. #3

    Default Re: Traits and triggers

    Cheers for the replyGrnEyedDvl.

    Another question, with triggers all conditions are "and" conditions. Are we able to use some type or "or" statement?

    eg From what I'm doing


    Trigger AttendsMassIncrease
    WhenToTest CharacterTurnEnd

    Condition EndedInSettlement
    and SettlementBuildingExists = small_church or small_church_o
    and AttendsMass < 2

    Affects AttendsMass 1 Chance 12

    Note the "and SettlementBuildingExists = small_church or small_church_o" line containing the or statement.

  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: Traits and triggers

    No you cannot use or in a trigger, just make two triggers. Also if AttendsMass is a trait the condition should be and Trait AttendsMass < 2.

    Moved to text editing and scripting
    Last edited by Squid; April 27, 2009 at 10:12 AM.
    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

  5. #5

    Default Re: Traits and triggers

    Thanks for the help Sqυιd

    Another question.

    How do I refer to a commander being outside of a city/castle and having a priest with him (ie under the agents tab)? Also if I can refer to the priest can I also refer to the priests piety?

    eg

    Condition with character Priest
    and Priest piety <3

    I'm looking for examples in the .txt file but not seeing any.
    Last edited by Pengo; April 25, 2009 at 10:32 PM.

  6. #6
    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: Traits and triggers

    You'd do something like:

    Condition not EndedInSettlement
    and I_CharacterTypeNearCharacterType <faction> general 0 <faction> priest

    There's no way that you check the priests piety level though that I can think of. I'd suggest downloading the M2TW docudemon files as these contain a complete list of events and conditions that you can use.
    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

  7. #7
    Pnutmaster's Avatar Dominus Qualitatium
    Join Date
    Jan 2006
    Location
    Brooklyn, NY
    Posts
    1,572

    Default Re: Traits and triggers

    Quote Originally Posted by Pengo View Post
    [/B]Another question.

    How do I refer to a commander being outside of a city/castle and having a priest with him (ie under the agents tab)? Also if I can refer to the priest can I also refer to the priests piety?
    There is exactly a condition for this (and I believe the priest has to be in his army/under the agent's tab).

    "HighestAttSharedChar"

    ;------------------------------------------
    Trigger CommanderWithPriest_1
    WhenToTest CharacterTurnEnd

    Condition not EndedInSettlement

    and HighestAttSharedChar Piety priest >=3

    Affects Religious 1 Chance 25
    Under the patronage and bound to the service of the
    artist formerly known as Squeakus Maximus
    Stoic Pantheist of S.I.N

  8. #8

    Default Re: Traits and triggers

    Quote Originally Posted by Pnutmaster View Post
    There is exactly a condition for this (and I believe the priest has to be in his army/under the agent's tab).

    "HighestAttSharedChar"
    Make sure PIETY is NOT capitalized for that condition to work. It is picky that way:

    and HighestAttSharedChar Piety priest >=3

    should be

    and HighestAttSharedChar piety priest >=3

    so... this is a nice little trigger to steal for BBB.

    Ebullient Princesses! Titles! Bloodlines! Bastard Traitors!
    So much fun in one little BBB package! Get yours today!

  9. #9

    Default Re: Traits and triggers

    Cheers Pnutmaster, greatly appreciated!
    And you too dearmad

  10. #10

    Default Re: Traits and triggers

    BIGTIME edit... after a lot of testing with that trigger just now... I can't get it to work at all whenusing it for priests... witches appear to work, but priests do not work at all.

    This test one fails:
    Spoiler Alert, click show to read: 

    ;------------------------------------------
    Trigger TravelWithPriest
    WhenToTest CharacterTurnEnd

    Condition not EndedInSettlement
    and IsGeneral
    and HighestAttSharedChar Piety priest >= 3
    and FactionIsLocal

    Affects ReligiousActivity 1 Chance 100

    and "piety" makes it always succeed no matter what...

    Ebullient Princesses! Titles! Bloodlines! Bastard Traitors!
    So much fun in one little BBB package! Get yours today!

  11. #11

    Ebullient Princesses! Titles! Bloodlines! Bastard Traitors!
    So much fun in one little BBB package! Get yours today!

  12. #12
    Pnutmaster's Avatar Dominus Qualitatium
    Join Date
    Jan 2006
    Location
    Brooklyn, NY
    Posts
    1,572

    Default Re: Traits and triggers

    Ugh. I bet that condition was written solely with Witches in mind.
    Under the patronage and bound to the service of the
    artist formerly known as Squeakus Maximus
    Stoic Pantheist of S.I.N

  13. #13

    Default Re: Traits and triggers

    I did some testing and found the same thing. Also:

    I tried swapping the trigger from this "and HighestAttSharedChar piety priest >= 3" to this "and HighestAttSharedChar priest piety >= 3" and exactly the same happens, 100% chance of success. I think its like that line is just ignored.... I'll test

    *edit* I changed the line to this "and HighestAttSharedChar pengo piety >= 3" and again it was a 100% per turn success. Although I was sharing the computer with the commander and my piety is 5, maybe I should change it and do another test

    *edit 2* this is causing rage to build inside! I'm thinking I should just wipe everything, install Ubuntu 9.04 and go live on a mountain!

    Anyway..... Does anyone know whatGrnEyedDvl means when he says "I havent used it but it has a trigger requirement of character_record, so you need to add an event that exports that." I'm working on getting the HighestAttAdjacentChar condition to work as HighestAttSharedChar seems to be a red herring.
    Last edited by Pengo; April 28, 2009 at 06:33 AM.

  14. #14
    konny's Avatar Artifex
    Join Date
    Jul 2007
    Location
    Germania Inferior
    Posts
    3,631

    Default Re: Traits and triggers

    Quote Originally Posted by Pengo View Post
    *edit* I changed the line to this "and HighestAttSharedChar pengo piety >= 3" and again it was a 100% per turn success.
    Have you checked that this only fires for the character that meats the requirements and not for all FMs? My experince with triggers that contain errors (and "pengo" will be considered that by the engine) makes them fire either never or for every character that meats the readable part (here: NotEndedInSettlement).

    Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
    Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
    dHRR 0.8 beta released! get it here
    New: Native America! A mini-mod for Kingdoms America

  15. #15

    Default Re: Traits and triggers

    Quote Originally Posted by konny View Post
    Have you checked that this only fires for the character that meats the requirements and not for all FMs? My experince with triggers that contain errors (and "pengo" will be considered that by the engine) makes them fire either never or for every character that meats the readable part (here: NotEndedInSettlement).
    The point I was making is that it didn't matter if we put HighestAttSharedChar piety priest >= 3, HighestAttSharedChar priest piety >= 3 or HighestAttSharedChar pengo piety >= 3, none work thus the trigger does as you say, always triggers for commanders Not EndedInSettlement

    Reading the link provided by dearmad above I can see other have not been able to get it to work, but have made its close kin condition HighestAttAdjacentChar work, but it needs "a trigger requirement of character_record, so you need to add an event that exports that."-GrnEyedDvl

    I guess I could PM GrnEyedDvl but I'll wait first and see if anyone else does.
    Does anyone know what the "trigger requirement of character_record, so you need to add an event that exports that" is?

  16. #16
    konny's Avatar Artifex
    Join Date
    Jul 2007
    Location
    Germania Inferior
    Posts
    3,631

    Default Re: Traits and triggers

    Quote Originally Posted by Pengo View Post
    TReading the link provided by dearmad above I can see other have not been able to get it to work, but have made its close kin condition HighestAttAdjacentChar work
    The problem with that, because it was made for whitches, would be that it also fires for enemy characters. But, thinking a second time about, it wouldn't be that bad: Why shouldn't a young mate take the enemy general as an example for loyalty and piety.

    Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
    Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
    dHRR 0.8 beta released! get it here
    New: Native America! A mini-mod for Kingdoms America

  17. #17
    Pnutmaster's Avatar Dominus Qualitatium
    Join Date
    Jan 2006
    Location
    Brooklyn, NY
    Posts
    1,572

    Default Re: Traits and triggers

    Ditch HighestAttSharedChar and instead use "HighestAttAdjacentChar Piety priest >= 3" (piety is lowercase in the docu-demon, but that is incorrect. Bad CA).
    Under the patronage and bound to the service of the
    artist formerly known as Squeakus Maximus
    Stoic Pantheist of S.I.N

  18. #18

    Default Re: Traits and triggers

    Does anyone know what GrnEyedDvl means by "trigger requirement of character_record, so you need to add an event that exports that"?

    HighestAttAdjacentAtt does not work without it.

    *edit* I'm doing a search, I think you don't need to do something with "character_record" from what I see but its not working.

    *edit2* I worked it out. Found some very good advise too, don't code when tired
    Last edited by Pengo; April 28, 2009 at 06:28 PM.

  19. #19
    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: Traits and triggers

    Yes, events export lists of things, one of them can be character_record. If you are using a condition that requires character_record then the event that condition is checked under MUST export it. If it doesn't you will get false positives because I believe that any condition that can't be checked (because what it required to be exported isn't) will always return true.

    Look in the docudemons to see what each event exports and what each condition requires be exported.
    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

  20. #20

    Default Re: Traits and triggers

    I'm sorry I don't understand.

    How does something get exported, and where does it get exported to?

    Is the "trigger" an event?

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
  •