1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Changing Ability Hotkey

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

  1. MooNek

    MooNek

    Joined:
    Jul 18, 2010
    Messages:
    152
    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:
    406
    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:
    152
    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