SC2Mapster Forums

Development > Triggers

How to get string path of image from variable.

  • 6 posts
    #1 Jan 20, 2013 at 19:38 UTC - 0 likes

    Hello, i have a problem. For my UI i need to get string path of image from Game LInk variable.

    Lets say i have global variable "Hero Active Skill" with class "Game Link/Ability"

    Now in some trigger i need to call icon of Hero Active Skill. I know i can do it with "Convert Game Asset" but how do i get "Hero Active Skill" icon path?

    #2 Jan 20, 2013 at 20:27 UTC - 0 likes

    you make another variable
    "Hero active skill icon" <file - image>

    I'm a triggerer
    I can't make awesome terrains
    I dabble in data

    I suck at poems
    That is why i do haiku
    i suck at them too :(

    #3 Jan 20, 2013 at 21:16 UTC - 1 like

    You mean how to get the path of icon of the in "Hero Active Skill" saved ability?

    Unfortunately, that's not trivial. Basically, you can get the icon using the "Catalog Field Value Get" function. Many abilities have several different commands (for instance "Build" abilities), each having a seperate icon. Those icons are not saved directly in the ability, but in a button. Depending on the type of the ability, you will find that button in the "Ability: Commands+" or "Ability: Info+" property. Use this link in the call of "Catalog Field Value Get". Then save the result as a button and call "Catalog Field Value Get" again, this time using the button and the link "UI: Icon", to get the button's icon.

    #4 Jan 21, 2013 at 05:32 UTC - 0 likes

    or he can save the image in a variable :)

    #5 Jan 21, 2013 at 07:02 UTC - 0 likes

    You''ll probably just want to have function to return the image based on the ability (if you need mulitple images from mulitple abilities.

    When I want your opinion...I'll give it to you!

    http://www.sc2pod.com/achievement.php?id=13361

    #6 Jan 21, 2013 at 09:36 UTC - 0 likes

    Yay! I did it! Thx Sanktoras!
    Basically its trivial now.
    If anyone else need to get any info from ability or behavior here how to do it:
    1) Save your ability to variable.
    NOTE: ID of your ability have to be exactly same as ID of its button. And if you save behavior, then you need to specify behavior type.
    2) In parameter of your action or condition you need to use conversion function.
    NOTE: There are few of them. Use correct one. If its text you after then use "Convert Game Text" function. If its asset like icon, then use "Convert Game Asset" and so on.
    3) In path parameter use "Catalog Field Value Get" and set catalog value from preset. If you after ability info - go for button, if its behavior info then go for behavior. Everything else is self-explanatory.

    Last edited Jan 21, 2013 by Fireball14
  • 6 posts

You must login to post a comment. Don't have an account? Register to get one!