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

Get caster of Parasite

Status
Not open for further replies.

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,539
If the Event Responses don't work properly for Parasite you'll probably have to use some advanced methods.

A Unit Indexer or Hashtable could be used to track the Caster of Parasite by linking the Caster to the Target. This way you can get the Caster from the Target when the Target dies.

Alternatively, if there is only a single unit with this Parasite ability then you can easily track the Caster using a unit variable.
 
Last edited:
Level 24
Joined
Feb 9, 2009
Messages
1,787
But if the unit is killed by some other means while parasite is active, parasite will still trigger the unit spawn. Then you can't get the caster this way.
tumblr_mvsrht4E7n1shwi4yo5_250.gifv
 
Level 24
Joined
Feb 9, 2009
Messages
1,787
But if the unit is killed by some other means while parasite is active, parasite will still trigger the unit spawn. Then you can't get the caster this way.
Lethal damage event catches the killer and Damagetype filter via condition or specifc dummy casters could narrow it down.
Damage Engine is way too overkill in my opinion. Unless they actually have the system in their map it's not worth it for a spell that can be solved with the most basic "custom value" method. Just need to link a Unit variable to a Unit.
If someone isn't using damage engine in their map or some equivalent it is already lacking.
Ah yeah, good point.
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
Lethal damage event catches the killer and Damagetype filter via condition or specifc dummy casters could narrow it down.
I don't think you understand the issue. The damage source is not necessarily the caster because the damage source could be something else entirely that happens to kill the unit and then spawn the parasite. Parasite doesn't require the caster to kill the target for a unit to spawn; it requires that the target dies while it has the buff. It could even be killed by a trigger or by a unit owned by a different player, etc..

The only solution I see is attaching information about the caster to the targeted unit (in a hashtable), so this info can be retrieved.
 
Level 13
Joined
Oct 16, 2010
Messages
731
I don't think you understand the issue. The damage source is not necessarily the caster because the damage source could be something else entirely that happens to kill the unit and then spawn the parasite. Parasite doesn't require the caster to kill the target for a unit to spawn; it requires that the target dies while it has the buff. It could even be killed by a trigger or by a unit owned by a different player, etc..

The only solution I see is attaching information about the caster to the targeted unit (in a hashtable), so this info can be retrieved.

Hey, I've never used hashtables before, would you be able to explain how to do this?
 
Level 24
Joined
Feb 9, 2009
Messages
1,787

First one is how I learned, it has an excellent test map to fiddle with.
 
Status
Not open for further replies.
Top