• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

(Solved) How to get the Ability Level Req and other reqs (with triggers)

Status
Not open for further replies.
One can get such things with the new ability instance API. You add the abilityCode to an unit and get the ability of it. Then read the wanted Integer Fields.
  • Set Unit = Bergkönig 0000 <gen>
  • Set Skill = Blizzard
  • Unit - Add Skill to Unit
  • Game - Display to (All players) the text: (String((Ability: (Unit: Unit's Ability with Ability Code: Skill)'s Integer Field: Levels ('alev'))))
  • Game - Display to (All players) the text: (String((Ability: (Unit: Unit's Ability with Ability Code: Skill)'s Integer Field: Level Skip Requirement ('alsk'))))
  • Game - Display to (All players) the text: (String((Ability: (Unit: Unit's Ability with Ability Code: Skill)'s Integer Field: Required Level ('arlv'))))
  • Unit - Remove Skill from Unit
There is also the Option to use something triggerhappy discovered in 1.29: Dynamically Retrieve Object Editor Fields That does write and read Tooltips using the object Editor field reference system.
 
I am trying your suggestion right now, will let you know how/if it worked :)... Ty!


EDIT: I think I need a little more guidance if that would be ok my friend...

You add the abilityCode to an unit
Here I presume I just add the ability as usual, the unit the needs the ability?

and get the ability of it
What do you mean by get the ability of it? I only know how to refer to abilities, not abilities of a specific unit?

Then read the wanted Integer Fields
That, yes :).... But I don't understand how I am supposed to get there hehe...

I guess If you could break down how you made that I would probably understand:
  • Display to (All players) the text: (String((Ability: (Unit: Unit's Ability with Ability Code: Skill)'s Integer Field: Levels ('alev'))))
I get what we are trying to do here, I just don't understand the steps to take within the string converted to integer

Your help is much appreciated, and I will give credits in the new system I am releasing!
 
Last edited:
The new ability instance api reads data of an ability beeing obtained by one specific unit. Thats why one needs an unit that has an unmodified version of it, hence one adds the ability to some random dummy unit.
After one added the Ability to the dummy unit one loads the ability object beeing owned by that unit of the wanted abilitycode here (Blizzard).
Having that ability object now one reads the Integer Fields of it.
Levels ('alev')
Level Skip Requirement
Required Level

At last we remove the ability from the dummy again.

  • Actions
    • Set Unit = Some Unit
    • Set SpellCode = Blizzard
    • Unit - Add SpellCode to Unit
    • Set Spell = (Unit: Unit's Ability with Ability Code: SpellCode)
    • Set LevelReq = (Ability: Spell's Integer Field: Required Level ('arlv'))
    • Set LevelSkip = (Ability: Spell's Integer Field: Level Skip Requirement ('alsk'))
    • Set Levels = (Ability: Spell's Integer Field: Levels ('alev'))
    • Unit - Remove SpellCode from Unit
 
Status
Not open for further replies.
Back
Top