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 haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Join the 6th Melee Mapping Contest for a chance to have your map featured in this year's Hive Cup!
    Dismiss Notice
  4. Shoot to thrill, play to kill. Sate your hunger with the 33rd Modeling Contest!
    Dismiss Notice
  5. Do you hear boss music? It's the 17th Mini Mapping Contest!
    Dismiss Notice
  6. Weave light to take you to your highest hopes - the 6th Special Effect Contest is here!
    Dismiss Notice
  7. 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.

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

Discussion in 'Requests' started by ThisPOT, Aug 6, 2019.

  1. ThisPOT

    ThisPOT

    Joined:
    Feb 23, 2009
    Messages:
    570
    Resources:
    3
    Spells:
    3
    Resources:
    3
    As title says :)

    I am trying to fetch Abilities' level and other requirements for a Hero Ability system that I am making.
    The level req is the most important though... Is there any way to do this using custom script?
     
  2. ThisPOT

    ThisPOT

    Joined:
    Feb 23, 2009
    Messages:
    570
    Resources:
    3
    Spells:
    3
    Resources:
    3
    Anyone please :eek:?

    If there is no custom text to do this, maybe someone knows a work around to still get it?
     
  3. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,563
    Resources:
    18
    Tools:
    2
    Maps:
    3
    Spells:
    8
    Tutorials:
    4
    JASS:
    1
    Resources:
    18
    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.
     
  4. ThisPOT

    ThisPOT

    Joined:
    Feb 23, 2009
    Messages:
    570
    Resources:
    3
    Spells:
    3
    Resources:
    3
    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...

    Here I presume I just add the ability as usual, the unit the needs the ability?

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

    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: Aug 8, 2019
  5. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,563
    Resources:
    18
    Tools:
    2
    Maps:
    3
    Spells:
    8
    Tutorials:
    4
    JASS:
    1
    Resources:
    18
    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
     
  6. ThisPOT

    ThisPOT

    Joined:
    Feb 23, 2009
    Messages:
    570
    Resources:
    3
    Spells:
    3
    Resources:
    3
    Any way you could upload a test map with those triggers xD?

    Thanks for all this, and sorry for not getting it faster, I tend to block sometimes not sure why (maybe I'm 1/2 retarded).
     
  7. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,563
    Resources:
    18
    Tools:
    2
    Maps:
    3
    Spells:
    8
    Tutorials:
    4
    JASS:
    1
    Resources:
    18
    Here you go. It has some changes cause one has to type raw ids like AHbz, AHhb or AHtc
     

    Attached Files:

  8. ThisPOT

    ThisPOT

    Joined:
    Feb 23, 2009
    Messages:
    570
    Resources:
    3
    Spells:
    3
    Resources:
    3
    Hmmm it's telling me I'm unable to load that file, it says:

    - Level info data missing or invalid
     
  9. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,563
    Resources:
    18
    Tools:
    2
    Maps:
    3
    Spells:
    8
    Tutorials:
    4
    JASS:
    1
    Resources:
    18
    Are you on Warcraft 3 Version 1.31?
     
  10. ThisPOT

    ThisPOT

    Joined:
    Feb 23, 2009
    Messages:
    570
    Resources:
    3
    Spells:
    3
    Resources:
    3
    Ah damn no, I'm on 1.30... I have no access to Bnet though right now, will try finding a patch somewhere and then I'll try it again.
     
  11. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,563
    Resources:
    18
    Tools:
    2
    Maps:
    3
    Spells:
    8
    Tutorials:
    4
    JASS:
    1
    Resources:
    18
    You could also test this stuff from triggerhappy which should work from 1.29.
     
  12. ThisPOT

    ThisPOT

    Joined:
    Feb 23, 2009
    Messages:
    570
    Resources:
    3
    Spells:
    3
    Resources:
    3
    I am 100% GUI, never done Jass (besides some very few basic things) so I prefer your method if possible ^^.
    If I can't find a patch I will try to do it his way tho.

    EDIT: Reinstalling the game lol...
     
    Last edited: Aug 8, 2019
  13. ThisPOT

    ThisPOT

    Joined:
    Feb 23, 2009
    Messages:
    570
    Resources:
    3
    Spells:
    3
    Resources:
    3
    Holy crap, this new editor is nice at first glance xD.... This is working perfectly, thanks so much!
     
  14. ThisPOT

    ThisPOT

    Joined:
    Feb 23, 2009
    Messages:
    570
    Resources:
    3
    Spells:
    3
    Resources:
    3
    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'))
     
  15. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,563
    Resources:
    18
    Tools:
    2
    Maps:
    3
    Spells:
    8
    Tutorials:
    4
    JASS:
    1
    Resources:
    18
    Yeah sadly not all fields are working correcty, currently.