• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] [Ability Button Pos] Can you get a units ability using ability slots, eg (2, 2)? [Solved]

Status
Not open for further replies.
Level 8
Joined
Sep 16, 2016
Messages
227
Using Jass or Wurst, not GUI.

I want to be able to fetch a units Q, W, E, R, T abilities, and they all have the same ability slots across all units
 
Level 8
Joined
Sep 16, 2016
Messages
227
No, but you can make use of the native
JASS:
native BlzGetAbilityByIndex takes unit whichUnit, integer index returns ability
Doesn't work the same way, but for my case I can make a workaround using this

JASS:
    for i = 0 to 6 
        spell = BlzGetUnitAbilityByIndex(u, i)
        if BlzGetAbilityPosX(BlzGetAbilityId(spell)) == 0 and BlzGetAbilityPosY(BlzGetAbilityId(spell)) == 2 and spell != null // Q
            abil_Q[id] = spell
            abilArray[0] = spell
        if BlzGetAbilityPosX(BlzGetAbilityId(spell)) == 1 and BlzGetAbilityPosY(BlzGetAbilityId(spell)) == 2 and spell != null // W
            abil_W[id] = spell
            abilArray[1] = spell
        if BlzGetAbilityPosX(BlzGetAbilityId(spell)) == 2 and BlzGetAbilityPosY(BlzGetAbilityId(spell)) == 2 and spell != null // E
            abil_E[id] = spell
            abilArray[2] = spell
        if BlzGetAbilityPosX(BlzGetAbilityId(spell)) == 3 and BlzGetAbilityPosY(BlzGetAbilityId(spell)) == 2 and spell != null // R
            abil_R[id] = spell
            abilArray[3] = spell
        if BlzGetAbilityPosX(BlzGetAbilityId(spell)) == 3 and BlzGetAbilityPosY(BlzGetAbilityId(spell)) == 1 and spell != null // T
            abil_T[id] = spell
            abilArray[4] = spell
        if BlzGetAbilityPosX(BlzGetAbilityId(spell)) == 2 and BlzGetAbilityPosY(BlzGetAbilityId(spell)) == 1 and spell != null // F
            abil_F[id] = spell
            abilArray[5] = spell
        if BlzGetAbilityPosX(BlzGetAbilityId(spell)) == 1 and BlzGetAbilityPosY(BlzGetAbilityId(spell)) == 1 and spell != null // D
            abil_D[id] = spell
 
Last edited:
Status
Not open for further replies.
Top