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

Unit type specific mine

Status
Not open for further replies.
I need a a goblin mine to be triggered only by mechanical units and have the target AOE shown when choosing where to place it. IE when attempting to place it in deep water it should trigger an error message.

I've been struggling with this for some time and can't seem to find a solution. I've tried using various dummy spells and altering what targets the AOE damage upon death spell has.
 
Level 6
Joined
May 11, 2010
Messages
237
Urgh, I got it working but I can't have more than 1 mine working at a time. I'm trying to work out how. Hopefully someone will help before I figure it out.
 
Level 5
Joined
Sep 1, 2010
Messages
168
It's easy
You'll need a dummy spell that shows your aoe (like silence) to place, then a condition check upon starts casting an ability (here you'll stop the unit if impossible and show error message) you conditions.
Another trigger that fires when 'unit starts effect of an ability' which creates you mine dummy unit and uses the action - event - "a unit matching (your condition) comes within (your aoe) of last created unit" to another trigger.
That last trigger only has action code: pick every unit of unit type (your mine) in (your aoe) around triggering unit
-kill picked unit
-damage triggering unit for (whatever damage)

(just an explanation above, no acutal coding, no leak removal)
If you want to use hashtables instead, you could create a mine group and check like every 0.1 seconds:
pick every unit in minegroup
-set currentmine =picked unit
if(a unit matching (your condition) is within (your aoe) of current mine
-damage all units matching (your condition) within (your oae) of currentmine for damage xyz
remove currentmine from minegroup
-kill currentmine

The latter deals damage to all units to all units matching your condition, the earlier only to the triggering unit - depends on what you want to achieve with your mine, though i believe that the 2nd version is a) better and b) if you want effect a) youcan achieve it too.
 
Status
Not open for further replies.
Top