HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Finding Gold/Lumber Cost?

10-25-2008, 03:41 AM#1
Ignitedstar
I just can't find the function... or is there one?

I've been looking for the past twenty minutes or so, and I can't find any native that allows one to get the gold and/or lumber cost of a unit. Wasn't there a way to find it? The closest things I can find are GetUnitFoodUsed(unit), GetUnitFoodMade(unit), and GetUnitPointValue(unit). I can't use those because I am currently using the food resource for something else, and point value is used for distributing experience since I don't really like how the Game Constants does it. If I can't find it, then it's either because it doesn't exist or I don't know exactly what the name of the native is. I THINK I saw it once... I'm not sure, though. If anyone can redirect me, that'd be great.

Thanks in advance.
10-25-2008, 11:53 AM#2
moyack
unfortunately those natives are only for AI scripting and not for trigger script :(

But not despair!! Griffo did a very good system to get those values... http://www.wc3campaigns.net/showthre...ight=Gold+cost
10-25-2008, 12:31 PM#3
Skater
Actually you can use this natives; you have just to import a modified version of common.j in which those natives are listed. And (not sure about this) you have to import the common.ai .

Both have to be in Scripts\
10-26-2008, 12:52 AM#4
Ignitedstar
Um... I'm afraid of murdering Warcraft III by opening the common.j and/or common.ai. I would try, otherwise, but I can't risk losing anything (if anything is lost at all). I'm just really paranoid about that kind of stuff.

On the other hand, Captain Griffen's system looks promising... I will try it out. Thank you, moyack.
02-22-2010, 02:58 AM#5
daPanda
Quote:
Originally Posted by moyack
unfortunately those natives are only for AI scripting and not for trigger script :(

But not despair!! Griffo did a very good system to get those values... http://www.wc3campaigns.net/showthre...ight=Gold+cost
I realize this thread is old, but it's the most recent that came up in a search.

That link is dead. Is there any way to obtain the Gold/Wood cost of a unit/upgrade using triggers/vjass?

I've already tried using the GetUnitGoldCost() in common.ai. It imports and compiles fine, but when you go to run the map it won't work in the WC3 (there are no player selection slots to choose players and thus can't load the map).