• 🏆 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!

Registering the icon of a hero

Status
Not open for further replies.
Level 3
Joined
Jan 7, 2008
Messages
45
Is there GUI or Jass (vJass as well) which allows you to get the path of an icon of a hero, and save it into a string?

I need this because i'm making a multiboard, and i wish for the icon of the hero to be applied in the multiboard, however it would be very painfull to have to make an if/then/else for each and every hero that can be picked, and then apply the correct path, and i would like it if there was just a method to get the path icon of the picked hero.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
I don't think such function exists.

I'd do it like this:

Set arrays like this:
  • Set Unit_Type_Array[0] = Paladin
  • Set Unit_Type_Array[1] = Mountain King
  • Set String_Array[0] = ReplaceableTextures\CommandButtons\BTNHeroPaladin.blp
  • Set String_Array[1] = ReplaceableTextures\CommandButtons\BTNHeroMountainKing.blp
Then change the icons like this:
  • For each (Integer A) from 0 to 1, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Unit_Type_Array[(Integer A)]
        • Then - Actions
          • Multiboard - Set the icon for (*multiboard*) item in column 1, row 1 to String_Array[(Integer A)]
          • Skip remaining actions
        • Else - Actions
 
Status
Not open for further replies.
Top