Results 1 to 8 of 8

Thread: A case of not firing multiple times

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default A case of not firing multiple times

    My plan was to to fire an informative message once a particular faction (f_hayasdan, player controlled) spies double clicks on a slave settlement (sett_112). Because attention spans aren't what they used to be I intended to fire the message twice and then terminate the monitor.

    The first obstacle was that the SettlementSelected event only works for player settlements. Bit of a bummer but then I remembered that spying on a settlement opens the info panel, so I gave it a twirl with SettlementPanelOpen. Worked really well - the first time only. Simply refuses to fire a second time, I suspect it has to do with the historic event message immediately replacing the open settlement panel.

    Underneath the script that theoretically should fire every time the panel is opened:
    Code:
        monitor_event SettlementPanelOpen SettlementName sett_112
            and I_SettlementOwner sett_112 = slave
            and not I_IsFactionAIControlled f_hayasdan
            historic_event HE_SETT_112_SELECTED factions ( f_hayasdan, )
        end_monitor
    This would be the absolute minimum for testing with vanilla (double click settlement to open panel) using england:

    Code:
        monitor_event SettlementPanelOpen SettlementName London ; player owned
            historic_event first_windmill
        end_monitor
    
        monitor_event SettlementPanelOpen SettlementName York ; slave owned
            historic_event first_windmill
        end_monitor
    The weird thing is, that the message fires again when you use the selection arrows (next\previous settlement) to navigate through the panels when the settlement is owned by the player (obviously not available when owned by AI) but not when using a double click.
    Last edited by Gigantus; November 02, 2015 at 12:34 AM. Reason: wrong term










  2. #2
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: A case of not firing multiple times

    I gave it a test and this seems to be the situation...

    There are two kinds of settlement panel: player's and AI's. If you try opening either on the same settlement in succession then it only works the first time. If you open it on another settlement in between then it works, but only for the same type of panel.

    e.g. London -> Nottingham -> London = works (player panels)
    York -> Paris -> York = works (AI panels)
    York -> London -> York = does not work because London opens the player's not the AI's, so the AI's was still opened on York twice in a row

    Bummer.

    I intended to fire the message twice
    Do you mean when they spy on it a second time, or the second time they only need to open the panel (double-click on the settlement)?

    If the former then I'd just use the SpyMission event for both times...

    Code:
    monitor_event SpyMission FactionIsLocal
      and FactionType f_hayasdan
      and TargetFactionType slave
      and MissionSuccessLevel > not_successful ;could MissionSucceeded be used instead? 
      and IsSettlementExported ;need this otherwise the next condition might be invalid usage
      and SettlementName sett_112
      historic_event HE_SETT_112_SELECTED factions ( f_hayasdan, )
    end_monitor
    ...with a counter in there somewhere to terminate it on the second occurrence.

    EDIT: no need for a counter. Just this added at the end...

    Code:
      if I_EventCounter HE_SETT_112_SELECTED = 2
        terminate_monitor
      end_if
    Last edited by Withwnar; November 02, 2015 at 12:12 AM.

  3. #3
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: A case of not firing multiple times

    I was intending to fire the message when the settlement gets double clicked by the player - kinda 'hey let's check what they got'. The way EBII is set up (low success rates) it will be very unlikely that a spy will be used for a settlement (other then lifting the fog of war over the settlement for the first time).










  4. #4
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: A case of not firing multiple times

    So when you said "spies on a settlement" you didn't mean "with a spy", even for the first time?

  5. #5
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: A case of not firing multiple times

    Yup, that was incorrect use of term. My bad.










  6. #6
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: A case of not firing multiple times

    Then somehow the game would need to be forced to open the scroll on another AI settlement in between and I don't think that's possible.

  7. #7
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: A case of not firing multiple times

    Plus you would never know how long it would be (or what else happened) between the two instances anyhow to start with. Thanks for responding, guess it's only a loss for player's with short attention span.










  8. #8
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: A case of not firing multiple times

    Plus if you did get it to work then...

    1) Player spies => panel auto-closes immediately, replaced by HE scroll
    2) Player spies again immediately, trying to see what it wouldn't let them last time (due to scroll not visible) => panel auto-closes immediately again, replaced by same HE scroll
    3) Player spies again immediately => only now can they see the settlement details

    That would be annoying and/or result in false bug reports.

Posting Permissions

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