• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

(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.
 
Level 11
Joined
Feb 23, 2009
Messages
577
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
 
Level 11
Joined
Feb 23, 2009
Messages
577
It seems like the Level Skip Requirement always returns 0?
Is this a bug that will "soon be fixed" or is it just for me that it isn't working?

  • Set TPHAS_Integer_B = (Ability: (Unit: TPHAS_Unit's Ability with Ability Code: TPHAS_Ability)'s Integer Field: Level Skip Requirement ('alsk'))
 
Status
Not open for further replies.
Top