• 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.

Add gold equivalent to damage dealt to destructible?

Status
Not open for further replies.
Level 8
Joined
Jul 29, 2010
Messages
319
I've replaced gold mines on my map with "Gold Ore." The ore itself is basically a copy of the destructible "rock chunks" but with a different model, so that when it's right-clicked, it's attacked instead and I want a system that adds the gold equivalent to the damage that is being dealt per hit to the destructible, so if the peasant hit's a 5 or an 8, then 5 gold or 8 gold will be added, Thanks in advance, all help is appreciated :D
 
Level 8
Joined
Jan 28, 2016
Messages
486
You can't detect when a destructible takes damage like you can with units (as far as I know) but you can try modifying the Orcs' Pillage ability and creating custom "Gold Ore" buildings with the Ancient tag; could work with Neutral too, depends on your map. I can't remember how the ratio for Pillage works exactly but I managed to make a psuedo-resource for a request back in the day using this technique.
 
Level 8
Joined
Jul 29, 2010
Messages
319
You can't detect when a destructible takes damage like you can with units (as far as I know) but you can try modifying the Orcs' Pillage ability and creating custom "Gold Ore" buildings with the Ancient tag; could work with Neutral too, depends on your map. I can't remember how the ratio for Pillage works exactly but I managed to make a psuedo-resource for a request back in the day using this technique.
I'm trying to use your idea, editing pillage, i can't seem to get it to work with neutral buildings, no matter what tags I use :/

EDIT: Never mind, it was working but seems due to the peasants low damage, it took a fair few hits to generate gold, I'll have a look in constants for the pillage ratio

Update: so i've found that the ratio is in the ability itself, "salvage cost" and it's set to 50% so i'm gonna assume that it mean 50% of your damage dealt, i might crank it up to 100% since peasants deal such low damage, thanks for the idea :D

PS: how do i get pillage to only harvest gold and not lumber?
 
Last edited:
Level 8
Joined
Jan 28, 2016
Messages
486
You can use the Ancient classification to distinguish the building from others

I think I found a thread a long time ago which explained how the Pillage ratio works but I can't find it. They said that it involves a few factors, so it's probably not as straightforward as you might think. Then again, I could be wrong. :p

As Marcos said, you have to edit the building's cost. Make sure it doesn't cost any lumber and you're good.
 
Status
Not open for further replies.
Top