Results 1 to 8 of 8

Thread: Yes/No event not consistent

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sogdog's Avatar Centenarius
    Join Date
    Nov 2009
    Location
    Johannesburg, South Africa
    Posts
    856

    Default Yes/No event not consistent

    Hi

    Here is my script. It workd fine then gets to turn 25 + and then the historic events don't run, only the script.

    declare_counter extra_money_offered

    ;;;;;;;;;; Event Timer ;;;;;;;;;;;

    declare_counter eventtimer
    monitor_event FactionTurnStart FactionIsLocal
    inc_counter eventtimer 1
    if I_CompareCounter eventtimer > 5
    set_counter eventtimer 0
    end_if
    end_monitor

    ;;;;;;;;;; Extra Money Offered ;;;;;;;;;;;
    monitor_event FactionTurnStart FactionIsLocal
    and I_CompareCounter eventtimer = 5
    and RandomPercent < 51
    historic_event extra_money true
    set_counter extra_money_offered 1
    end_monitor

    ;;;;;;;;;;;;;;;;;;;;;;;;; accepts blood money ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    declare_counter extra_money_accepted
    monitor_conditions I_EventCounter extra_money_accepted = 1
    console_command add_money 5000
    historic_event extra_money_accepted factions { england, lithuania, apachean, antioch, ireland, norway, jerusalem, france, hre, spain, venice, sicily, milan, scotland, byzantium, russia, novgorod, moors, turks, egypt, denmark, portugal, poland, hungary, papal_states, aztecs, mongols, timurids, normans, saxons, }
    end_monitor
    ;;;;;;;;;;;;;;;;;;;;;;;;; declines blood money ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    declare_counter extra_money_declined
    monitor_conditions I_EventCounter extra_money_declined = 1
    console_command add_money -5000
    historic_event extra_money_declined factions { england, lithuania, apachean, antioch, ireland, norway, jerusalem, france, hre, spain, venice, sicily, milan, scotland, byzantium, russia, novgorod, moors, turks, egypt, denmark, portugal, poland, hungary, papal_states, aztecs, mongols, timurids, normans, saxons, }
    end_monitor


    historic_event.txt

    {EXTRA_MONEY_BODY} My Lord, we've been asked if we shall accept blood money, press "Accept" to get the money, press "Decline" to refuse the offer
    {EXTRA_MONEY_TITLE} Accept Blood Money?
    {EXTRA_MONEY_ACCEPTED_BODY} My Lord, we have accepted the money offer, the 5000k denaries have been increased in your royal treasury
    {EXTRA_MONEY_ACCEPTED_TITLE} Money Accepted
    {EXTRA_MONEY_DECLINED_BODY} My Lord, we have refused the money offer, our royal treasury is now shorter by 5000k denaries
    {EXTRA_MONEY_DECLINED_TITLE} Money Refused

  2. #2
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Yes/No event not consistent

    Here you go, mate. I expect this will work:

    declare_counter extra_money_offered
    declare_counter extra_money_decided
    declare_counter eventtimer

    monitor_event FactionTurnStart FactionIsLocal
    inc_counter eventtimer 1
    if I_CompareCounter eventtimer >= 6
    set_counter eventtimer 0
    end_if
    end_monitor

    monitor_event FactionTurnStart FactionIsLocal
    and I_CompareCounter eventtimer == 5
    and RandomPercent < 51
    set_event_counter extra_money_accepted 0
    set_event_counter extra_money_declined 0
    historic_event extra_money true
    set_counter extra_money_offered 1
    set_counter extra_money_decided 0
    end_monitor

    monitor_conditions I_EventCounter extra_money_accepted == 1
    and I_CompareCondition extra_money_decided == 0
    console_command add_money 5000
    historic_event money_accepted
    set_counter extra_money_decided 1
    end_monitor

    monitor_conditions I_EventCounter extra_money_declined == 1
    and I_CompareCondition extra_money_decided == 0
    console_command add_money -5000
    historic_event money_declined
    set_counter extra_money_decided 1
    end_monitor

    You just need to get rid of the EXTRA_ from the start of your accepted and declined historic event text entries.

    Don't have much time or I'd mark out/explain the changes I made... Good luck
    Last edited by Taiji; March 12, 2012 at 11:24 AM.

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

    Default Re: Yes/No event not consistent

    Thanks a lot

    It seems to be working initially, will have to see later in the game. When you have time please tell me the rationale behind the changes. This will help me in the future!

  4. #4
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Yes/No event not consistent

    'historic_event blah true' will make it's own event counters named blah_accepted and blah_declined

    This is why I changed the name of your acceptance and declined historic events and set the monitor launching the historic_event blah true to reset those event counters intime for the conditions monitors to use them. (though thinking about it I'm not sure it was necessary to change the name really... I think I might have done that because of the way some of my own scripting will use the event counters... Ah well, harmless enough, heh)

    Condition monitors are realtime - they don't fire at a specific moment and then stop firing like an event monitor does. So something is needed something to turn them off, that's why I added a _decided counter that disables them as soon as a choice is made. (again I suspect I've done it this way due to my own scripts using the accepted and declined stuff elsewhere - or else could have just set the accepted/declined event counter to 0 to achieve the same effect)

    I guess the main point here is that there's quite a few ways of doing this stuff correctly.... hehe

    This way around allows you to use the accepted and declined counters in faction_standings, traits, ancillaries, etc. etc.
    Last edited by Taiji; March 13, 2012 at 06:12 AM.

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

    Default Re: Yes/No event not consistent

    Thanks a lot, I really appreciate it. It now works with no problems. I have done away with the event timer and given each script less than 5% to occur every turn. So far so good. Now for the trick question:
    1)I have enabled two ancillary traits, which work. I want to connect them to the above script. I have tried and read up on it but cannot get it to fire when one of the above events is fired. How do you do it?
    2)How do you enable traits? Sorry to ask this question but I can't seem to find the tut on it. It seems crazy I can get ancillaries to fire but not traits.

    Cheers,
    Sogdog

  6. #6
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Yes/No event not consistent

    Create the traits and then for the trigger just check for the event counter at character turn start -

    Trigger Blah

    WhenToTest CharacterTurnStart

    Condition I_EventCounter blah_accepted == 1
    and WhatEverYouLike

    Affects BlahTrait 1 Chance 100

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

    Default Re: Yes/No event not consistent

    Hi.
    Went home and got it to work. In the trigger section I used = instead of ==. Will this make a huge difference? I have tested it and it works fine so far. The tuts on these things are not that wonderful, a lot of the time I have to improvise. Hence around 3 hrs per trigger!!!

    Thanks for your help.

  8. #8
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Yes/No event not consistent

    == or = won't make any difference that I've ever noticed.

    I've never looked at a tut for this stuff, I've mainly just looked at examples of stuff that works and then worked it out.

    Can just think 'is there anything similar in the game/mod' and if there is can then then simply alter it to suit (while armed with the CA docudemons).

    And you're welcome

    PS. Get Notepad++ and set it up with vertically split view. Set the docudemon tabs on one side and your script on the other - I find that helps. But it's for comparing so I use CompareIt too (even after the trial runs out it's still great, heh). GED's script replicator is very very useful for making some big scripts. And if you ever need to change a ton of crap in one pass then spreadsheets are the way - download openoffice and use their calc stuff.

    edit:

    Got a bit carried away there but the Notepad++ with split view and the CA docudemons (not the 'ultimate' ones) on one side really helps to simplify things.
    Last edited by Taiji; March 15, 2012 at 04:03 AM.

Posting Permissions

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