Killing source?

FannyShaver

Well-Known Member
Reaction score
31
Well, I was trying to make a sound when unit is getting killed by an ability but I coulnd't find a way to do so. Is there anything like, Killing source equal to Thunder Bolt or around it?
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
Only think i think you can track is the buff. Also maybe Incinerate. Maybe Jass has this function. Doubtful.
 

Whisky

New Member
Reaction score
45
Dying units don't have buffs. I would suggest you to trigger that stormbolt damage so you can detect it.
 

FannyShaver

Well-Known Member
Reaction score
31
I think it's gonna be a bit complicated. I was more like a GUI system to do this.

Like:

Trigger:
  • Soul Corruption Kills
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Soul Corruption
    • Actions
      • Set TempUnit_SC = (Target unit of ability being cast)
      • If ((TempUnit_SC is alive) Equal to False) then do (Sound - Play headshot <gen>) else do (Do nothing)
      • Set TempUnit_SC = No unit


It sometimes works, sometimes not. If you add a Wait 0.05 seconds is the same.
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
Maybe give the caster a buff to track him?
NOT TESTED
Trigger:
  • Melee Initialization
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Unit - Create 1 Footman for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Acid Bomb to (Triggering unit)
      • Unit - Order (Last created unit) to Neutral Alchemist - Acid Bomb (Triggering unit)

Trigger:
  • Untitled Trigger 001
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set My_Unit = (Units in (Playable map area) matching (((Matching unit) has buff Acid Bomb) Equal to True))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in My_Unit) Greater than 0
        • Then - Actions
          • Sound - Play My sound
        • Else - Actions
 

FannyShaver

Well-Known Member
Reaction score
31
Well, in fact this acid bomb will not be casted that fast. Just tested with another dummy unit I already have. Ain't got enough time to cast the spell as Soul Corrpution, Death Coil base spell is killing and he can't cast a spell.
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
Why not
Trigger:
  • Untitled Trigger 002
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Death Coil
    • Actions
      • Sound - Play Killed <gen>

If its so fast...
 

FannyShaver

Well-Known Member
Reaction score
31
No. I just found out. If you set a wait time you need to take into consideration time the missile will reach the target. As I said it sometimes work if there is a wait on it. I had 0.05 on it. Works if you shot from very close range and doesn't if it's bit far. It's because target is far enough for 0.05 to pass. I just upgraded trigger a bit to get the casting range. Works well. Thanks for help.
 

FannyShaver

Well-Known Member
Reaction score
31
Trigger:
  • Soul Corruption Kills
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Soul Corruption
    • Actions
      • Set TempUnit_SC = (Target unit of ability being cast)
      • Wait 0.05 seconds
      • If ((TempUnit_SC is alive) Equal to False) then do (Sound - Play headshot <gen>) else do (Do nothing)
      • Wait 0.05 seconds
      • If ((TempUnit_SC is alive) Equal to False) then do (Sound - Play headshot <gen>) else do (Do nothing)
      • Wait 0.05 seconds
      • If ((TempUnit_SC is alive) Equal to False) then do (Sound - Play headshot <gen>) else do (Do nothing)
      • Wait 0.05 seconds
      • If ((TempUnit_SC is alive) Equal to False) then do (Sound - Play headshot <gen>) else do (Do nothing)
      • Set TempUnit_SC = No unit


The reason it works is that wc3 doesn't play few sounds of the same origin at same time, so basicly whenever unit is killed, according to the distance, sound is played as soon as he is dead. Works and doesn't leak, for all I care...
 

Whisky

New Member
Reaction score
45
@ FannyShaver: Minimum possible wait is 0.27 seconds, everything smaller than that will just be rounded up. If you want your trigger to be as accurate as possible, I suggest you to use periodic trigger instead.


@ Hex.16: When unit dies it loses all it's buffs. Though this had nothing to do with your trigger at all, sorry.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top