HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Force Numberpad key?

04-20-2008, 11:25 PM#1
GosuSheep
I'm trying to make an ability that will force a unit to use an item in its inventory.

So, you use this ability, and it'll force ui Key numpad7

Issue is, I don't know the identifier for the Number pad.

Anyone know how to accomplish this?


Replies are greatly appreciated
04-20-2008, 11:29 PM#2
Rising_Dusk
Try --
Collapse JASS:
call ForceUIKey("3")
No clue if it will work, but it might. If that doesn't work, nothing will. (Replace 3 with whatever number you want)
04-20-2008, 11:32 PM#3
GosuSheep
yeh. i tried that. it doesnt work


balderdash = \
04-20-2008, 11:34 PM#4
Rising_Dusk
That's unfortunate. You could issue an order to use an ability on an item in an inventory, but that is a bit of a roundabout method.
05-22-2008, 05:24 PM#5
GosuSheep
issue with that is that it doesn't work with items that require a target. Theres no key like {Numpad7} ?
05-23-2008, 02:24 PM#6
Ammorth
Don't items have orderids? They were in series, 1 for each slot if I remember correctly.
05-23-2008, 03:26 PM#7
Alexander244
Quote:
Originally Posted by The Warcraft III Ability Guide
  • 852008 to 852013 (useslot): These are orders that will make the ordered hero use the item in a certain inventory slot. If it's an order with no target or object or point targeted depends on the type of item. The id 852008 will use the item in slot 1, the id 852009 will use the item in slot 2 and so on.
But that's for casting item abilities, not just hotkeying items.

You could try having multiple copies of the "use" ability, with different targeting options. You then replace this ability based on the item in the inventory slot. When the use ability is cast, issue the same order to the item.
This method also has an advantage that you can disable the use ability when there is no item or an invalid item in the inventory slot.
05-23-2008, 04:57 PM#8
GosuSheep
but this method does not work for items with targets? I've got a lot of work to do then.