• 🏆 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!

[JASS] Assign hotkeys

Status
Not open for further replies.
Level 2
Joined
Apr 14, 2009
Messages
10
Hello everybody

I'm a beginer in JASS and I wonted to ask you how to assing a hotkey to an new ability using the JASS. If it is possible can you show me an example with a mention like:
//here is your hotkey

:grin:

Regards.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
I wish beginners to WC3 did not get the false idea that JASS can do anything, because it can not.
JASS is the warcraft 3 scripting language. It is restricted to do what the makers programmed it to do + or - a few bugs which they never resolved or parts that were never finished. It is not low level enough to allow you to do everything, thus I come to the conclusion and fact that every new map maker should adopt when making a map.

If I have not seen such a thing done before in a map, then I probably will probably not be able to do it.

Thus as I have not seen maps where the hotkey for an ability was regually changed via triggers, then it can not be done.

I however can advise you the next best thing. You can make multiple abilities with different hotkeys and the same stats and change them via triggers to eachother to seem as if you were changing just the hotkey (only works for non hero learnable abilities).
 
Level 2
Joined
Apr 14, 2009
Messages
10
This means that you can create an ability using the JASS but you can assing an hotkey for it only in Object Editor?

Well what I wonted to do is using the JASS language and tu make a function or better a trigger for changing the hotkeys like the customskeys does.

However the ideea is good but what you'll do when you'll heve let's say 30 abilities in game and you wont to make 3 possible variants for changing the hotkeys this will triple the size of the map?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Um.... firstly you can not make proper abilities using JASS. You can trigger enhance object editor spells however to do more when they are cast, but that still uses the object editor to create the base. Really, JASS can not do much more than GUI can next to stuff that is code structure orientated as JASS allows better data management and also axcess to a few natives GUI did not have the ability to use that can boost functionatliy and efficency.
 
Level 2
Joined
Apr 14, 2009
Messages
10
Ok can you tell me what this 2 functions does or better where I can find the explanation for these:

JASS:
function DialogAddButtonWithHotkeyBJ takes dialog whichDialog, string buttonText, integer hotkey returns button
    set bj_lastCreatedButton = DialogAddButton(whichDialog, buttonText,hotkey)
    return bj_lastCreatedButton
endfunction

and

JASS:
native GetLocalizedHotkey takes string source returns integer

As I understood they are using hotkeys?

Does the first function is used to add buttons in the bottom right part fo the screen such as "Move", "Stop", "Hold" and so on?

Regards.
 
This is "Dialog Button"; it has nothing to do with the ability hotkeys. The hotkeys are something changable only via Object Editor. Dialog Buttons is something to be triggered only. Have a search in Tutorials for Dialogs and you will realize that they have nothing to do with Hotkeys. Hotkeys are a simple reference to an ability through your keyboard. Dialog buttons is a way to select something in-game (e.g.: Mode you want in-game (Difficult / Medium/ Easy)).
 
Status
Not open for further replies.
Top