Results 1 to 8 of 8

Thread: Closing historic events through script.

Hybrid View

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

    Default Closing historic events through script.

    Has anyone tried this? Can it be done?

    I imagine the simulate mouse click command has something to do with it.

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

    Default Re: Closing historic events trough script.

    I don't have an answer, but simulating the pressing of escape would work the same and might be easier to code.

    edit:

    Try this maybe: call_object_shortcut confirm_quit_scroll

    edit:

    Just occurred to me you might be trying to make a toggle effect.

    Very cool!
    Last edited by Taiji; November 27, 2011 at 01:26 PM.

  3. #3

    Default Re: Closing historic events trough script.

    no luck,
    I'll try the scripting esc, that could work well too.

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

    Default Re: Closing historic events trough script.

    Bah I was dumb, that was the wrong element... Still looking...

    edit:

    I think that was the "Are you sure you want to quit?" scroll...

    Here's perhaps a complete list of the elements:
    http://forums.totalwar.org/vb/showth...325#post929325

    edit:

    Try this maybe: call_object_shortcut strat_ui quit

    Hope that's it, heh.

    edit:

    OK that was dumb too. It put the event to one side and opened the menu.
    Last edited by Taiji; November 27, 2011 at 02:03 PM.

  5. #5

    Default Re: Closing historic events trough script.

    Yeah I came up with that one too doesn't work ( well it does but it doesn't)
    It minimizes all the event scrolls to open the game options menu. Wich isn't what I need.

    Seems odd that no UI element corresponds to the closing of an historic_event scroll really.
    Anyway I'm not giving up just yet!

    EDIT:ninjad by an edit ^^
    Last edited by ilmrik; November 27, 2011 at 02:19 PM.

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

    Default Re: Closing historic events trough script.

    Yeah, it looks that way. I guess one approach could be to simply script everything that you're not sure about.

  7. #7

    Default Re: Closing historic events trough script.

    Hmm the esc key seems to be somewhat of a special case, it does more than it's hot key entry alone seems to indicate.
    I tried changing ESC by F4 but it wouldn't work, the F4 button immediatly brought up the "options menu" while the "ESC" still closed the event scrolls.
    I did find a valid ( but slightly less clean ) way of making a menu with hot keys,
    you can prevent the player of closing the scrolls with the "disable_cursor" and "enable_cursor" command.
    Once you disabled the cursor the player can only toggle trough the menu using the key board.
    so you can create a menu like this:

    Historic event triggered by F4
    sets_event_counter MENU_1 1
    press F4 ==> effect 1
    press F5 ==> effect 2
    press F6 ==> effect 3
    press F7 ==> effect 4
    press F8 ==> go back one screen

    pressing any of the hotkeys immediatly triggers a new event,
    press esc and it activates ( since the old menu closes and the priority is high)
    The only way to reenable the cursor is to close the menu's completly ( using the hotkeys)

    It's not as good as an automatically closing event but it's the next best thing.
    Will upload my test files once i'm a bit further along if you're interested.

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

    Default Re: Closing historic events trough script.

    I never had any luck with this (closing HE scrolls). I couldn't find an element for "minimise scroll" either.

    Also there's no way to be certain that the scroll currently open is the one that you're after. At least for start of turn scenarios where there's a queue of them.

Posting Permissions

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