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 havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  4. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  5. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  9. 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.

Covert Ability description to a String with triggers

Discussion in 'StarCraft II Modding' started by Doctor-Pepper, Jul 24, 2010.

  1. Doctor-Pepper

    Doctor-Pepper

    Joined:
    Aug 25, 2004
    Messages:
    481
    Resources:
    4
    Maps:
    3
    Tutorials:
    1
    Resources:
    4
    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)
     
  2. P-Exodus

    P-Exodus

    Joined:
    Jan 29, 2008
    Messages:
    38
    Resources:
    2
    Maps:
    2
    Resources:
    2
    Well, you mostly answered this yourself. It's the catalog.

    • Variable - Set Damage = (Real((Value of Effects "EffectID "Amount" for player Any Player)))
     
  3. mrzwach

    mrzwach

    Joined:
    Aug 1, 2009
    Messages:
    929
    Resources:
    3
    Tutorials:
    3
    Resources:
    3
    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...
    Code (vJASS):
    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.
     
  4. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,476
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    I was sure someone mentioned it being fieldname[index].link.
     
  5. mrzwach

    mrzwach

    Joined:
    Aug 1, 2009
    Messages:
    929
    Resources:
    3
    Tutorials:
    3
    Resources:
    3
    You need .Link for some catalog fields, but not all from what I've seen. Not sure why though :\
     
  6. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,476
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Its due to the way data is stored and axcessed in memory.