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

Covert Ability description to a String with triggers

Status
Not open for further replies.
Level 10
Joined
Aug 25, 2004
Messages
473
Has anyone found a way yet to read stats like "damage", "description" "cost" and other, from the data editor with triggers. Maybe with catalog or data table.
Also, there is a function to display a screen button. But for that, you need a ScreenButtonID (its an integer only value, so its not the button ID from the raw data)
 
Level 11
Joined
Aug 1, 2009
Messages
963
The catalog field value get function is as follows:

string CatalogFieldValueGet (int catalog, string entry, string path, int player);

so, if you wanted to get the energy cost of an ability, you would do:
CatalogFieldValueGet(c_gameCatalogAbil, [name of ability], Cost[0].Energy, -1);
This should work, but if it doesn't try other variations with the Cost part, it might be CostArray[0]. or Cost[0].Link

Furthermore, you can also grab the default button used for the ability and thus get the tooltip, icon, etc. For example...
JASS:
string mybutton = CatalogFieldValueGet(c_gameCatalogAbil, [abilname], CmdButtonArray[Execute], -1);
string icon = CatalogFieldValueGet(c_gameCatalogButton, mybutton, Icon, -1);
text tooltip = StringExternal(CatalogFieldValueGet(c_gameCatalogButton, mybutton, Tooltip, -1);

Tell me if this doesn't work, since I don't have my editor right now I can't test myself.
 
Status
Not open for further replies.
Top