Problem with special effect

Cres

New Member
Reaction score
25
When i cast this spell, a line of animate dead special effects fires in a line, like a shockwave but sometimes it does not fire the last animation and instead creates it in the middle... thats really annoying...

Thanks TH, but i think my trigger is really long and i cant copy it fully :(
 

The Helper

Necromancy Power over 9000
Staff member
Reaction score
1,699
They are
Code:
 tags or just use the # sign on the post window.
 

Cres

New Member
Reaction score
25
Ok, heres the trigger

Code:
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Arcane Missle 
Actions
Set Stunned1 = (Units in (Region centered at ((Position of (Triggering unit)) offset by 101.00 towards (Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) degrees) with size (100.00, 100.00)) matching (((Matching unit) belongs to an enemy of Owner of (triggering unit))) equal to true
Set Stunned2 = (Units in (Region centered at ((Position of (Triggering unit)) offset by 201.00 towards (Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) degrees) with size (100.00, 100.00)) matching (((Matching unit) belongs to an enemy of Owner of (triggering unit))) equal to true
Set Stunned3 = (Units in (Region centered at ((Position of (Triggering unit)) offset by 301.00 towards (Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) degrees) with size (100.00, 100.00)) matching (((Matching unit) belongs to an enemy of Owner of (triggering unit))) equal to true
Set Stunned4 = (Units in (Region centered at ((Position of (Triggering unit)) offset by 401.00 towards (Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) degrees) with size (100.00, 100.00)) matching (((Matching unit) belongs to an enemy of Owner of (triggering unit))) equal to true
Set Stunned5 = (Units in (Region centered at ((Position of (Triggering unit)) offset by 501.00 towards (Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) degrees) with size (100.00, 100.00)) matching (((Matching unit) belongs to an enemy of Owner of (triggering unit))) equal to true
Special Effect - Create a special effect at ((Position of (Triggering unit)) offset by 50.00 towards (Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) degrees) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
Wait 0.05 seconds
Special Effect - Create a special effect at ((Position of (Triggering unit)) offset by 100.00 towards (Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) degrees) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
Unit Group - Pick every unit in Stunned1 and do (Actions)
    Loop - Actions
        For each (Integer A) from 1 to (Number of units in Stunned1), do (Actions)
            Loop - Actions
                Unit - Pause (Picked unit)
Special Effect - Create a special effect at ((Position of (Triggering unit)) offset by 150.00 towards (Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) degrees) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
Wait 0.05 seconds
Special Effect - Create a special effect at ((Position of (Triggering unit)) offset by 200.00 towards (Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) degrees) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
Unit Group - Pick every unit in Stunned2 and do (Actions)
    Loop - Actions
        For each (Integer A) from 1 to (Number of units in Stunned2), do (Actions)
            Loop - Actions
                Unit - Pause (Picked unit)
Special Effect - Create a special effect at ((Position of (Triggering unit)) offset by 250.00 towards (Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) degrees) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
Wait 0.05 seconds
Special Effect - Create a special effect at ((Position of (Triggering unit)) offset by 300.00 towards (Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) degrees) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
Unit Group - Pick every unit in Stunned3 and do (Actions)
    Loop - Actions
        For each (Integer A) from 1 to (Number of units in Stunned3), do (Actions)
            Loop - Actions
                Unit - Pause (Picked unit)
Special Effect - Create a special effect at ((Position of (Triggering unit)) offset by 350.00 towards (Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) degrees) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
Wait 0.05 seconds
Special Effect - Create a special effect at ((Position of (Triggering unit)) offset by 400.00 towards (Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) degrees) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
Unit Group - Pick every unit in Stunned4 and do (Actions)
    Loop - Actions
        For each (Integer A) from 1 to (Number of units in Stunned4), do (Actions)
            Loop - Actions
                Unit - Pause (Picked unit)
Special Effect - Create a special effect at ((Position of (Triggering unit)) offset by 450.00 towards (Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) degrees) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
Wait 0.05 seconds
Special Effect - Create a special effect at ((Position of (Triggering unit)) offset by 500.00 towards (Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) degrees) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
Unit Group - Pick every unit in Stunned5 and do (Actions)
    Loop - Actions
        For each (Integer A) from 1 to (Number of units in Stunned5), do (Actions)
            Loop - Actions
                Unit - Pause (Picked unit)
Wait ((Real((Level of Arcane Missle  for (Triggering unit)))) x 1.00) seconds
Unit Group - Pick every unit in Stunned1 and do (Actions)
    Loop - Actions
        For each (Integer A) from 1 to (Number of units in Stunned1), do (Actions)
            Loop - Actions
                Unit - Unpause (Picked unit)
Unit Group - Pick every unit in Stunned2 and do (Actions)
    Loop - Actions
        For each (Integer A) from 1 to (Number of units in Stunned2), do (Actions)
            Loop - Actions
                Unit - Unpause (Picked unit)
Unit Group - Pick every unit in Stunned3 and do (Actions)
    Loop - Actions
        For each (Integer A) from 1 to (Number of units in Stunned3), do (Actions)
            Loop - Actions
                Unit - Unpause (Picked unit)
Unit Group - Pick every unit in Stunned4 and do (Actions)
    Loop - Actions
        For each (Integer A) from 1 to (Number of units in Stunned4), do (Actions)
            Loop - Actions
                Unit - Unpause (Picked unit)
Unit Group - Pick every unit in Stunned5 and do (Actions)
    Loop - Actions
        For each (Integer A) from 1 to (Number of units in Stunned5), do (Actions)
            Loop - Actions
                Unit - Unpause (Picked unit)

Ok... if theres a better way to do this, please tell me. Also, i know i didnt put the "stunned" symbol over the units because i cant remove it afterwards
 
L

Laika.

Guest
Ok, I could help you clean that up. I just need you to describe what you want it to do... as it isn't very clear from your code.
 
N

NRinpun

Guest
You know you can make Stunned an array, right? That way, you can have a large For loop that calls Stunned[Integer A] instead of Stunned1...Stunned5 without a for loop.
 

Cres

New Member
Reaction score
25
yes, i tried using array, but that screwed it over even more lol so i stuck to the slow boring way, but it would be great if you could show me how to really do it lol

The spell is a shock wave that stuns
 
D

dArKzEr0

Guest
I'll try remaking your trigger now.

dArKz

Edit//

Ok, I've remade your trigger and it's working fine. Here it is:
Code:
Arcane Missle
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Arcane Missle 
    Actions
        Set Casting_Hero = (Casting unit)
        Set Point_of_Start = (Position of Casting_Hero)
        Set Point_of_Cast = (Target point of ability being cast)
        Set Casting_Angle = (Angle from (Position of Casting_Hero) to Point_of_Cast)
        For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                Set Stunned_Units[(Integer A)] = (Units in (Rect centered at (Point_of_Start offset by (100.20 x (Real((Integer A)))) towards Casting_Angle degrees) with size (400.00, 400.00))(((Matching unit) belongs to an enemy of (Owner of Casting_Hero)) Equal to True))
        For each (Integer A) from 1 to 10, do (Actions)
            Loop - Actions
                Wait 0.05 seconds
                Special Effect - Create a special effect at (Point_of_Start offset by (50.00 x (Real((Integer A)))) towards Casting_Angle degrees) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Or - Any (Conditions) are true
                            Conditions
                                (Integer A) Equal to 2
                                (Integer A) Equal to 4
                                (Integer A) Equal to 6
                                (Integer A) Equal to 8
                                (Integer A) Equal to 10
                    Then - Actions
                        Unit Group - Pick every unit in Stunned_Units[((Integer A) / 2)] and do (Actions)
                            Loop - Actions
                                Unit - Pause (Picked unit)
                                Unit - Order Casting_Hero to damage (Picked unit) for (40.00 x (Real((Level of Arcane Missle  for Casting_Hero)))) using attack type Spells and damage type Normal.
                    Else - Actions
                        Do nothing
        Wait ((Real((Level of Arcane Missle  for Casting_Hero))) x 1.00) seconds
        For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                Unit Group - Pick every unit in Stunned_Units[(Integer A)] and do (Actions)
                    Loop - Actions
                        Unit - Unpause (Picked unit)

Variables:
Casting_Hero - Unit
Point_of_Start - Point
Point_of_Cast - Point
Casting_Angle - Real
Stunned_Units (Array) - Unit Group


I'll try working on getting you the stun effect now.

Edit II//
Oh, I added some damage to have a better visual as to whether it was working or not. You can remove it if you wish.
 

XXXconanXXX

Cocktails anyone?
Reaction score
284
Instead of using "Region centered at" use "Pick Every unit In 400.00(Whatever) Range of Unit"
 
D

dArKzEr0

Guest
Wouldn't doing that not get the "shockwave" type of spell he's going for? His spell attacks units in a line.

dArKz
 
D

dArKzEr0

Guest
I studied the trigger a bit more, and I still haven't found a way to give the units the stun effect, but I’m working on it. Anyway, I’ve found a couple of problems with the trigger. First off, if the size of the rect is 100,100, the units affected by the spell will be in a very narrow line. If you increase the size of the rect, to say 400,400, then you can’t use the damage line I added in there, because the rects will overlap and therefore damage some units more than others. Also, using wait in a loop causes a bit of a stall, so when you set your variable Stunned_Units, the unit may have moved before the animation/effects take place, thereby looking…well...ugly. To fix this, all you need to do is move the "Set stunned_units = ...." to the second loop, like this:

Code:
Arcane Missle
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Arcane Missle 
    Actions
        Set Casting_Hero = (Casting unit)
        Set Point_of_Start = (Position of Casting_Hero)
        Set Point_of_Cast = (Target point of ability being cast)
        Set Casting_Angle = (Angle from (Position of Casting_Hero) to Point_of_Cast)
        For each (Integer A) from 1 to 10, do (Actions)
            Loop - Actions
                Wait 0.01 seconds
                Special Effect - Create a special effect at (Point_of_Start offset by (50.00 x (Real((Integer A)))) towards Casting_Angle degrees) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Or - Any (Conditions) are true
                            Conditions
                                (Integer A) Equal to 2
                                (Integer A) Equal to 4
                                (Integer A) Equal to 6
                                (Integer A) Equal to 8
                                (Integer A) Equal to 10
                    Then - Actions
                        [B]Set Stunned_Units[((Integer A) / 2)] = (Units in (Rect centered at (Point_of_Start offset by (100.00 x ((Real((Integer A))) / 2.00)) towards Casting_Angle degrees) with size (200.00, 200.00))(((Matching unit) belongs to an enemy of (Owner of Casting_Hero)) Equal to True))[/B]
                        Unit Group - Pick every unit in Stunned_Units[((Integer A) / 2)] and do (Actions)
                            Loop - Actions
                                Unit - Pause (Picked unit)
                                Unit - Order Casting_Hero to damage (Picked unit) for (40.00 x (Real((Level of Arcane Missle  for Casting_Hero)))) using attack type Spells and damage type Normal.
                    Else - Actions
                        Do nothing
        Wait ((Real((Level of Arcane Missle  for Casting_Hero))) x 1.00) seconds
        For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                Unit Group - Pick every unit in Stunned_Units[(Integer A)] and do (Actions)
                    Loop - Actions
                        Unit - Unpause (Picked unit)

dArKz
 

xPheRe

New Member
Reaction score
43
Why not adding the damaged units to a uniqueunit-group, then check only for units that the spell hasn't damaged yet?
 
D

dArKzEr0

Guest
I'm not sure what you mean. What exactly are you suggesting we add to the trigger?

dArKz
 

Cres

New Member
Reaction score
25
Errr technically wouldnt the trigger only stun sometimes, because you didnt remove the picked unit from the unit group so isnt there a chance you will pick it again?
 
D

dArKzEr0

Guest
You may pick it again, but that won't matter if you don't deal damage. That only means that you'll pause the unit twice and unpause it twice. It has the same effect you were trying to get, except I made the size bigger. You can set it back to 100,100 if you wish...

dArKz
 

xPheRe

New Member
Reaction score
43
I was suggesting something like this
Code:
Arcane Missile
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Arcane Missle 
    Actions
        Clear group DamagedUnits
        Set Casting_Hero = (Casting unit)
        Set Point_of_Start = (Position of Casting_Hero)
        Set Point_of_Cast = (Target point of ability being cast)
        Set Casting_Angle = (Angle from (Position of Casting_Hero) to Point_of_Cast)
        For each (Integer A) from 1 to 10, do (Actions)
            Loop - Actions
                Wait 0.01 seconds
                Special Effect - Create a special effect at (Point_of_Start offset by (50.00 x (Real((Integer A)))) towards Casting_Angle degrees) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Or - Any (Conditions) are true
                            Conditions
                                (Integer A) Equal to 2
                                (Integer A) Equal to 4
                                (Integer A) Equal to 6
                                (Integer A) Equal to 8
                                (Integer A) Equal to 10
                    Then - Actions
[I]                        Set Stunned_Units[((Integer A) / 2)] = (Units in (Rect centered at (Point_of_Start offset by (100.00 x ((Real((Integer A))) / 2.00)) towards Casting_Angle degrees) with size (200.00, 200.00))(((Matching unit) belongs to an enemy of (Owner of Casting_Hero)) Equal to True) [B]And (((Matching unit) is in (DamagedUnits)) equal to False)[/B])
                        [B]Add Stunned_Units[((Integer A) / 2)] to DamagedUnits[/B][/I]
                        Unit Group - Pick every unit in Stunned_Units[((Integer A) / 2)] and do (Actions)
                            Loop - Actions
                                Unit - Pause (Picked unit)
                                Unit - Order Casting_Hero to damage (Picked unit) for (40.00 x (Real((Level of Arcane Missle  for Casting_Hero)))) using attack type Spells and damage type Normal.
                    Else - Actions
                        Do nothing
        Wait ((Real((Level of Arcane Missle  for Casting_Hero))) x 1.00) seconds
        For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                Unit Group - Pick every unit in Stunned_Units[(Integer A)] and do (Actions)
                    Loop - Actions
                        Unit - Unpause (Picked unit)

Set Stunned_Units[((Integer A) / 2)] = (Units in (Rect centered at (Point_of_Start offset by (100.00 x ((Real((Integer A))) / 2.00)) towards Casting_Angle degrees) with size (200.00, 200.00))(((Matching unit) belongs to an enemy of (Owner of Casting_Hero)) Equal to True) And (((Matching unit) is in (DamagedUnits)) equal to False))

[EDIT]This line it's soooooo long, I add a condition for checking the unit against a group of units that the spell has damaged yet. Then the next line add all units on previous group to the DamagedUnits[/EDIT]
 
D

dArKzEr0

Guest
Good idea xPheRe, that makes great sense. Also, using that variable I got the stun effect to work. Here's the trigger with xPheRe's variable idea and the stun effect as well:
Code:
Arcane Missle
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Arcane Missle 
    Actions
        Set Casting_Hero = (Casting unit)
        Set Point_of_Start = (Position of Casting_Hero)
        Set Point_of_Cast = (Target point of ability being cast)
        Set Casting_Angle = (Angle from (Position of Casting_Hero) to Point_of_Cast)
        Set Damaged_Units = (Create Unit Group)
        For each (Integer A) from 1 to 10, do (Actions)
            Loop - Actions
                Wait 0.01 seconds
                Special Effect - Create a special effect at (Point_of_Start offset by (50.00 x (Real((Integer A)))) towards Casting_Angle degrees) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Or - Any (Conditions) are true
                            Conditions
                                (Integer A) Equal to 2
                                (Integer A) Equal to 4
                                (Integer A) Equal to 6
                                (Integer A) Equal to 8
                                (Integer A) Equal to 10
                    Then - Actions
                        Set Stunned_Units[((Integer A) / 2)] = (Units in (Rect centered at (Point_of_Start offset by (100.00 x ((Real((Integer A))) / 2.00)) towards Casting_Angle degrees) with size (200.00, 200.00))((((Matching unit) belongs to an enemy of (Owner of Casting_Hero)) Equal to True) and (((Matching unit) is 
                        Unit Group - Add all units of Stunned_Units[((Integer A) / 2)] to Damaged_Units
                        Unit Group - Pick every unit in Stunned_Units[((Integer A) / 2)] and do (Actions)
                            Loop - Actions
                                Unit - Pause (Picked unit)
                                Unit - Order Casting_Hero to damage (Picked unit) for (40.00 x (Real((Level of Arcane Missle  for Casting_Hero)))) using attack type Spells and damage type Normal.
                    Else - Actions
                        Do nothing
        For each (Integer A) from 1 to (Number of units in Damaged_Units), do (Actions)
            Loop - Actions
                Special Effect - Create a special effect attached to the overhead of (First unit of group Damaged_Units) using Abilities\Spells\Human\Thunderclap\ThunderclapTarget.mdl
                Set Stun_Effect[(Integer A)] = (Last created special effect)
                Unit Group - Remove (First unit of group Damaged_Units) from Damaged_Units
        Wait ((Real((Level of Arcane Missle  for Casting_Hero))) x 1.00) seconds
        For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                Unit Group - Pick every unit in Stunned_Units[(Integer A)] and do (Actions)
                    Loop - Actions
                        Unit - Unpause (Picked unit)
        For each (Integer A) from 1 to 9999999, do (Actions)
            Loop - Actions
                Special Effect - Destroy Stun_Effect[(Integer A)]

Variables:
Casting_Hero - Unit
Point_of_Start - Point
Point_of_Cast - Point
Casting_Angle - Real
Stunned_Units (Array) - Unit Group
Damaged_Units - Unit Group
Stun_Effect (Array) - Special Effect

Post if you have any problems or are worried about some part of the trigger.

dArKz
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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