Page 1 of 3 123 LastLast
Results 1 to 20 of 44

Thread: Traits, Triggers&Monitors

  1. #1
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Traits, Triggers&Monitors

    Well I wrote two new beginner tutorials on the .org and wanted to let you know about it.
    If you have questions about them or want to discuss them, please sign up at the .org and post in the tutorial threads.

    Anyways, here they come:
    Traits
    Triggers and Monitors

  2. #2

    Default Re: Tutorials: Traits, Triggers&Monitors

    thank's for tut...
    do u help me : http://www.twcenter.net/forums/showthread.php?t=77649

  3. #3

    Default Re: Tutorials: Traits, Triggers&Monitors

    Hi,

    sorry, my english is not very well so I need a littel additional explanation for the monitor_event command structure.

    I want to use a monitor_event what determine correctly the ownership of a region. I found some identifer which could be responsible for it. But it does not work correctly. The identifers I used in tests for campaign_script.txt were:

    IsRegionOneOf
    RegionIsLocal (seems to be the right one)
    SettlementIsLocal (quite the same like RegionIsLocal but with settlement name)

    For example, the event should only occur when a special region/settlement and belong to a special faction after a certain time.
    One of the test scripts looks like this:

    monitor_event FactionTurnStart FactionType testfaction
    and RegionIsLocal testregion_Id or testregion name
    and I_NumberOfSettlements testfaction >5
    and I_TurnNumber > 3

    historic_event testevent (need to have a description in the historic_events.txt of course)
    terminate_monitor
    end_monitor

    But in my tests the event happen also if the testfaction have only more than 5 regions but does not control the testregion. Or if the testfaction control the testregion but does not control more than 5 regions. :hmmm:
    In some tests the event happen if another faction controls the testregion
    Only the condition for the time works correctly. So what could be wrong with the syntax?

  4. #4
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: Tutorials: Traits, Triggers&Monitors

    Check the error log. You can't use FactionIsLocal in a FactionTurnStart event monitor.

  5. #5

    Default Re: Tutorials: Traits, Triggers&Monitors

    Using FactionIsLocal in a FactionTurnStart event monitor is right.
    For example the money script:

    monitor_event FactionTurnStart FactionType moors
    and not I_LocalFaction moors
    and Treasury < 6000
    and I_NumberOfSettlements moors < 6

    console_command add_money moors, 4000

    end_monitor
    It is quite the same structure. So what is wrong?

  6. #6
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: Tutorials: Traits, Triggers&Monitors

    Quote Originally Posted by Adorno View Post
    Using FactionIsLocal in a FactionTurnStart event monitor is right.
    For example the money script:


    It is quite the same structure. So what is wrong?
    Argh sorry I meant RegionIsLocal
    Theres a condition to check the province owner by faction name, but I don't recall its name.

  7. #7

    Default Re: Tutorials: Traits, Triggers&Monitors

    Once again:

    I tried a lot but I could not find the right syntax. Could anybody show me how the conditions must look like when a city or a region belongs to a certain faction. With these conditions I would like to create a event that triggers for the case if a certain city is conquered by another faction except for the former owner. For example the fall of Rome or the fall of Constantinople by turks.

    mfg Adorno

    This sript what does not work (it triggers ever, when any settlement is occupied anywhere)

    monitor_conditions OccupySettlement
    and SettlementName York
    and FactionType scotland
    and I_EventCounter fall_of_York_by scotland = 0

    historic_event all_of_York_by scotland

    terminate_monitor
    end_monitor

  8. #8

    Default Re: Tutorials: Traits, Triggers&Monitors

    I got it !!

    monitor_event GeneralCaptureSettlement FactionType turks
    and SettlementName Constantinople
    and I_EventCounter fall_of_constantinople = 0

    console_command add_money turks, 15000
    historic_event fall_of_constantinople
    terminate_monitor
    end_monitor

  9. #9
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: Tutorials: Traits, Triggers&Monitors

    Small update adding this (after I found it out the hard way...):

    Quote Originally Posted by alpaca
    Be careful when using not. It apparently doesn't work with some conditions that use a logic token (like I_CompareCounter counter = 1).
    If you want to negate these, manually negate the token, so "not condition = 1" would become "condition != 1", "not condition >= 1" would become "condition < 1" and so on.

  10. #10

    Default Re: Tutorials: Traits, Triggers&Monitors

    WoW! Thank you for this guide, Alpaca!
    This is exactly the issue I was thinking about for several days!


    Also thank you very much for posting this script, Adorno!
    I wanted to make exactly the same events for the falls of important cities, but I failed several times...
    Now it works just fine!

    Winner of 'Favorite M2TW Mod' and 'Favorite M2TW Modder' Award 2007 & 2008

  11. #11

    Default Re: Tutorials: Traits, Triggers&Monitors

    Hi again,

    Does anyone has an idea how I could make a reconquista script that fires when all settlements on the iberian peninsula are captured by any catholic factions??

    I have tried so many different conditions but had no luck so far...

    Thanks in advance!
    Last edited by King Kong; April 01, 2007 at 07:44 AM.

    Winner of 'Favorite M2TW Mod' and 'Favorite M2TW Modder' Award 2007 & 2008

  12. #12

    Default

    i am wondering were the files for monitering is in the data folder.Very frustrated since i managed to figure everything else out and then had no idea were to find the monitering stuff.Please Help!

    Also,are moniters neccesary?What do they do?What are they for? I don't understand the moniter thingys at all!I am a newb at this.All i am doing is adding a trait and i find that the only place were i see moniters is in the campaign script.Please Help!
    Last edited by Trajan; April 11, 2007 at 06:03 PM. Reason: Merged non-duplicate double post.

  13. #13
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: Tutorials: Traits, Triggers&Monitors

    Yeah, monitors are a scripting feature. I'm currently in the process of writing a scripting tutorial, but back then I decided to put them into the triggers tutorial because they work actually pretty similar.
    You don't really have to understand them if all you want to do is editing traits.

  14. #14

    Default

    So u are saying that my trait will still work?If so thats good.But i have no way knowing since for some reason my My Mod thingy won't start up.I don't know why.Could someone help me please.

    I tryed the error log thing and this is what it says however i don't understand what it means.

    18:03:25.859 [system.rpt] [always] CPU: SSE2
    18:03:25.859 [system.rpt] [always] ==== system log start, build date: Dec 5 2006 version development ===
    18:03:25.875 [system.io] [always] mounted pack packs/data_0.pack
    18:03:25.875 [system.io] [always] mounted pack packs/data_1.pack
    18:03:25.875 [system.io] [always] mounted pack packs/data_2.pack
    18:03:25.875 [system.io] [always] mounted pack packs/data_3.pack
    18:03:25.890 [system.io] [always] mounted pack packs/data_4.pack
    18:03:25.890 [system.io] [always] mounted pack packs/localized.pack
    18:03:25.890 [system.io] [always] mounted pack mymod/packs/data_0.pack
    18:03:25.890 [system.io] [always] mounted pack mymod/packs/data_1.pack
    18:03:25.890 [system.io] [always] mounted pack mymod/packs/data_2.pack
    18:03:25.906 [system.io] [always] mounted pack mymod/packs/data_3.pack
    18:03:25.906 [system.io] [always] mounted pack mymod/packs/data_4.pack
    18:03:25.906 [system.io] [always] mounted pack mymod/packs/localized.pack

    Someone please tell me what this means.
    Last edited by Trajan; April 11, 2007 at 08:04 PM. Reason: Merged non-duplicate double post.

  15. #15

    Default Re: Tutorials: Traits, Triggers&Monitors

    First of all: amazing tutorial! it was a good way to introduce myself to those files {shudders in memory of that double=click}

    i just needed to check one [or actually a few] thing out:
    how can we change the event that causes a trait to increase. I mean, suppose i want somebody to get a "Spaniard" trait if he spends 5 turns in the Peninsula. [this is hypothetical].
    1) How would i go about adding that trait? is it just adding new entries through a text editor?
    2) How would i set up that trait's trigger? How would i tell the game that its "x" turns in "Province A" and "Province B" to get this trait?

    i hope these questions aren't redundant [answered elsewhere] and i hope the answers help more ppl than just me
    and, most of all: i hope i made sense?
    CHECK ME OUT ON YOUTUBE
    for Total War Tips, Tricks and Tutorials!


  16. #16
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: Tutorials: Traits, Triggers&Monitors

    Yes you add the appropriate entries in a text editor and the game will recognize them as a new trait.
    As for the triggers: For this stuff you'd usually use a CharacterTurnStart or CharacterTurnEnd event and check the RegionIsOneOf condition (it takes a space-separated list of region names in descr_regions.txt as a parameter and does exactly what you want)

    No thing is everything. Every thing is nothing.

  17. #17

    Default Re: Tutorials: Traits, Triggers&Monitors

    thank you very much!
    if i understood it right [i hope u don't mind me making this personal request], then code could be something as follows:
    Spoiler Alert, click show to read: 

    Code description:This trait is for the Broken Crescent Mod The trait is called "of the Agnivanshi." Basically, when the charcter ends his third turn in a region called Rajasthan in India, he has 80% chance of attaining a trait: Of_the_Agnivanshi.

    Code:
    ;------------------------------------
    Trigger gain_Of_the_Agnivanshi
        WhenToTest CharacterTurnEnd
        Condition IsRegionOneOf Rajasthan
              and TimeInRegion > 3
    
        AcquireTrait Of_the_Agnivanshi chance 80


    Is that right? just wondering if this is how it would be implemented.

    once again, thank you very much!

    cheers
    -indian_boy
    Last edited by PartyElite; April 22, 2007 at 01:14 AM.
    CHECK ME OUT ON YOUTUBE
    for Total War Tips, Tricks and Tutorials!


  18. #18
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: Tutorials: Traits, Triggers&Monitors

    Quote Originally Posted by indian_boy90 View Post
    thank you very much!
    if i understood it right [i hope u don't mind me making this personal request], then code could be something as follows:
    Spoiler Alert, click show to read: 

    Code description:This trait is for the Broken Crescent Mod The trait is called "of the Agnivanshi." Basically, when the charcter ends his third turn in a region called Rajasthan in India, he has 80% chance of attaining a trait: Of_the_Agnivanshi.

    Code:
    ;------------------------------------
    Trigger gain_Of_the_Agnivanshi
        WhenToTest CharacterTurnEnd
        Condition IsRegionOneOf Rajasthan
              and TimeInRegion > 3
    
        AcquireTrait Of_the_Agnivanshi chance 80


    Is that right? just wondering if this is how it would be implemented.

    once again, thank you very much!

    cheers
    -indian_boy
    Yeah if you also add the trait and the correct descriptions in descr_vnvs.txt it should work.

    No thing is everything. Every thing is nothing.

  19. #19

    Default Re: Tutorials: Traits, Triggers&Monitors

    ahh thank you!
    one last [supposedly last ]:
    what if it only affects the faction whose internal name is {sicily}? i would add the following under conditions? :
    Code:
    and CharFactionType sicily
    and if it's only for {hindu} religion?:
    Code:
    and FactionReligion hindu
    just wanted to check these things out.
    thank you for putting up with me

    cheers
    CHECK ME OUT ON YOUTUBE
    for Total War Tips, Tricks and Tutorials!


  20. #20
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: Tutorials: Traits, Triggers&Monitors

    Yeah should work.

    No thing is everything. Every thing is nothing.

Page 1 of 3 123 LastLast

Tags for this Thread

Posting Permissions

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