Results 1 to 4 of 4

Thread: How to assign a script to a key press?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default How to assign a script to a key press?

    I want to use keys that are not existing shortcuts (probably F4-F12) to begin scripted functions.

    Is it possible? If so then how to do it?

    Thanks for any help
    Last edited by Taiji; September 15, 2010 at 09:03 AM.

  2. #2

    Default Re: How to assign a script to a key press?

    There was a thread not too long ago about this... I remember Gigantus identified a script which showed a shortcut button used in a script.

    Here it is - http://www.twcenter.net/forums/showthread.php?t=376004
    Currently following these promising mods - Imperia Antiquitatis by Splenyi
    Traits, Talents, and Toadies
    by Hellbent
    Real Roman Reforms
    by Aodh Mor
    Unit Icons project
    by Bullgod
    Also recommended:
    City Sack, Liberation and Diplomatic Options
    by Dresden

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

    Default Re: How to assign a script to a key press?

    Thanks for responding, RedXavier

    I hoped there might be a more direct method.

    So how do I mod a changed keyboard shortcut setup? I can do it for myself, in 'options', but how do I do it to my audience? Where are those settings stored?

    Thanks again

    edit:

    Soooo how to edit keys.dat? (found in m2tw\preferences)

    Altering people's shortcuts just to make my mod work is undesirable, but it seems to be made necessary.
    Last edited by Taiji; September 15, 2010 at 12:10 PM.

  4. #4

    Default Re: How to assign a script to a key press?

    The .dat file in preferences is named by the user anyway (when they save the control configuration) so they would just have to be told to reassign the F12 key or whatever.

    I think you would just add that key and its label to descr_shortcuts.txt, shortcut.txt, shortcuts_lookup.txt and monitor it like the hide_gui script.
    Last edited by The Bruce; September 18, 2010 at 07:41 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
  •