• 🏆 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!

[Trigger] This skill is lagging the game

Status
Not open for further replies.

old

old

Level 6
Joined
May 8, 2016
Messages
112
  • Init Copy
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TempPoint = (Center of (Playable map area))
      • Unit - Create 1 Fade for Neutral Passive at TempPoint facing 0.00 degrees
      • Unit - Add Hidden to (Last created unit)
      • Unit - Add Fade to (Last created unit)
      • Unit - Explode (Last created unit)
      • Custom script: call RemoveLocation (udg_TempPoint)
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Player - Disable Hidden for (Player((Integer A)))
      • -------- First copy the dummy units then the buffs and abilities. After that copy the triggers and make sure it automatically generate new variables. --------
  • Fade Step
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Avoid
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • FSHas[FSLastRecycled] Equal to True
        • Then - Actions
          • Set FSMax = (FSMax + 1)
          • Set FSIndex = FSMax
        • Else - Actions
          • Set FSIndex = FSLastRecycled
          • Set FSLastRecycled = FSRecycledList[FSLastRecycled]
      • Set FSCaster[FSIndex] = (Triggering unit)
      • Set FSCasterPoint[FSIndex] = (Position of FSCaster[FSIndex])
      • Set FSDistance[FSIndex] = 0.00
      • Set FSMaxDistance[FSIndex] = 100.00
      • Custom script: set udg_FSDummyGroup[udg_FSIndex] = CreateGroup()
      • -------- --------------------- --------
      • -------- Time needed to travel this distance. --------
      • -------- --------------------- --------
      • -------- If you change this don't forget to change the ability's buff duration too. --------
      • -------- --------------------- --------
      • Set FSTime = 0.60
      • Set FSMove[FSIndex] = (FSMaxDistance[FSIndex] / (FSTime / 0.03))
      • Set FSFade[FSIndex] = (100.00 / (FSMaxDistance[FSIndex] / FSMove[FSIndex]))
      • Set FSFadeC[FSIndex] = (100.00 - FSFade[FSIndex])
      • Set FSFace[FSIndex] = (Facing of FSCaster[FSIndex])
      • Set FSHas[FSIndex] = True
      • Set FSCount = (FSCount + 1)
      • Unit - Add Hidden to FSCaster[FSIndex]
      • Set TempPoint = (Position of FSCaster[FSIndex])
      • Unit - Create 1 Fade for (Triggering player) at TempPoint facing FSFace[FSIndex] degrees
      • Unit - Add Fade Step DUMMY to (Last created unit)
      • Unit - Order (Last created unit) to Orc Troll Berserker - Berserk
      • Set FSDummy[FSIndex] = (Last created unit)
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Animation - Change FSCaster[FSIndex]'s vertex coloring to (100.00%, 100.00%, 100.00%) with FSFade[FSIndex]% transparency
      • Animation - Change FSDummy[FSIndex]'s vertex coloring to (100.00%, 100.00%, 100.00%) with FSFade[FSIndex]% transparency
      • Animation - Change FSDummy[FSIndex]'s animation speed to 150.00% of its original speed
      • Animation - Play FSDummy[FSIndex]'s spell animation
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Fade Step Loop <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Fade Step Loop <gen>
        • Else - Actions
  • Fade Step Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer FSInteger) from 0 to FSMax, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • FSHas[FSInteger] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • FSDistance[FSInteger] Less than FSMaxDistance[FSInteger]
                • Then - Actions
                  • Set TempPoint = (Position of FSCaster[FSInteger])
                  • Set FSDistance[FSInteger] = (FSDistance[FSInteger] + FSMove[FSInteger])
                  • Set TempPoint2 = (TempPoint offset by FSMove[FSInteger] towards (FSFace[FSInteger] + 180.00) degrees)
                  • Set FSFadeC[FSInteger] = (FSFadeC[FSInteger] - FSFade[FSInteger])
                  • Unit - Create 1 Fade for Neutral Passive at TempPoint facing FSFace[FSInteger] degrees
                  • Unit - Add Fade to (Last created unit)
                  • Unit - Order (Last created unit) to Orc Blademaster - Wind Walk
                  • Unit - Add a 0.60 second Generic expiration timer to (Last created unit)
                  • Animation - Change FSCaster[FSInteger]'s vertex coloring to (100.00%, 100.00%, 100.00%) with FSFadeC[FSInteger]% transparency
                  • Animation - Change FSDummy[FSInteger]'s vertex coloring to (100.00%, 100.00%, 100.00%) with FSFadeC[FSInteger]% transparency
                  • Set TempGroup = (Units within 125.00 of TempPoint2 matching ((((Matching unit) is A flying unit) Equal to False) and (((Matching unit) Not equal to FSCaster[FSInteger]) and (((Matching unit) is alive) Equal to True))))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (TempGroup is empty) Equal to True
                    • Then - Actions
                      • Unit - Move FSCaster[FSInteger] instantly to TempPoint2
                    • Else - Actions
                      • Unit - Turn collision for FSCaster[FSInteger] Off
                      • Unit - Move FSCaster[FSInteger] instantly to TempPoint2
                      • Unit - Turn collision for FSCaster[FSInteger] On
                  • Unit - Move FSDummy[FSInteger] instantly to TempPoint2
                  • Custom script: call DestroyGroup(udg_TempGroup)
                  • Custom script: call RemoveLocation (udg_TempPoint)
                  • Custom script: call RemoveLocation (udg_TempPoint2)
                • Else - Actions
                  • Unit - Remove Hidden from FSCaster[FSIndex]
                  • Unit Group - Pick every unit in FSDummyGroup[FSInteger] and do (Unit - Remove (Picked unit) from the game)
                  • Custom script: call DestroyGroup(udg_FSDummyGroup[udg_FSInteger])
                  • Unit - Remove FSDummy[FSInteger] from the game
                  • Custom script: call RemoveLocation (udg_FSCasterPoint[udg_FSInteger])
                  • Animation - Change FSCaster[FSInteger]'s animation speed to 100.00% of its original speed
                  • Animation - Change FSCaster[FSInteger]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
                  • Animation - Play FSCaster[FSInteger]'s stand animation
                  • Set FSHas[FSInteger] = False
                  • Set FSCount = (FSCount - 1)
                  • Set FSRecycledList[FSInteger] = FSLastRecycled
                  • Set FSLastRecycled = FSInteger
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • FSCount Equal to 0
                    • Then - Actions
                      • Set FSMax = 0
                      • Set FSLastRecycled = 0
                      • Set FSRecycledList[0] = 0
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
            • Else - Actions
WHERE DID I GO WRONG?
I LOST A FRIEND, SOMEWHEEEERE ALONG IN THE BITTERNESS END - The fray: How to save a life


ok joke apart, where did i go wrong importing this spell?
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
Well this spell doesn't "de-index" properly, I wouldn't think that on it's own would "lag the game" but correct it and lets see.

Set everything at the current index to itself at the max index, cut the current and max index by 1 after.
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
  • Siphon Life Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Siphon Life
    • Actions
      • Set SL_Index = SL_Index + 1
      • Set SL_Caster[SL_Index] = (Triggering unit)
      • Set SL_Target[SL_Index] = (Target unit of ability being cast)
      • Set SL_Counter[SL_Index] = 0
      • If (All Conditions are True) then do (Then Actions) else do (Else actions)
        • If - Conditions
          • SL_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on Siphon Life Loop <gen>
        • Else - Actions
  • Siphon Life Loop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • For each (SL_Loop_Integer) from 1 to SL_Index, do (Actions)
        • Loop - Actions
          • Unit - Cause SL_Caster[SL_Loop_Integer] to damage SL_Target[SL_Loop_Integer], dealing 2 damage of attack type Spells and damage type Normal
          • Unit - Set life of SL_Caster[SL_Loop_Integer] to ((Life of SL_Caster[SL_Loop_Integer]) + 2.00)
          • Set SL_Counter[SL_Loop_Integer] = (SL_Counter[SL_Loop_Integer] + 0.10)
          • If (All Conditions are True) then do (Then Actions) else do (Else actions)
            • If - Conditions
              • SL_Counter[SL_Loop_Integer] Greater than or equal to 3.00
            • Then - Actions
              • Set SL_Caster[SL_Loop_Integer] = SL_Caster[SL_Index] // Pay attention to these lines.
              • Set SL_Target[SL_Loop_Integer] = SL_Target[SL_Index] //
              • Set SL_Counter[SL_Loop_Integer] = SL_Counter[SL_Index] //
              • Set SL_Index = (SL_Index - 1) //
              • Set SL_Loop_Integer = (SL_Loop_Integer - 1) //
              • If (All Conditions are True) then do (Then Actions) else do (Else actions)
                • If - Conditions
                  • SL_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
Take a look at this trigger and see what it is doing as compared to yours
 
Status
Not open for further replies.
Top