• 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] Keeping track of the casting unit through a loop

Status
Not open for further replies.
Level 2
Joined
May 24, 2008
Messages
21
Greetings,

Most of my custom spells are simple and start/finish using a single trigger. I am trying to accomplish a looping spell using two triggers. The first trigger sets the target when the actual spell is cast, the second trigger applies custom damage and repeats itself if conditions are met.

Here is a stripped down version of the repeating trigger. It runs fine as long as nobody else casts anything. Any ideas on how to better accomplish this functionality?

  • Unit - Cause (Casting unit) to damage hero_spelltarget[(Player number of (Owner of (Casting unit)))], dealing hero_spelldamage[(Player number of (Owner of (Casting unit)))] damage of attack type Spells and damage type Unknown
  • Wait 0.10 seconds
  • Set hero_spelltarget[(Player number of (Owner of (Casting unit)))] = (Random unit from hero_spellunitgroup[(Player number of (Owner of (Casting unit)))])
  • Trigger - Run (This trigger) (ignoring conditions)
Many thanks for your time.
 
Level 2
Joined
May 24, 2008
Messages
21
Thank you for your reply. I will research local variables. While trying to find a solution earlier I remade the trigger earlier using a loop, and used a custom unit value to ID the player index for all the needed arrays (damage variables etc.). Right now the target is set and marked using a single global unit variable (instead of an array). This works, but anyone else casting the spell would ruin it. I think if I switch to local for that unit it will tidy up nicely.

Here is a video example of the current version.

YouTube - Warcraft Hell - Holy Fire Test 2
 
Status
Not open for further replies.
Top