• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

GetAbilityMaxLevels

Status
Not open for further replies.
Level 13
Joined
Mar 29, 2012
Messages
542
I used this on my spell to set variables related with ability levels, so I want to share with you cuz I'm still unsure too about things like: is it okay to use this (create a unit) on map initialization? What's the best unit type to use? And is this effective?
JASS:
function GetAbilityMaxLevels takes integer abilCode returns integer
    local integer result
    local unit dummy = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'Naka', 0, 0, 0)
   
    call UnitAddAbility(dummy, abilCode)
    call SetUnitAbilityLevel(dummy, abilCode, 100)
    set result = GetUnitAbilityLevel(dummy, abilCode)
   
    call RemoveUnit(dummy)
    set dummy = null
   
    return result
endfunction
 
I don't think it's reasonable to make this single function a library, need to add more useful functions.
Mostly a system should not have as much functionality as possible, but rather the opposite is better. The thinking to have extra more functionality for the sense of submitting should happen carefully. ;P

In my opinion it's a bit too simple for a submission, not only from JASS-side, but the concept in general. One can also replicate this functionality pretty easy using GUI. Lab seems fine imo, or also maybe here Small Code Snippets.
 
Last edited:
Status
Not open for further replies.
Top