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

Special effect on groups

Status
Not open for further replies.
Level 2
Joined
Nov 19, 2014
Messages
10
Hello guys,

I am having a problem in removing special effect from group, i'll post my trigger.
I know my trigger might be bad but i am just having fun creating spells my way :p
If you feel like pointing out other things than my main question feel free to help me out in improving my work. Thanks

The main problem is that the frost nova special effect is still on units. it never goes out and not even from a single one unit.

BTW,,, i used the normal special effcet variable too and it doesnt work. it works for me if i attach special effect on one unit only. but not when i attach to groups. so i tried the array with size one but not sure how to use it lol...

  • Death Copy
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Unit-type of (Dying unit)) Equal to Water Elemental (Level 1)) or (((Unit-type of (Dying unit)) Equal to Water Elemental (Level 2)) or (((Unit-type of (Dying unit)) Equal to Water Elemental (Level 3)) or (((Unit-type of (Dying unit)) Equal to Water Elemental (Level 4)) or ((Unit-type of (Dying unit)) Equal to Water Elementa
    • Actions
      • Set WE_DyingUnit = (Dying unit)
      • Unit Group - Pick every unit in (Units within 800.00 of (Position of WE_DyingUnit) matching (((Matching unit) belongs to an enemy of (Owner of WE_DyingUnit)) Equal to True)) and do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl
          • Set WE_SE[100] = (Last created special effect)
      • Unit - Create 1 Dummy Stable for (Owner of WE_DyingUnit) at (Position of WE_DyingUnit) facing Default building facing degrees
      • Set WE_DeathStun = (Last created unit)
      • Unit - Add WaterElemental Death 1 to WE_DeathStun
      • Unit - Order WE_DeathStun to Orc Tauren Chieftain - War Stomp
      • Unit - Create 1 Dummy Attacking Stable for (Owner of WE_DyingUnit) at (Position of WE_DyingUnit) facing Default building facing degrees
      • Set WE_DeathAttack = (Last created unit)
      • Unit - Add Barrage WE death to WE_DeathAttack
      • Unit - Order WE_DeathAttack to Attack (Random unit from (Units within 800.00 of (Position of WE_DeathAttack)))
      • Wait 3.00 seconds
      • Special Effect - Destroy WE_SE[100]
      • Unit - Remove WE_DeathAttack from the game
      • Unit - Remove WE_DeathStun from the game
 
This should be in Triggers & Scripts :p

To get on topic, you're storing all of the (Last created special effects) into WE_SE[100]. That means after the loop is done, WE_SE will only store the most recent special effect since the effects will keep overwriting each other. What you can do is use a Unit Indexer so that you can store the effect into WE_SE[Custom value of (Picked unit)] and add the affected units into a temporary group. After the effect is done, you can pick all the units into that temporary group, and then use "Special Effect - Destroy WE_SE[Custom value of (Picked unit)]. Another alternative is to learn how to use any of the buff systems in the Spell section :3 I've personally never used one before, but I'm sure they have a feature you're looking for (temporarily attaching special effects onto multiple and then later destroying it).

Some other stuff you should work on:
  • You leak 2 unit groups and 4 locations. You should take a look at this Memory Leaks tutorial. Alternatively, you could also check out Things That Leak. I recommend reading the former.
  • I reeally hate it when people use (Matching unit) to filter out unit groups ;_; they are inefficient, hard to read, and extremely tedious if you wanted to add and or remove filters
  • Avoid using War Stomp as a base spell for anything. They have terrain deformations which are known to cause desyncs and map crashes if they are used too much (the same goes for Shockwave).
 
Level 2
Joined
Nov 19, 2014
Messages
10
Thank you a lot.

What i do usualy to get over the overwriting stuff is that i make the spell usable only after the trigger is done. that mean the trigger cant be activated again before its done.

The problem here is not overwriting. its not taking of the special effect even the first time i use it.

also i am not sure how to do the stuff u just explained xD
can you write a fast example of that indexer thing. just show me how to add special effect on group of units and how to take it off.
 
The problem here is not overwriting. its not taking of the special effect even the first time i use it.
The issue is because it is being overwritten. You said that it only works on one unit. It only works on one unit because nothing is overwriting the special effect. If you are referring to the frost nova effect still lingering on one unit, I am aware that Frost Nova has an odd death timer. It doesn't go away instantly.
 
Status
Not open for further replies.
Top