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

Damage Detection (system) for destructibles?

Status
Not open for further replies.
Level 12
Joined
Feb 22, 2010
Messages
1,115
You could compare each destructible's hit points to a previous amount, and then just randomly pick a nearby peon. Not a good idea if you have a lot of destructibles.

Best method would be to use units instead.

I sense something here.
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
I created 6000 trees and looped every 0.1 second through all of them and compared their current hp to a saved value. Its quite resource intensive, in the otherwise nearly empty map was no noticeable /fps difference though. Note that I was using an optimized JASS loop and not GUI.

This does not give you the "attacker" though. For this you would have to use fake destructible units, as said above. And 6000 unit on the map is a no-go..

Just catching orders is not that good either. First its just an order, so is not directly related to damaging a tree and second a normal peon can start harvesting on different orders.

Its hard to say what is best for you, please specify what you want to do exactly.
 
Status
Not open for further replies.
Top