• 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] Need help -"Shield" type spell's animation not disappear and sound does not play

Status
Not open for further replies.
Level 6
Joined
Jun 14, 2008
Messages
176
Need help - Making sound appear when unit gets hit with a spell active

Edit: Ok, I figured out the animation, just doesn't disappear right away(anyone know how to make it disappear instantly?) All I need help with is the sound now

First, I am editing someone else's map/spell it's from EotA: Exodus, unprotected map.

It has a spell that creates a shield(with health) around a unit. For example, at level 1, it gives a 200 HP shield that lets the unit take 200 damage without taking actual damage, after 200 HP is dealt, the shield expires.

There is a problem with the spell, the special effect doesn't function correctly(it doesn't disappear), and I also want to make it play sound when a unit gets attacked.

So:
1. When the spell takes effect, it creates a manashield "special effect" attachment onto the unit. It's supposed to disappear once the spell wears off, but it doesn't.
2. I also want to make it play a sound when the unit(with the shield on) gets attacked.

Here's most of the spell(this is the map creator's triggers btw) (Also, I edited out repeating stuff, like for the levels, to make it shorter)

  • Watery Shell Stats
    • Events
      • Time - Elapsed game time is 10.00 seconds
    • Conditions
    • Actions
      • Custom script: call DestroyTrigger(GetTriggeringTrigger())
      • Set WateryShellHealth[1] = 200.00
      • Set WateryShellKeep[1] = 0.75
  • Watery Shell Cast
    • Events
      • Unit - Naga Sorceress 0079 <gen> Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Watery Shell
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WateryShellInstHealth[(Player number of (Owner of (Target unit of ability being cast)))] Greater than 0.00
        • Then - Actions
          • Special Effect - Destroy WateryShellInstEffect[(Player number of (Owner of (Target unit of ability being cast)))]
        • Else - Actions
      • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\Human\ManaShield\ManaShieldCaster.mdl
      • Set WateryShellInstEffect[(Player number of (Owner of (Target unit of ability being cast)))] = (Last created special effect)
      • Set WateryShellInstHealth[(Player number of (Owner of (Target unit of ability being cast)))] = (WateryShellHealth[(Level of (Ability being cast) for (Triggering unit))] + (WateryShellKeep[(Level of (Ability being cast) for (Triggering unit))] x WateryShellInstHealth[(Player number of (Owner of (Target unit of ability being cast)))]))
      • Trigger - Turn on Watery Shell Effect <gen>
Here's the trigger with the trigger that's suppose to destroy the special effect:
  • Watery Shell Effect
    • Events
      • Unit - Naga Sorceress 0079 <gen> Takes damage
    • Conditions
      • WateryShellInstHealth[(Player number of (Owner of (Triggering unit)))] Greater than 0.00
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WateryShellInstHealth[(Player number of (Owner of (Triggering unit)))] Greater than (Damage taken)
        • Then - Actions
          • Set WateryShellInstHealth[(Player number of (Owner of (Triggering unit)))] = (WateryShellInstHealth[(Player number of (Owner of (Triggering unit)))] - (Damage taken))
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))
        • Else - Actions
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + WateryShellInstHealth[(Player number of (Owner of (Triggering unit)))])
          • Set WateryShellInstHealth[(Player number of (Owner of (Triggering unit)))] = 0.00
          • Special Effect - Destroy WateryShellInstEffect[(Player number of (Owner of (Triggering unit)))]
The special effect doesn't disappear when the ability wears off, anyone know why?

Also, here's my trigger of trying to add a sound effect to heroes(with the ability) that gets attacked.
  • Watery Shell Cast Sound Effect
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • WateryShellInstHealth[(Player number of (Owner of (Attacked unit)))] Greater than 0.00
    • Actions
      • Sound - Play SpellShieldImpact1 <gen> at 100.00% volume, attached to (Triggering unit)
      • Sound - Destroy (Last played sound)
The sound plays once(when hit), then it never appears again. I am trying to add a trigger so that a sound plays everytime an enemy attacks the person with the shield on, can anyone tell me how to do it?
 
Last edited:
Level 2
Joined
Aug 8, 2008
Messages
17
I'm not sure, but I can't see where it says the shield only has 200 hp... cause you have multiplying and stuff but no base value... or is that in a spell?
and maybe set everything thats 0.00 to 0.01?
 
Last edited:
Level 6
Joined
Jun 14, 2008
Messages
176
Nevermind, it seems the animation does disappear but it takes a couple of seconds for it to disappear after the actual spell wore off. Does anyone know a way to make the animation disappear the instant the actual spell wears off?

One more problem though, I still don't know how to make the sound play everytime a unit attacks the person with the spell active, can anyone help me with this?
 
Level 14
Joined
Dec 9, 2006
Messages
1,091
How about somthing simple like

Event
Unit- A unit is Attacked
Condition
((Triggering unit) has buff Shield buff) Equal to True

Action
Sound-Play Shield Sound
or I believe if you want it at the area where the shield user is.
Sound - Play Shield Sound at 100.00% volume, attached to (Shield Unit)

Shield Buff- Buff the unit gets when they activate the shield
Shield sound- the sound you want to play
Shield Unit- The unit who has the shield on them

Hope this helps ^_^

~Asomath
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
  • Play shielding sound
    • Events
      • Unit - <YOUR UNIT>'s life becomes Less than (Life of <YOUR UNIT>)
    • Conditions
      • ((Triggering unit) has buff <YOUR BUFF>) Equal to True
    • Actions
      • Sound - Play <YOUR SOUND> at 100.00% volume, attached to <YOUR UNIT>
This trigger should cause the sound to play whenever the unit takes damage. You previous trigger caused the sound to play whenever a unit started attacking your unit.

Good luck.
 
Status
Not open for further replies.
Top