• 🏆 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!

Aoe spell to delete corpses in a region?

Status
Not open for further replies.
Level 4
Joined
Nov 3, 2006
Messages
61
Hi guys this probably has a very simple solution but ive been at it for hours and im stumped lol. What the deal is is that im trying to script an aoe spell which deletes corpses so long as the corpses are in a certain region e.g deletes all corpses inside the aoe spell if they are in the region, if they arent in the region the spell does nothing. Any help would be great!
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
Enumerate units that are dead. Then use Remove Unit to remove the corpse.

Ex:
  • Set TempLoc = (Target point of ability being cast)
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units within 512.00 of TempLoc matching (((Matching unit) is dead) Equal to True)) and do (Actions)
    • Loop - Actions
      • Unit - Remove (Picked unit) from the game
  • Custom script: call RemoveLocation(udg_TempLoc)
Note that this will remove any dead unit, meaning it will remove units that died before they may have decayed. I can't think of an easy way to tell if the unit is decaying or not.
 
Level 4
Joined
Nov 3, 2006
Messages
61
hi, thanks for the help! well ive had a mess around with it and so far ive found there are gui triggers which check whether a unit is "decaying" however the main problem im encountering is that i need a dummy spell which targets corpses because if i can get a spell which does that i can use that condition to check if the unit is decaying which means the triggers will only affect the corpses. Well this is my theory but before i can test it i need a way to target the corpses :\... ive been messing around with the targets allowed sections of spells however i currently havent gotten any spells to do so any ideas?
 
Level 4
Joined
Nov 3, 2006
Messages
61
Hey thanks for the response, however ive already tried a mechanic with raise dead and it seems as if the spell has no option but to summon units (you cant choose whether they are summoned or not just which units are summoned). Also I forgot to mention this spell is intended for a non hero unit which means I cant use animate dead. By aoe by the way i meant an ordinance based spell such as blizzard or rain of fire. :\ im really looking into this whole spell allowable target thing just by the name it seems as if thats the property i need to change but i just cant seem to get it right, does anyone have an in depth understanding of that option?
 
Level 4
Joined
Jul 23, 2008
Messages
99
Maybe you should try to play with "targets allowed". Some combinations make your way to do that.
 
Status
Not open for further replies.
Top