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

Trigger help!

Status
Not open for further replies.
Level 9
Joined
Mar 31, 2012
Messages
205
I been struggling with this for a while, I want to make a trigger that checks who was the last unit to attack this other unit, you know what I mean? kind of similar to the assist trigger that most killstreak systems have but I need it in simple GUI. yay im a nub :c

In my map I have a lot of knockback spells, thing is when they are knocked back into a specific region they die and when they die I want a message to show up like "Player blah killed player blah" but I cant because they are beign knocked back into the region by this trigger, another thing would be how to edit the knockback system but i dont dare touch that. I'd rather have trigger check who was the last one to deal damage to the unit entering the region that kills the unit. Hopefully somebody understands what I am saying :B
 
Level 9
Joined
Mar 31, 2012
Messages
205
Level 6
Joined
Oct 1, 2012
Messages
166
Due to the fact, that you need ANY unit to be recorded, you can simply make attack detection trigger with damage detection trigger inside. The latter trigger would, for example, save the DamageSource into a global variable.

Then, another trigger would see if a unit dies and gives gold/xp to unit saved in global variable.

I am to understand you have plenty of those units to be killed, so you might consider having global variables array with every index corresponding to different unit.

You can use some dummy skills, like a Bash-based 100-lvls skill. Every unit would have it on different lvl (the skill would be hidden, of course) and when the unit is damaged, you would save the DamageSource as a global variable [GetUnitAbilityLevel(GetDamagedUnit(), <<this dummy bash skill>>)].
Of course, if you have more than 100 units to be killed in a short instance of time, I'll have to think about something else...
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Status
Not open for further replies.
Top