1. The contestants were to create water structures for the 20th Terraining Contest. Choose one in the public poll!
    Dismiss Notice
  2. Join other hivers in a friendly concept-art contest. The contestants have to create a genie coming out of its container. We wish you the best of luck!
    Dismiss Notice
  3. The Melee Mapping Contest #4: 2v2 - Results are out! Step by to congratulate the winners!
    Dismiss Notice
  4. We're hosting the 15th Mini-Mapping Contest with YouTuber Abelhawk! The contestants are to create a custom map that uses the hidden content within Warcraft 3 or is inspired by any of the many secrets within the game.
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice

Changing Ability Hotkey

Discussion in 'World Editor Help Zone' started by MooNek, Nov 27, 2018.

  1. MooNek

    MooNek

    Joined:
    Jul 18, 2010
    Messages:
    148
    Resources:
    0
    Resources:
    0
    Hey, I'm making a map in which the player will choose what spells he/she wants to use from over 20 different spells per class. That said, I don't think I'll be able to assign unique hotkey for every spell in the game, and even if I did it wouldn't be comfortable to play with.
    I just wondered if it's somehow possible to change the hotkey of a skill with GUI/JASS, so when player chooses to use set of 4 spells, the spells will always align to QWER/ZXCV or something like that.

    I have an idea that I think will work but that would be more complex than I would like it to be
    My way would be:
    1. Create spells based on chanel that would have Q, W, E, R assigned as their hotkeys.
    2. When player choses what spell he wants to use: Use triggers to change icon, tooltip, cooldown and so on of the for example QSpell to desired values
    3. Set a Variable for example "Fireball" = QSpell

    First of all do you think there is an easier way?
    Second - do you think the way presented above will work if nothing else will?
    Thanks in advance, and sorry if I'm not seeing something obvious somewhere in the editor.
     
  2. Chaosium

    Chaosium

    Joined:
    Aug 29, 2012
    Messages:
    399
    Resources:
    2
    Models:
    2
    Resources:
    2
    There doesn't seem to be any action in GUI to change hotkey.

    What you suggest would probably work to an extent, but you won't be able to change things like range, mana cost or even turn an instant spell into a targeted one via trigger, so you might run into limitations.

    Honestly I don't see any easy solution for this. The most simple would be to create 4 versions of all of your abilities with different hotkeys each, which isn't optimal at all.

    Else, you might want to assign specific types of spells only to specific hotkeys (e.g. Q would be a single target, W an AoE, etc.) but it would limit choices.
     
  3. Astrella

    Astrella

    Joined:
    Oct 3, 2008
    Messages:
    151
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Iirc the patch notes did say something about a native for changing hotkeys being added.

    Code (Text):
    native SetAbilityPosX: takes integer abilCode, integer x returns nothing
    native SetAbilityPosY: takes integer abilCode, integer y returns nothing
     
  4. MooNek

    MooNek

    Joined:
    Jul 18, 2010
    Messages:
    148
    Resources:
    0
    Resources:
    0
    My idea would work for me cause all of my spells are triggered anyway and every object editor value for them is the same, all based of chanel ability. So range and so on is not a problem in my case.
    Guess I'll do it like that then if I won't find official notes stating that hotkey change will be added.
    Btw. Mana cost can be changed with GUI