• 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] Ability doesn't take effect

Status
Not open for further replies.
Level 18
Joined
Aug 23, 2008
Messages
2,319
I've made a pretty strange Dying/Resurrestion system which can be found here. As you can read there, a living unit looking like a dead unit stays. This unit becomes invulnerable, has 1 life and cannot act whatsoever (he can only be selected). This is the trigger used when a unit dies:
  • Then - Actions
    • Wait 2.30 seconds
    • Hero - Instantly revive (Triggering unit) at (Position of (Triggering unit)), Hide revival graphics
    • Animation - Change (Triggering unit)'s animation speed to 10000.00% of its original speed
    • Animation - Play (Triggering unit)'s death animation
    • Animation - Change (Triggering unit)'s animation speed to 0.00% of its original speed
    • Unit - Pause (Triggering unit)
    • Unit - Make (Triggering unit) Invulnerable
    • Unit - Set life of (Triggering unit) to 1.00
I've also made a ability that should allow resurrection of such a unit. This is the trigger for this ability:
  • Life
    • Events
      • Unit - A unit owned by Player 1 (Red) Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Life
    • Actions
      • Special Effect - Create a special effect at ((Position of (Targeted unit)) offset by 100.00 towards 235.00 degrees) using Abilities\Spells\Human\Resurrect\ResurrectCaster.mdl
      • Unit - Set life of (Targeted unit) to 5.00%
      • Unit - Make (Targeted unit) Vulnerable
      • Unit - Unpause (Targeted unit)
      • Animation - Change (Targeted unit)'s animation speed to (0.00 - 20.00)% of its original speed
      • Animation - Play (Targeted unit)'s death animation
      • Wait 1.00 seconds
      • Animation - Change (Targeted unit)'s animation speed to 100.00% of its original speed

The ability itself has been made, equipped to a unit for testing, and targets only the units it should target. The problem is: When I cast the ability, nothing happens. I use the ability on the "corpse", which he accepts, he casts the spell like he should, but nothing happens to the unit that should be resurrected. His invulnerability isn't gone, His life is still on 1, and the unit is not unpaused. How can this have happened?

Since Ability Settings (.w3a) are not supported as Attachment files, you can download the file here if you need it.
 
(Targeted Unit) should be used as a response to the event Unit - A unit acquires a target.

You should use (Target Unit Of Ability Being Cast) instead. Also, remember that all these Event Responses will have NO VALUE after a wait.

The workaround would be to use a variable like this:

  • Set tmpUnit = (Target Unit of Ability Being Cast)
  • Wait 1.00 seconds
  • Animation - Change tmpUnit's animation speed to 100.00% of its original speed
But that way, this trigger can't be run more than once per second (until it finishes), because it would cause errors. You will have to use more complex workarounds...
 
Status
Not open for further replies.
Top