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

Picking Units raised by Animate Dead Spell?

Level 9
Joined
Apr 15, 2022
Messages
72
Hi. I've wanted to create a spell based on Animate Dead - it would raise a set amount of corpses in an area of effect range, with the twist that they would instead be raised into a specific unit type. You cast Animate Dead and raise zombies (or whatever) from surrounding corpses.

The obvious idea is to use Animate Dead as a base -> use triggers to check when it's being cast -> pick units with "Animated Corpse" buff -> replace picked units with zombies

But for some reason I can't pick the raised units? I've used various conditions and none seem to work (picked unit = unit with a specific buff; picked unit = target of ability being cast; picked unit = summoned unit; etc.). I'm not that highly experienced wth trigger based spells, so the solution shouldn't be that hard to figure out. It's likely me setting it up the wrong way

Before anyone mentions it, the spell differs a lot from raise dead. It's supposed to have a longer cooldown and again, work more akin to mass ressurection than an autocast summon

Any ideas?
 
Last edited:
Level 30
Joined
Aug 29, 2012
Messages
1,383
I think you'd better trigger it entirely, because conveniently enough, you can detect units that are dead like this for instance

  • (Number of units in (Units in (Playable map area) matching (((Matching unit) is dead) Equal to True))) Greater than or equal to 1
So with that in mind you can detect X amount of corpses near the caster, summon Y zombies and remove the corpses
 
Level 9
Joined
Apr 15, 2022
Messages
72
That's a really interesting take. The problem is regular spells could still be cast when there are no corpses around and the ones that detect corpses would waste at least one in the process of the spell being cast.

EDIT: I've figured it out. Based on the trigger example you've posted I've tried replacing (Picked units) with (Matching units). Everything works now.

Thanks.
 
Last edited:
Level 2
Joined
May 27, 2024
Messages
13
I went with another solution, in object editor I just didn't put any units for the spell and then triggered the spawn:
  • Raise Dead Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet RaiseDeadUnitTypes[0] = Skeleton Warrior
      • Set VariableSet RaiseDeadUnitTypes[1] = Skeleton Archer
      • Set VariableSet RaiseDeadUnitTypes[2] = Skeletal Mage
  • Raise Dead
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Raise Dead
    • Actions
      • Unit - Create 1 RaiseDeadUnitTypes[(Random integer number between 0 and 2)] for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
It works, but I guess that's because I'm still resurrecting one at a time.
 
Top