• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] Chaging the hotkey of an ability during the game

Status
Not open for further replies.
Level 3
Joined
Apr 18, 2012
Messages
47
I'm making a map that includes custom heroes, that is to say a hero goes to a shop and 'buys' abilities. Problem is that it's impossible to set the hotkeys via object editor because hotkeys will end up overlapping. Ideally, I want whatever abilities a hero has to be set to Q W E R as hotkeys, like the LoL layout.

I've searched on the forums a lot and I've seen the solution of making 4 different abilities for each letter (Q W E R) and I've read a bit about Lua Object Generation, though I'm very unfamiliar with it, it seems to be a possible solution as well.

The solution I find most suitable however would be to use Jass or some variant to change the hotkey of the spell during the game using some bit of code. Problem is I just don't know how to retrieve the hotkey of an ability nor how to change it. I'm a beginner in Jass, though I'm not new to programming, so I can do the rest myself, I just don't know the actual functions I should be using. I don't even know if such a function exists, so I don't know if this is even possible. If someone could shed a little light on this, it would be greatly appreciated. Thanks.
 
Level 3
Joined
Apr 18, 2012
Messages
47
Okay, thanks for the incredibly fast response, that about wraps it up. I just wanted to make sure there was no function for it. So off to the highly imperfect solution of making 4 abilities or getting off my ass and learning that Lua stuff.
 
you can also use the F2-F5 by making one hero per ability and giving them to the player and catching the event that those hero units are selected and then deselect them, select the main hero and force him to press a key (via a native function)

It will only need the actual ability + 1 dummy hero per ability. Though this method has a bit of lag time when it comes to deselection so its not really good...
 
Level 3
Joined
Apr 18, 2012
Messages
47
Yeah, that would be a good solution, but the map is multiplayer and competitive so any amount of lag is painful. After reading more of that tutorial, apparently Lua cannot be used for creation or editing of objects during the game. So, it seems I'm left with only one solution. I'm thankful it's at least possible.
 
Status
Not open for further replies.
Top