| 08-31-2009, 11:11 AM | #1 |
so for the 2nd race-building contest i have a race that collects corpses to stitch together a Flesh Giant supreme unit. i have this special utility building 'Graveyard' that collects the corpses of the fallen from the map. for this ability i have something that indexes corpses when they are at a graveyard so graveyards dont steal from each other. i use AutoIndex and TransportEvents to detect when a corpse is taken from a Graveyard, so it gets 'released' from the graveyard. the problem is that these methods dont detect when corpses are Cannibalize'd. how can i detect this AND with reference to the object corpse that is eaten? edit: also, does anyone know how to manage:create/destroy/adjust instances of triggered ability data when abilities are added/removed/adjusted for units? also, how to define a corpse? this is the filter i use: JASS:return IsUnitType(GetFilterUnit(), UNIT_TYPE_DEAD) maybe i can make (another) index of decaying units by the EVENT_PLAYER_UNIT_DECAY and GetDecayingUnit() + timer and AutoIndex (if this works with decays). but this is more work than just a filter and id rather do with the latter. |
| 08-31-2009, 01:22 PM | #2 |
JASS:function IsUnitCorpse takes unit u returns boolean return IsUnitType(u, UNIT_TYPE_DEAD) and GetUnitTypeId(u) != 0 endfunction Try this on your gargoyles in either case. Maybe their type id's go to 0 on death. If you just want to detect cannibalize, detect the spell effect event. |
| 08-31-2009, 02:03 PM | #3 |
doesnt work. gargoyles still pass as corpses. |
| 08-31-2009, 02:15 PM | #4 |
And AutoIndex doesn't show them as having been removed? |
| 08-31-2009, 02:21 PM | #5 |
that worked why oh why didnt i just use autoindex (which i already had) haha edit: that unitId check worked for units used for cannibalize. after they got eaten, their unitIds were 0. i guess i cna just do a periodic check on buried corpses... for all graveyards. maybe i could just run this check when a cannibalize spell is casted but that would require indexing all cannibalize-based spells... |
