Mass Special effect go away?

tmow

New Member
Reaction score
7
Ok I just made up a cool spell which i intend to post....Similar to the drunken haze to breath of fire on the panda. When the unit is under the effect of cold water (drunken haze) and it has FreezeOver (breath of frost) casted on it...the units freeze! its cool but the only problem is the special effects on the units wont disappear...help please =D

Trigger:
  • Attempt
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to FreeZeHellOver
    • Actions
      • Set caster = (Casting unit)
      • Set Targets = (Units in (Entire map) matching ((((Matching unit) belongs to an enemy of (Owner of caster)) Equal to True) and (((Matching unit) has buff Ice ) Equal to True)))
      • Set PointofCast = (Target point of ability being cast)
      • Unit Group - Pick every unit in Targets and do (Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Undead\FreezingBreath\FreezingBreathTargetArt.mdl)
      • Set specialeffect = (Last created special effect)
      • Unit Group - Pick every unit in Targets and do (Unit - Pause (Picked unit))
      • Unit Group - Pick every unit in Targets and do (Animation - Play (Picked unit)'s pause animation)
      • Wait 5.00 seconds
      • Unit Group - Pick every unit in Targets and do (Unit - Unpause (Picked unit))
      • Special Effect - Destroy specialeffect



if u need details p.m me...
 

MateoSoetsu

New Member
Reaction score
9
You are only destroying the last special effect, not all of the special effects created by your trigger.

Something I would do in a situation like this is to create an integer variable and set it to +1 per unit targeted and set the units custom value to the value of the variable and then create 1 special effect per target and save the special effect in a variable array and then delete all of the special effects in the array of the (custom value of picked unit).

I don't know if that made sense to you but I could make a trigger and post it if you need, and you can see if it works.
 

l1lshadow

New Member
Reaction score
4
Using last created effect only picks the last one, for an example if you pick 10 units and add effects to all you add 10 effects so your picking the 10th effect.

Edit: Oh noes u beat meh =o.
 

tmow

New Member
Reaction score
7
how could i do it tho...im telling it to add a special effect to the picked unit and its not a loop?
 

Slapshot136

Divide et impera
Reaction score
471
how could i do it tho...im telling it to add a special effect to the picked unit and its not a loop?



use an array and an integer to keep track of it, in this case i used X, and give special effect an array

Trigger:
  • Attempt
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to FreeZeHellOver
    • Actions
      • Set caster = (Casting unit)
      • Set Targets = (Units in (Entire map) matching ((((Matching unit) belongs to an enemy of (Owner of caster)) Equal to True) and (((Matching unit) has buff Ice ) Equal to True)))
      • Set PointofCast = (Target point of ability being cast)
      • Unit Group - Pick every unit in Targets and do (Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Undead\FreezingBreath\FreezingBreathTargetArt.mdl)
      • Set X = (X + 1)
      • Set specialeffect(X) = (Last created special effect)
      • Unit Group - Pick every unit in Targets and do (Unit - Pause (Picked unit))
      • Unit Group - Pick every unit in Targets and do (Animation - Play (Picked unit)'s pause animation)
      • Wait 5.00 seconds
      • Unit Group - Pick every unit in Targets and do (Unit - Unpause (Picked unit))
      • Loop - for each integer A from 1 to X do actions
        • Special Effect - Destroy specialeffect(Integer A)


and do units have a pause animation? i was thinking you would set their animation speed to 0% and then return it to 100%
 

tmow

New Member
Reaction score
7
first off thank u very much for doing that repp defff given

second...is X an integer variable or a special effect variable with an array?
 

LordXavier

TH.net Regular
Reaction score
16
X is an integer variable
also, at the beginning of the trigger you could always set X to 0, that way it doesn't have to get super huge if the ability is cast a lot
 

tmow

New Member
Reaction score
7
hmm..i know this might be getting really agrivating for yall lol sorry...but...don't i need sometype of special effect array? like how does just an integer variable link it up
 

Rainther

I guess I should write something of value here...
Reaction score
61
The integer is array. Like SpecialEffect[0]

The green is the actual variable, the Special Effect variable, and it contains more variables because it's an array, each accessed through the value where the color blue it placed.
 

tmow

New Member
Reaction score
7
Trigger:
  • FrEeZe Em
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to FrosTbITe
    • Actions
      • Set FrostBiteCaster = (Casting unit)
      • Set PointOfFrostBite = (Target point of ability being cast)
      • Set UnitsEffectedByfrost = (Units in (Region centered at PointOfFrostBite with size (300.00, 800.00)) matching ((((Matching unit) has buff ICeColdWater ) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of FrostBiteCaster)) Equal to True)))
      • Unit Group - Pick every unit in UnitsEffectedByfrost and do (Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Undead\FreezingBreath\FreezingBreathTargetArt.mdl)
      • Set x = (x + 1)
      • Set specialeffectarray[x] = (Last created special effect)
      • Unit Group - Pick every unit in UnitsEffectedByfrost and do (Unit - Pause (Picked unit))
      • Unit Group - Pick every unit in UnitsEffectedByfrost and do (Animation - Change (Picked unit)'s animation speed to 0.00% of its original speed)
      • Wait 5.00 seconds
      • Unit Group - Pick every unit in UnitsEffectedByfrost and do (Animation - Change (Picked unit)'s animation speed to 100.00% of its original speed)
      • Unit Group - Pick every unit in UnitsEffectedByfrost and do (Unit - Unpause (Picked unit))
      • For each (Integer A) from 1 to x, do (Actions)
        • Loop - Actions
          • Special Effect - Destroy specialeffectarray[x]



not working?

seeing as this problem is difficult...if you want the map i have no problem sending it...its just a few custom spells i made and intend to post up once i fix the bugs and leaks
 

Slapshot136

Divide et impera
Reaction score
471
use
Unit Group - do multiple actions
instead of single action

and make it look like this

Trigger:
  • Other stuff
    • Set x = 0
    • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
      • Loop - Actions
        • Set x = (x + 1)
        • Set specialeffect[x] = (Last created special effect)
    • For each (Integer A) from 1 to x, do (Actions)
      • Loop - Actions
        • Special Effect - Destroy specialeffect[(Integer A)]


X is an integer variable
also, at the beginning of the trigger you could always set X to 0, that way it doesn't have to get super huge if the ability is cast a lot

ty, your right, added it in
 

tmow

New Member
Reaction score
7
Trigger:
  • FrEeZe Em
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to FrosTbITe
    • Actions
      • Set FrostBiteCaster = (Casting unit)
      • Set PointOfFrostBite = (Target point of ability being cast)
      • Set UnitsEffectedByfrost = (Units in (Region centered at PointOfFrostBite with size (300.00, 800.00)) matching ((((Matching unit) has buff ICeColdWater ) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of FrostBiteCaster)) Equal to True)))
      • Set x = 0
      • Unit Group - Pick every unit in UnitsEffectedByfrost and do (Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Undead\FreezingBreath\FreezingBreathTargetArt.mdl)
      • Unit Group - Pick every unit in UnitsEffectedByfrost and do (Actions)
        • Loop - Actions
          • Set specialeffectarray[x] = (Last created special effect)
          • Set x = (x + 1)
      • Unit Group - Pick every unit in UnitsEffectedByfrost and do (Unit - Pause (Picked unit))
      • Unit Group - Pick every unit in UnitsEffectedByfrost and do (Animation - Change (Picked unit)'s animation speed to 0.00% of its original speed)
      • Wait 5.00 seconds
      • Unit Group - Pick every unit in UnitsEffectedByfrost and do (Animation - Change (Picked unit)'s animation speed to 100.00% of its original speed)
      • Unit Group - Pick every unit in UnitsEffectedByfrost and do (Unit - Unpause (Picked unit))
      • For each (Integer A) from 1 to x, do (Actions)
        • Loop - Actions
          • Special Effect - Destroy specialeffectarray[x]


this the final edit so far of what peeps telling me lol....anyone willing to do it if i send the map?
 

Slapshot136

Divide et impera
Reaction score
471
you need to create the special effect in the same loop you reference it

you need to set x=x+1 b4 u set specialeffectarray(x)=last created special effect

Trigger:
  • Unit Group - Pick every unit in UnitsEffectedByfrost and do (Actions)
    • Loop -
      • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Undead\FreezingBreath\FreezingBreathTargetArt.mdl
      • Set specialeffectarray[x] = (Last created special effect)
      • Set x = (x + 1)


you need to destroy special effect (integer a) not x

Trigger:
  • For each (Integer A) from 1 to x, do (Actions)
    • Loop - Actions
      • Special Effect - Destroy specialeffectarray[Integer A]


if it still does not work, then post the map and i will do it for you
 

tmow

New Member
Reaction score
7
LMAO SLAPSHOT THANK U GOD DAMM THAT WAS SO ANNOYING!@@! FINAL WORKING TRIGGER =

Trigger:
  • FrEeZe Em
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to FrosTbITe
    • Actions
      • Set FrostBiteCaster = (Casting unit)
      • Set PointOfFrostBite = (Target point of ability being cast)
      • Set UnitsEffectedByfrost = (Units in (Region centered at PointOfFrostBite with size (300.00, 800.00)) matching ((((Matching unit) has buff ICeColdWater ) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of FrostBiteCaster)) Equal to True)))
      • Set x = 0
      • Unit Group - Pick every unit in UnitsEffectedByfrost and do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Undead\FreezingBreath\FreezingBreathTargetArt.mdl
          • Set x = (x + 1)
          • Set specialeffectarray[x] = (Last created special effect)
      • Unit Group - Pick every unit in UnitsEffectedByfrost and do (Unit - Pause (Picked unit))
      • Unit Group - Pick every unit in UnitsEffectedByfrost and do (Animation - Change (Picked unit)'s animation speed to 0.00% of its original speed)
      • Wait 5.00 seconds
      • Unit Group - Pick every unit in UnitsEffectedByfrost and do (Animation - Change (Picked unit)'s animation speed to 100.00% of its original speed)
      • Unit Group - Pick every unit in UnitsEffectedByfrost and do (Unit - Unpause (Picked unit))
      • For each (Integer A) from 1 to x, do (Actions)
        • Loop - Actions
          • Special Effect - Destroy specialeffectarray[(Integer A)]
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top