Page 2 of 5 FirstFirst 12345 LastLast
Results 21 to 40 of 99

Thread: Yes/No Event Tutorial

  1. #21
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,126
    Blog Entries
    35

    Default Re: Yes/No Event Tutorial

    There are several good basic tutorials available in this forum. Have a look into them, try it out, post questions in those tutorials - that's the best way to learn the basics.










  2. #22

    Default Re: Yes/No Event Tutorial

    hi guys from twcenter can anybody help me ?
    here is my problem, i wanted to play as saxons in the tutorial so i change the dersc.strat.txt or something, and when i started the tutorial dispite the saxon settelments are visible i cant click or play with them .
    so can anybody solve this prob
    ?????????????????????????????

  3. #23
    Deutschland's Avatar East of Rome Mod Leader
    Join Date
    Apr 2009
    Location
    Leipzig, Germany
    Posts
    2,025

    Default Re: Yes/No Event Tutorial

    Hey people,

    I have a problem with my yes/no event (funnily enough I got several of them working in my script but this one won't)

    It is supposed to work like this:

    1. You get the message that says: You need to pay tribute

    2. Either accept (pay tribute) or not (become neutral with the faction from previously allied)

    Here is the script:

    Spoiler Alert, click show to read: 
    declare_counter ghassanid_funding_offered

    monitor_event FactionTurnStart FactionType ere
    and I_LocalFaction ere
    and DiplomaticStanceFromFaction ghassanids = Allied


    add_events
    event counter ghassanid_accepted
    event counter ghassanid_declined
    end_add_events

    historic_event ghassanid_funding_note true factions { ere, }
    set_counter ghassanid_funding_offered 1
    end_monitor

    monitor_event EventCounter EventCounterType ghassanid_accepted
    and I_EventCounter ghassanid_accepted == 1
    and I_LocalFaction ere

    add_money ere, -10000
    console_command diplomatic_stance ere ghassanids Allied
    historic_event ghassanid_fund_payed
    end_monitor

    monitor_event EventCounter EventCounterType ghassanid_declined
    and I_EventCounter ghassanid_declined == 1
    and I_LocalFaction ere

    console_command diplomatic_stance ere ghassanids Neutral
    historic_event ghassanid_fund_rejected
    end_monitor


    The event messages are in place and dont cause the problem.

  4. #24
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,126
    Blog Entries
    35

    Default Re: Yes/No Event Tutorial

    declare_counter ghassanid_funding_offered

    monitor_event FactionTurnStart FactionType ere
    and I_LocalFaction ere
    and DiplomaticStanceFromFaction ghassanids = Allied


    add_events
    event counter ghassanid_accepted
    event counter ghassanid_declined
    end_add_events


    historic_event ghassanid_funding_note true factions { ere, }
    set_counter ghassanid_funding_offered 1
    terminate_monitor
    end_monitor

    monitor_event EventCounter EventCounterType ghassanid_funding_note_accepted
    and I_EventCounter ghassanid_funding_note_accepted == 1
    and I_LocalFaction ere

    add_money ere, -10000
    console_command diplomatic_stance ere ghassanids Allied
    historic_event ghassanid_fund_payed
    end_monitor

    monitor_event EventCounter EventCounterType ghassanid_funding_note_declined
    and I_EventCounter ghassanid_funding_note_declined == 1
    and I_LocalFaction ere

    console_command diplomatic_stance ere ghassanids Neutral
    historic_event ghassanid_fund_rejected
    end_monitor
    The 'true' in the historic_event entry will always create an 'accepted' or 'declined' event depending on the response. Events do not need to be added in advance (unlike counters).
    Instead of terminating the first monitor, because it will fire over and over when the condition is accepted, you could create a 'timer' that will reset a counter to fire this event again (as you probably had planned, considering the 'orphaned' counter) after a set amount of rounds.
    Last edited by Gigantus; November 23, 2011 at 09:03 AM.










  5. #25
    Deutschland's Avatar East of Rome Mod Leader
    Join Date
    Apr 2009
    Location
    Leipzig, Germany
    Posts
    2,025

    Default Re: Yes/No Event Tutorial

    Thank you very much Gigantus,

    finally understood that the _accepted and _declined are hardcoded.. It works now. You were right I indeed have a timer included.

    +rep

  6. #26
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,126
    Blog Entries
    35

    Default Re: Yes/No Event Tutorial

    One is glad to be of service










  7. #27

    Default Re: Yes/No Event Tutorial

    THNX

  8. #28
    Sogdog's Avatar Centenarius
    Join Date
    Nov 2009
    Location
    Johannesburg, South Africa
    Posts
    856

    Default Re: Yes/No Event Tutorial

    Hi

    I got this script firing perfectly. One question: how do you make it happen randomly?


    monitor_event FactionTurnStart FactionType ireland
    and I_LocalFaction ireland
    and I_TurnNumber = 1
    and I_CompareCounter extra_money_offered = 0
    add_events
    event counter extra_money_accepted
    event counter extra_money_declined
    end_add_events
    historic_event extra_money true factions
    set_counter extra_money_offered 1
    terminate_monitor
    end_monitor

  9. #29
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,126
    Blog Entries
    35

    Default Re: Yes/No Event Tutorial

    Use the generate_random_counter command, the example line gives a five percent chance as it generates a number between 1 and 20 every time it runs. The event (and the random counter generator) will terminate (not repeat) after the first instance.

    monitor_event FactionTurnStart FactionType ireland
    and I_LocalFaction ireland
    generate_random_counter ireland_money 1 20
    if I_CompareCounter extra_money_offered = 1
    terminate_monitor
    end_if
    end_monitor


    monitor_event FactionTurnStart FactionType ireland
    and I_LocalFaction ireland
    and I_CompareCounter ireland_money 10 ; pick a number of the range you have set previously
    and I_TurnNumber = 1
    and I_CompareCounter extra_money_offered = 0 event terminates after first time, not needed
    add_events
    event counter extra_money_accepted will be added automatically
    event counter extra_money_declined will be added automatically
    end_add_events
    historic_event extra_money true factions
    set_counter extra_money_offered 1
    terminate_monitor
    end_monitor
    Last edited by Gigantus; March 14, 2012 at 10:26 PM.










  10. #30
    Sogdog's Avatar Centenarius
    Join Date
    Nov 2009
    Location
    Johannesburg, South Africa
    Posts
    856

    Default Re: Yes/No Event Tutorial

    Baai Dankie meneer.
    Een klein vra vir u:
    I have managed to get a random continuous event playing no problems. I have successfully added traits and ancillaries. My question:
    1)How do I get a trait or ancillary to negate/take away an opposing trait/ancillary that the person has already? In other words he holds an ancillary/trait for x amount of turns, when he adopts another trait/ancillary that is opposed to his current one he gets the new one and the old one falls away. I hope I am clear on this?
    2)How do I get the game to show me event messages when a faction adopts a certain trait/ancillary in the form of a historical event message?

    Lekker Bly en gooi aand!

  11. #31
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,126
    Blog Entries
    35

    Default Re: Yes/No Event Tutorial

    There are extensive tutorials in this forum regarding traits.

    Ancillaries are always displayed when they are gained
    Traits need this line in their set up: GainMessage [trait_name]_gain_desc

    To negate a trait you need an anti trait or negative Affects entries. Doesn't work with ancillaries that way.

    Simply search for AntiTraits in this forum.










  12. #32
    Sogdog's Avatar Centenarius
    Join Date
    Nov 2009
    Location
    Johannesburg, South Africa
    Posts
    856

    Default Re: Yes/No Event Tutorial

    Thanks.
    I searched "antitrait" and used it. It works, one small issue which I can't find the answer to:
    When my general is given a trait which cancels an already existing trait (it is an antitrait) the general is not given the new trait, instead the two traits cancel eachother out and the general is left with neither trait. Why is this happening?

  13. #33
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,126
    Blog Entries
    35

    Default Re: Yes/No Event Tutorial

    Simple mathematics: one (having a trait) minus one (anti trait applied) equals zero










  14. #34
    Sogdog's Avatar Centenarius
    Join Date
    Nov 2009
    Location
    Johannesburg, South Africa
    Posts
    856

    Default Re: Yes/No Event Tutorial

    Thanks, I get that. What command do I give a trait to get it to stay?
    Affect Trait Genorsity 1 Chance 100 becomes Generosity 2 Chance 100?

  15. #35
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,126
    Blog Entries
    35

    Default Re: Yes/No Event Tutorial

    It's the NoGoingBackLevel entry, check this vanilla trait:

    Code:
    Trait Drink
        Characters family
        ExcludeCultures middle_eastern
        NoGoingBackLevel  5 
        AntiTraits Sobriety
    It simply means that once that level has been reached even an anti trait will not reverse it.

    But you really should open your own thread for all those trait questions instead of using this one...










  16. #36

    Default Re: Yes/No Event Tutorial

    Ok, trying to create a yes/no event which heralds a marriage offer for faction leader on first turn. Need to know if it is possible to do.
    Yes=alliance with target princess's faction with full military access, give trait (new trait) Pledged to marriage , give 2000 money.
    no=no effect
    Then, if faction leader marries any other princess/lady not target faction, his 'pledge is broken', and factions go to war.

    How might this be done, or can it be done?
    Thanks.

  17. #37

    Default Re: Yes/No Event Tutorial

    im not sure if i fully understand... you want to 'trigger' a marriage just like when u marry a princess off?... or you want to script one that is set up via ancilliary and the general/king can still 'marry' as normal (so its kind of like a fake marriage as far as the game engine is concerned - i.e wouldnt appear in the family tree). and if they do marry as normal, it forces war?... am i understanding correctly...

    Will this heralded marriage offer just be an ancillary, or will it be a legit marriage?

    If it is just an ancillary, then yes it is possible... i am not sure if you can allow military access directly (i have never tried scripting the trade screen, although i do plan to have a go at it in a mod i am working on)... but you could increase the faction standings between the two factions and then allow the factions to set up trade and military rights at their own convenience via diplomacy... and then if the king marries another princess, they lose the ancillary (of the fake marriage) and then change the faction standings again so as to influence war...

    they may not go to war and they may not grant military access. but it would be more likely based on the faction standings you boost. the faction standings text file can read event counters straight from the campaign script just the same as the EDB, traits and ancillary files do.

    With that said... i am not sure if you can track via script when a general marries... so that to me would be the only real hurdle in writing this script...
    ...longbows, in skilled hands, could reach further than trebuchets...

  18. #38

    Default Re: Yes/No Event Tutorial

    Quote Originally Posted by Tsarsies View Post
    im not sure if i fully understand... you want to 'trigger' a marriage just like when u marry a princess off?... or you want to script one that is set up via ancilliary and the general/king can still 'marry' as normal (so its kind of like a fake marriage as far as the game engine is concerned - i.e wouldnt appear in the family tree). and if they do marry as normal, it forces war?... am i understanding correctly...

    Will this heralded marriage offer just be an ancillary, or will it be a legit marriage?

    If it is just an ancillary, then yes it is possible... i am not sure if you can allow military access directly (i have never tried scripting the trade screen, although i do plan to have a go at it in a mod i am working on)... but you could increase the faction standings between the two factions and then allow the factions to set up trade and military rights at their own convenience via diplomacy... and then if the king marries another princess, they lose the ancillary (of the fake marriage) and then change the faction standings again so as to influence war...

    they may not go to war and they may not grant military access. but it would be more likely based on the faction standings you boost. the faction standings text file can read event counters straight from the campaign script just the same as the EDB, traits and ancillary files do.

    With that said... i am not sure if you can track via script when a general marries... so that to me would be the only real hurdle in writing this script...
    Thanks for the feedback.
    Here I'll try to straighten it out:
    So, it won't be a legit marriage, if YES is selected then Faction Leader gains ancillary 'Betroved to *faction name* princess' or something to that effect, I would then like to script in an automatic alliance with possible military access and improved relations.
    If NO, then faction remains neutral.

    The next script, I guess, is unrelated to the event, but if the Faction Leader marries someone other than a princess of that faction, then your relations are altered dramatically when the 'betroved' ancillary is lost, i.e. from say, Very Good to Poor or Terrible, increasing the chances of a broken alliance, and perhaps a possible war.
    Obviously, unless overly concerned about roleplay or traits of target faction's princess, there would be little incentive for the player NOT to quickly arrange a marriage with the princess of that faction. After all, failing to do so would mean I could give new traits, such as outhbreaker (-3 authority), to Faction Leader for revoking his promise, as well as a possible war with that faction.

    So...Here is where I get even more ambitious, I would like to script in a random chance of the Faction Leader getting married without any action from the player, that will cause an unprecendented marriage of the King (actual marriage in family tree) to some random princess.

    My inspiration for such as script is GRRM's novels A Song of Ice and Fire, where...
    Spoiler Alert, click show to read: 
    Robb Stark (king) promises to marry a Lord's daughter, ends up marrying someone else, offends Lord, uncle offers to marry a daughter of angered lord instead to make up for it, and the nasty lord murders the king and his men at his uncle's wedding.


    So, is it possible, how might I do it? Or could you point me in the direction of somewhere I can find out.

    Thanks in advance,

    the duke dude

  19. #39
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,126
    Blog Entries
    35

    Default Re: Yes/No Event Tutorial

    You can't script a marriage.
    I don't think a scripted alliance includes access. Relationships (faction attitudes) can be scripted.
    You will have to give all possible spouses a different hidden trait that can be tested for (SpouseTrait) so you can determine whom he married. Based on that you can trigger the other stuff.










  20. #40

    Default Re: Yes/No Event Tutorial

    Alright, try as I might, I am having zero luck having a Yes/No Event work as intended. I know that my script is firing, as I receive the Event message, but it is not a Yes/No Event, rather it appears simply as any usual Historic Event would; with one check box in the lower right corner for dismissing. Anyone care to have a look and see what I might have done wrong?

Page 2 of 5 FirstFirst 12345 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
  •