• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Mass Raise Dead: How to Select Corpses

Status
Not open for further replies.
Level 4
Joined
Dec 24, 2016
Messages
42
Hello Everyone,

I am wanting to create a spell that works like a "Mass Raise Dead." I want it to find all corpses around the caster then raise zombies at each one while getting rid of the corpse. However, I am unable to find a method for selecting unit corpses as a unit group. I have tried two different things.

1. I have tried creating a DUMMY with Raise Dead (99999 Range, 99999 AoE, 0 CD, 0 Mana) and used the boolean, "Matching Unit is Dead = True," then picked each unit and ordered Necro - Raise Dead for the DUMMY.

2. The other method I tried was picking each unit ("Matching Unit is Dead = True") then using a create trigger to create the Zombies (just to see if the triggers selected the group in the first place).

So how can I select corpses as part of a unit group? Is it even possible? And if not, what are other methods I could use for having a "Mass Raise Dead"
 
Level 11
Joined
Jan 2, 2016
Messages
472
  • Events - Unit starts an effect of an ability
  • Conditions - Ability being cast equal to `Your Ability `
  • Actions
    • Custom script: set cast_loc = Position of Triggering Unit
    • Custom script: set dead_group = Unit Group - Pick every unit in (Units within 300 of ( cast_loc ) matching (((Matching unit ) is dead ) Equal to True))
    • Unit Group - Pick every unit in dead_group and do Actions
      • Custom script: set dead_pos = Position of Picked Unit
      • Unit - Create a dummy unit at dead_pos for ( Owner of Triggering Unit )
      • Unit - Issue Last Created unit to Undead Necromancer - Activate Raise Dead
      • Unit - Add a 2 second expiration timer to Last Create Unit
      • Custom script: call RemoveLocation(udg_dead_pos)
    • Custom script: call RemoveLocation(udg_cast_loc)
    • Custom script: call DestroyGroup(udg_dead_group)
I guess it would look something like this.All you need to do is add the Raise Dead spell to your dummy unit.And set it's cast range to something like 50 or less.
 
Level 10
Joined
Sep 25, 2013
Messages
521
If you set the raise dead cooldown to 0 and mana to 0, and set its range to the same distance that you want the spell to affect, why would you need to create a unit group? If the raise dead ability is autocasted, then shouldn't it immediately raise all dead within range? And then you just add a short expiration timer to the dummy unit.
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
Autocast is not instant. It takes a short time for the unit to realize that it should cast.

I tried creating one dummy for each corpse at the position of the caster and let it cast raise dead. It worked fine for me. Every nearby corpse was used.
 
Level 39
Joined
Feb 27, 2007
Messages
4,992
If the dummy has 0 cast point and 0 backswing (additional delays built into casting times beyond the spell's parameters) it will STILL have to turn to face the target points individually so will take some time to do so because turning can't be instant. You pretty much need 1 dummy per simultaneous spell cast.
 
Level 4
Joined
Dec 24, 2016
Messages
42
Thank you to everyone who advised me on figuring this out. I am able to get it to work now.

I selected each (Dead Unit) then just created a unit and added SFX over each corpse the removed the corpse (Preventing leaks of course)
I had made a mistake in the unit positioning of the caster. (Sadly, I didn't catch this mistake earlier)

I have not been able to make a Dummy cast Raise Dead even trying out the above methods and a few others.
I am under the impression that Raise Dead is a bit weird from other spells
 
Status
Not open for further replies.
Top