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

Custom Race Lumber Harvesting

Status
Not open for further replies.
Level 5
Joined
Aug 14, 2020
Messages
118
Hi everyone, this was supposed to be an easy thing but when I started working on triggers I found out that it's almost impossible! all I wanna do is to force workers of a certain race to only harvest from Crystals instead of trees but other races can harvest from both crystals and trees. it feels like there is no way to detect if worker is harvesting from a tree. does anyone has any idea?
 
You could detect when a unit is issued an order targeting a Destructible.

If the unit is equal to the worker you want to harvest only from Crystals, then you can check if the Destructible isn't a Crystal. If it's not, you can order the unit to Stop and, depending on how detailed you want to get, you can play an Error sound byte and display a custom error message to the player.

The only real issue with this approach is that forcing a Stop command will interfere with queued orders, but outside of that this should work for you.
 
Status
Not open for further replies.
Top