• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Get Unit Resource Cost in Trigger

Status
Not open for further replies.
Level 1
Joined
May 24, 2010
Messages
1
I need to be able to get these values for any random trigger unit and store them as a variable. Any ideas?

attachment.php


Edit: To be more clear, I want to give the Player that kills any unit on the map the amount of resources that unit cost, multiplied by some factor. So if there's another way that doesn't involve editing kill resource for each unit...
 

Attachments

  • editorhelp.png
    editorhelp.png
    17.8 KB · Views: 368
Last edited:
Level 2
Joined
Dec 1, 2007
Messages
11
The main part I don't know how to do is how to get the name of the field data element, so as to reference it. In your case it will be something relating the name of the unit type to "CUnit_CostResource" to name the Data Field element you're looking for. IE: Factory.CUnit_CostResource

Then you somehow extract this data using the "Value from data table" function. For the resource cost list, it's either going to be an integer array or a string (with "|" as the delimiter.)

EDIT: It must be one of the Catalog functions. Probably CatalogFieldValueGet: http://www.sc2mapster.com/api-docs/functions/catalog-field-value-get/

Well, I assume that's how.
 
Last edited:
Status
Not open for further replies.
Top