• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[Trigger] Spell Lag

Status
Not open for further replies.
Level 9
Joined
Dec 26, 2010
Messages
475
hey guys, why my spell lags when i cast it on a group of units(5 or more units).

___________________________________________________________________


Triggers:

  • C3 Exploding Clay
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to |CFF20C000Kibaku Nendo • C3 - Exploding Clay • C3 (Deidara's Specialty #18 Jutsu)[T]|r
    • Actions
      • Set DeidaraC3Caster = (Triggering unit)
      • Set DeidaraC3Point[0] = (Target point of ability being cast)
      • Unit - Create 1 C3 for (Owner of DeidaraC3Caster) at DeidaraC3Point[0] facing Default building facing degrees
      • Set DeidaraC3Clay = (Last created unit)
      • Set DeidaraC3Point[1] = (Position of DeidaraC3Clay)
      • Set DeidaraC3Group = (Units within 600.00 of DeidaraC3Point[1] matching (((Matching unit) belongs to an enemy of (Owner of DeidaraC3Caster)) Equal to True))
      • Animation - Change DeidaraC3Clay flying height to 0.00 at 300.00
      • Wait 1.50 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of |CFF20C000Kibaku Nendo • C3 - Exploding Clay • C3 (Deidara's Specialty #18 Jutsu)[T]|r for DeidaraC3Caster) Equal to 1
        • Then - Actions
          • Unit Group - Pick every unit in DeidaraC3Group and do (Actions)
            • Loop - Actions
              • Unit - Cause DeidaraC3Caster to damage (Picked unit), dealing 500.00 damage of attack type Chaos and damage type Universal
              • Special Effect - Create a special effect at DeidaraC3Point[1] using war3mapImported\NuclearExplosion.mdx
              • Special Effect - Destroy (Last created special effect)
              • Unit - Create 1 DeidaraExplosionDummy for (Owner of DeidaraC3Caster) at (Position of DeidaraC3Clay) facing Default building facing degrees
              • Set DeidaraC3UnitEffect = (Last created unit)
              • Unit - Explode DeidaraC3Clay
              • Wait 2.00 seconds
              • Unit - Remove DeidaraC3UnitEffect from the game
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of |CFF20C000Kibaku Nendo • C3 - Exploding Clay • C3 (Deidara's Specialty #18 Jutsu)[T]|r for DeidaraC3Caster) Equal to 2
            • Then - Actions
              • Unit Group - Pick every unit in DeidaraC3Group and do (Actions)
                • Loop - Actions
                  • Unit - Cause DeidaraC3Caster to damage (Picked unit), dealing 1000.00 damage of attack type Chaos and damage type Universal
                  • Special Effect - Create a special effect at DeidaraC3Point[1] using war3mapImported\NuclearExplosion.mdx
                  • Special Effect - Destroy (Last created special effect)
                  • Unit - Create 1 DeidaraExplosionDummy for (Owner of DeidaraC3Caster) at (Position of DeidaraC3Clay) facing Default building facing degrees
                  • Set DeidaraC3UnitEffect = (Last created unit)
                  • Unit - Explode DeidaraC3Clay
                  • Wait 2.00 seconds
                  • Unit - Remove DeidaraC3UnitEffect from the game
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of |CFF20C000Kibaku Nendo • C3 - Exploding Clay • C3 (Deidara's Specialty #18 Jutsu)[T]|r for DeidaraC3Caster) Equal to 3
                • Then - Actions
                  • Unit Group - Pick every unit in DeidaraC3Group and do (Actions)
                    • Loop - Actions
                      • Unit - Cause DeidaraC3Caster to damage (Picked unit), dealing 1500.00 damage of attack type Chaos and damage type Universal
                      • Special Effect - Create a special effect at DeidaraC3Point[1] using war3mapImported\NuclearExplosion.mdx
                      • Special Effect - Destroy (Last created special effect)
                      • Unit - Create 1 DeidaraExplosionDummy for (Owner of DeidaraC3Caster) at (Position of DeidaraC3Clay) facing Default building facing degrees
                      • Set DeidaraC3UnitEffect = (Last created unit)
                      • Unit - Explode DeidaraC3Clay
                      • Wait 2.00 seconds
                      • Unit - Remove DeidaraC3UnitEffect from the game
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of |CFF20C000Kibaku Nendo • C3 - Exploding Clay • C3 (Deidara's Specialty #18 Jutsu)[T]|r for DeidaraC3Caster) Equal to 4
                    • Then - Actions
                      • Unit Group - Pick every unit in DeidaraC3Group and do (Actions)
                        • Loop - Actions
                          • Unit - Cause DeidaraC3Caster to damage (Picked unit), dealing 2000.00 damage of attack type Chaos and damage type Universal
                          • Special Effect - Create a special effect at DeidaraC3Point[1] using war3mapImported\NuclearExplosion.mdx
                          • Special Effect - Destroy (Last created special effect)
                          • Unit - Create 1 DeidaraExplosionDummy for (Owner of DeidaraC3Caster) at (Position of DeidaraC3Clay) facing Default building facing degrees
                          • Set DeidaraC3UnitEffect = (Last created unit)
                          • Unit - Explode DeidaraC3Clay
                          • Wait 2.00 seconds
                          • Unit - Remove DeidaraC3UnitEffect from the game
                    • Else - Actions
      • Custom script: call RemoveLocation(udg_DeidaraC3Point[0])
      • Custom script: call RemoveLocation(udg_DeidaraC3Point[1]
+Rep
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

Specially I can't say, what force the lag but I can say this:

1) Don't use wait times!
2) Unit Groups leaks. Destroy it after the actions
3) You don't need any if then else for this spell. Just do damage like this: ( 0 + (500 * Level of Ability)) and create other actions under it.
4) "...at (Position of DeidaraC3Clay)" <- Leak. Create a temppoint at the position of the caster and create the unit on this point + point destroy
5) Else in the last custom script you missed at the end a )
6) Your Unit group needs more filter: Is the matching unit is alive or magic immune.

7) I don't know the effect. maybe the effect makes a lag, if it's created on to much targets

===
After fixing those things and when the lags remain, you can ask again. Btw you spell isn't MPI nor MUI at all

Greetings and Peace
Dr. Boom
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,233
You can not use TriggerSleepAction in side group enums, it kills the thread and thus all actions after the wait are not executed. This means you are leaking many units (even though remove unit also leaks).

Firstly, use a formula for multi level support, case statement structures are much slower and HORRIABLE for maintence.
Secondly, for your dummy units, make them exlode on death and then give them timed life rather than removing them. Removing units has been reported to leak.
Thirdly, remove the TriggerSleepActions (GUI Wait) from the enums (for group do loop in GUI) for the reason stated at the start.

Also make sure it is not an inherant fault of some dummy ability. Moves like shadow strike with 0 casting delay put extreem strain on the processor due to the number of damage opperations performed per second (like thousands).
 
Status
Not open for further replies.
Top