• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Special Effects and a certain leak

Status
Not open for further replies.
Level 28
Joined
Mar 25, 2008
Messages
2,955
Okay, here's the thing.

  • Unit Group - Pick every unit in (Units owned by Player 12 (Brown) of type Doom) and do (Actions)
    • Loop - Actions
      • Unit - Set (Picked unit) acquisition range to 0.00
      • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Other\Doom\DoomDeath.mdl
      • Set tempeff = (Last created special effect)
      • Custom script: call DestroyEffect(udg_tempeff)
      • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Other\BreathOfFire\BreathOfFireDamage.mdl
      • Special Effect - Create a special effect attached to the head of (Picked unit) using Abilities\Spells\Other\BreathOfFire\BreathOfFireDamage.mdl
      • Special Effect - Create a special effect attached to the foot,left of (Picked unit) using Abilities\Spells\Other\BreathOfFire\BreathOfFireDamage.mdl
      • Special Effect - Create a special effect attached to the foot,right of (Picked unit) using Abilities\Spells\Other\BreathOfFire\BreathOfFireDamage.mdl
Is what I'm using to add special effects to a certain unit when spawning.
Now I know it leaks when the unit dies and so I have to index them and remove upon death, obviously.
Now do I have to add the special effects one by one to the unit and set the variables accordingly, or is there some nifty workaround?
Be it solely for a shorter trigger...
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
List them up and assign them to the unit using a hashtable for example.

Save effect under handle id of unit and effectCounter, increment effectCounter.

Of course, this should be done within a function to actually shorten your triggers and avoid errors, which leads us to jass.
 
Status
Not open for further replies.
Top