1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Zwiebelchen is hosting a special UI texturing contest. Whomever wins will get a $150 reward through paypal! Come along and draw your texturing tools for the Fantastic Adventurer UI contest.
    Dismiss Notice
  3. Decide who's the leader among the leaders! The poll for the Paired Modeling/Texturing Contest #3 is up!
    Dismiss Notice
  4. We are looking for your vote! Choose the best icon set of the Icon Contest #15!
    Dismiss Notice
  5. Join Music Contest #7 - Location! Craft a song that depicts any place.
    Dismiss Notice

Extended Hotkeys ( spacebar etc! )

Discussion in 'Miscellaneous Tutorials' started by DysfunctionaI, Dec 11, 2013.

  1. DysfunctionaI

    DysfunctionaI

    Joined:
    Mar 6, 2006
    Messages:
    281
    This is a list of never before seen hotkeys that you can use in your map!


    Code (Text):

    0 = SHIFT
    32 = SPACE

    65 = A
    66 = B
    67 = C
    68 = D
    69 = E
    70 = F
    71 = G
    72 = H
    73 = I
    74 = J
    75 = K
    76 = L
    77 = M
    78 = N
    79 = O
    80 = P
    81 = Q
    82 = R
    83 = S
    84 = T
    85 = U
    86 = V
    87 = W
    88 = X
    89 = Y
    90 = Z

    257 = NUMPAD 0
    258 = NUMPAD 1
    259 = NUMPAD 2
    260 = NUMPAD 3
    261 = NUMPAD 4
    262 = NUMPAD 5
    263 = NUMPAD 6
    264 = NUMPAD 7
    265 = NUMPAD 8
    266 = NUMPAD 9

    267 = NUMPAD +
    268 = NUMPAD -
    269 = NUMPAD *
    270 = NUMPAD /
    271 = NUMPAD .

    272 = +
    273 = -
    274 = [
    275 = ]
    276 = \
    277 = ;
    278 = '
    279 = ,
    280 = .
    281 = /

    514 = BACKSPACE

    516 = LEFTARROW
    517 = UPARROW
    518 = RIGHTARROW
    519 = DOWNARROW

    520 = INSERT
    521 = DELETE
    522 = HOME
    523 = END
    524 = PAGEUP
    525 = PAGEDOWN

    526 = CAPSLOCK
    527 = NUMLOCK
    528 = SCROLLLOCK

    529 = PAUSE

    774 = F7
     
    There's some really cool ones in there if you get creative. How about SCROLLLOCK as some sort of toggle? :O



    Here's How To Do It!
    (credits to WaterKnight for easier implementation)


    You need to replace your AbilityMetaData.slk to allow the World Editor to use numbers as hotkeys. Then you can set any hotkey in the Object Editor to any of these numbers that correspond to the key you want.

    To replace your AbilityMetaData.slk:

    Go to the Registry Editor by typing in "regedit" in the Start Menu.

    Locate "HKEY_CURRENT_USER / Software / Blizzard Entertainment / Warcraft III"

    Right click in the "Warcraft III" folder and select New -> DWORD (32-bit)

    Name it "Allow Local Files" and then open it and set the value to 1

    Here's how it looks:

    [​IMG]


    Close the Registry Editor, and go to to your Warcraft III directory, usually at 'C:\Program Files\Warcraft III\'

    Make a new folder there called "Units" and then download the attached AbilityMetaData.slk and put it in there.

    You'll have to restart the World Editor for it to take effect. If you did it right, then the Hotkey field will be of type 'String':



    [​IMG]


    lolblizzard
    [​IMG]
     

    Attached Files:

    Last edited: Feb 15, 2014
  2. WaterKnight

    WaterKnight

    Joined:
    Aug 18, 2009
    Messages:
    3,868
    Nice. How have you found out which keys are allowed/what they map to? Only Esc was always known because Blizzard used it too.

    You should not take the data from war3.mpq but the latest instead (War3Patch.mpq). I want to note that overwriting the txt (profile) files ofc screws localization. It should be tested if those numeric hotkey representations can also be used in object editor files.
     
  3. Crigges

    Crigges

    Joined:
    Nov 20, 2011
    Messages:
    201
    Wow well written tutorial. Realy nice!!!

    ^this
     
  4. DysfunctionaI

    DysfunctionaI

    Joined:
    Mar 6, 2006
    Messages:
    281
    It started because I just wanted to change some of the hotkeys in CommandStrings.txt and I noticed that ESC was 512... to which I immediately wondered what the other five hundred numbers did (or more).

    So I spent a few hours with 3 buildings selling units, all with a different hotkey, that's 36 hotkeys per game, and I used an AutoIt macro to press every key that a keyboard could press, per building. A peculiar way, but I got it done. I never tested past ~700 though, I think the only keys that aren't there are TAB CTRL ALT ~ and the F keys (and print screen, lol).

    Thanks, I really didn't know anything about that so I was hoping someone would say something. I'll update it.

    Good idea, maybe we can do it straight in JNGP!

    My one last thought was this: Sometimes hotkeys aren't the same for people who have a different language WC3 installed. I wonder what happens if you replace those letter hotkeys ( like A ) with a numbered one ( A = 65 ).

    Edit: Yo, you CAN put these values in the object editor. I just had it open, attached Cheat Engine, and clicked to change hotkey, I typed a "Z" or something and changed it until I had the right address, then changed that Z to Hex(32) which is 20, and it worked when I tested the map. The problem is though, that input box only lets you type one character, so I couldn't enter the hex for any of the other keys because they were more than 1 byte.
     
    Last edited: Dec 11, 2013
  5. Crigges

    Crigges

    Joined:
    Nov 20, 2011
    Messages:
    201
    Somehow the list with the possible hotkeys got deleted.
     
  6. WaterKnight

    WaterKnight

    Joined:
    Aug 18, 2009
    Messages:
    3,868
    Rather than inputting them in the WE, you can edit the the files via hex editor. But we can also customize the meta slks in order to manipulate the editor the way to permit different field values, so the hotkey field can take full strings for example.

    So I tested the cast hotkey for abilities myself: As a string value, it seems to allow all the keys. As an int value, although you present them as 32 bit, only the lower numbers worked (A-Z and space).
     
  7. DysfunctionaI

    DysfunctionaI

    Joined:
    Mar 6, 2006
    Messages:
    281
    I thought you couldn't hex edit map files and still have them open them in the editor?

    And whoa, I'm gonna check out that slk stuff and see what I can come up with.
     
  8. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,203
    That's a really cool find. Have some rep. Mind uploading a quick test map?

    It depends. SFMPQ might allow you, at your own discretion. Keep in mind that the edits you make won't update in the actual editor--you would have to reopen the map. So if you make an edit in the hex while your map is open, and then you save your map, it will remove the changes you made (the editor doesn't dynamically update like that). Anything using StormLib will throw an error or just won't work. It can still read them just fine, just can't write to it.

    It could be a feature added to NewGen, if anyone is willing to code it. :p It would behave similar to the "Edit Tileset" function, where after you make the changes, you have to close and reopen the map.
     
  9. DysfunctionaI

    DysfunctionaI

    Joined:
    Mar 6, 2006
    Messages:
    281
    Attached a map with some funny hotkeys.

    SFMPQ eh? I'll have to try that; I didn't know the MPQ editor mattered. I always tried with MPQmaster and I could never open the map after I hex'd something, but I could play it on WC3 fine.

    That'd be hella cool if it was in JNGP... I'm just happy that there's still information that can be uncovered even after 10 years lol. Though it's uses may be limited, it's pretty cool. SCROLLLOCK could be like a toggle or switch in a game... that'd be interesting. Same with CAPSLOCK and NUMLOCK but they actually do stuff, lol.
     
  10. Adiktuz

    Adiktuz

    Joined:
    Oct 16, 2008
    Messages:
    9,697
    yeah, we have kinda enough hotkeys anyways... the only real problem is that the UI can only contain so few abilities...

    it would be better if we can find a way for wc3 to trigger events when we press any keyboard button... without relying on abilities since it is so much doable using dummy abilities...
     
  11. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,411
  12. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    9,008
    but this doesnt work with custom abilities? since those wont exist in the txt file
     
  13. DysfunctionaI

    DysfunctionaI

    Joined:
    Mar 6, 2006
    Messages:
    281
    This is true, which is why these hotkeys uses are limited to very specific maps. Nevertheless, they exist.

    I looked at that table along with like 4 other tables, and there were no patterns, which the exception of A-Z matching ASCII, and spacebar matching ASCII + those virtual key numbers.

    About portability.. I'm highly interested in that as well, not just with macs, but with users with different languages installed. I made a map a while ago and one of the hotkeys was C. Everyone played it fine but a group of people all complained that the hotkey to them, was G. As it turned out, they were all from Germany! I wonder what would happen if I changed that C hotkey to it's decimal of 67.

    Wait a sec, I finally did something that allowed the Object Editor to save these hotkeys.

    What meta slks are you referring to? I think I may have done basically that, but with Cheat Engine, allowing the Hotkey input field to accept strings, and it accepts these integers as strings. These means that it would be extremely easy for JNGP to implement this... check it out:

    [​IMG]

    Map is attached to this post.
     

    Attached Files:

    Last edited: Dec 12, 2013
  14. WaterKnight

    WaterKnight

    Joined:
    Aug 18, 2009
    Messages:
    3,868
    For example Units\AbilityMetaData.slk. Search for the entry "ahky", which is the normal hotkey field. Change attributes like "type" to "string", "maxVal" to the amount of chars you want to allow etc. Just view some of the other entries how they were realized. If you have local files on, you can put the edited meta slk into your wc3 directory Warcraft III\Units. Then restart the editor.
     
  15. DysfunctionaI

    DysfunctionaI

    Joined:
    Mar 6, 2006
    Messages:
    281
    That's really cool, thanks for telling me! Just another part of the WE I didn't know you could change. I wonder if there's any other useful thing you can make the WE do with those files... I can't recall any fields that I really needed to expand upon.

    Edit: omg, so I just added every possible keystroke to a macro, and got the address of the location of Blizzard's hotkey in game, so I'm changing it, then pressing every single key, and I have a trigger that warns me if the Archmage casted anything. It's testing like 10 possible hotkeys a second... this list is gonna get bigger lol.

    Sigh, I went to almost 5000 and only got one, 774 = F7. It makes sense, every other key is basically in use. F1-F6 are reserved for Heroes, F8 is Idle Worker, F9 is Quest, F10 is Menu, F11 is Player Menu, and F12 is Chat Log.
     
    Last edited: Dec 13, 2013
  16. WaterKnight

    WaterKnight

    Joined:
    Aug 18, 2009
    Messages:
    3,868
    The 2nd question is if you can somehow in reverse simulate the pressure special keys via:

    native ForceUIKey takes string key returns nothing


    May ask our current native hackers to look into that.
     
  17. DysfunctionaI

    DysfunctionaI

    Joined:
    Mar 6, 2006
    Messages:
    281
    Already tried it, and got no results.

    Also did this:

    Code (vJASS):

    function keypress takes nothing returns nothing
          call BJDebugMsg("key was pressed")
    endfunction

    function registershit takes nothing returns nothing
       local trigger t
       local integer i = 0

       loop
             exitwhen i > 6000

             set t = CreateTrigger()
             call TriggerRegisterPlayerEvent(t, Player(0), ConvertPlayerEvent( i ) )
             call TriggerAddAction( keypress )
             set t = null

             set i = i + 1
       endloop
    endfunction


    Also nothing, hah.

    Also, UMSWE which is included in JNGP let's you set hotkeys as strings, so I guess I'll re-do the tutorial to either use UMSWE or use their own meta file with Use Local Files = 1.
     
  18. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,203
    Any plan on an update? :)

    EDIT: It was fixed. Nice! Approved.
     
    Last edited: Feb 16, 2014
  19. Dat-C3

    Dat-C3

    Joined:
    Mar 15, 2012
    Messages:
    2,282
    You could just make a demo map like you had before, you can copy and paste these values instead of having to do all that. Why not make dummy abilities with every new key?
     
  20. Recom

    Recom

    Joined:
    Jan 7, 2010
    Messages:
    37
    I created a map for the Berzerk and Channel ability with all the non-letter hotkeys.

    Let me know if I messed something up!
     

    Attached Files: