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

Triggers referring to a transforming unit?

Status
Not open for further replies.
Level 29
Joined
Apr 6, 2010
Messages
3,139
I'm using a spell based on Destroyer Form: the trigger runs all the actions correctly on the first unit (special effects, sounds etc.) but they only last for a second, at which the point the unit transforms, losing all the effects and preventing further actions from taking place.

How can I get the triggers to refer to the same unit before and after transformation?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
How can I get the triggers to refer to the same unit before and after transformation?
Use a thing that is called as "Variables".
Open your Trigger Editor and press CTRL + B, this will open up to your Variable window, create a new variable (name it whatever you want as long it suits your need), okay for example you name it "Caster" and the Variable Type is Unit.

  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Set Caster = (Triggering unit)
      • -------- BLA BLA BLA ACTION BEFORE TRANSFORMATION --------
      • Wait YourTransformationDuration seconds
      • -------- BLA BLA BLA ACTION AFTER TRANSFORMATION --------
YourTransformationDuration is the duration on how long you transform the unit before it turns back to original form, if let's say you transform it to 5 seconds, put there 5 seconds.

Use the Variable Caster to refer to your unit.
 
Status
Not open for further replies.
Top