Destroy lightning animation isn't working.

romanandre

New Member
Reaction score
2
I made a spell with a pentagon animation with chain lightning , everything works fine , but the pentagon animation lasts forever , what's wrong here?
Thanks for the help.

Trigger:
  • Actions
    • Set PentCast = (Triggering unit)
    • Set PentCirclePoint = (Target point of ability being cast)
    • Set PentPoint[1] = (PentCirclePoint offset by 480.00 towards 288.00 degrees)
    • Set PentPoint[2] = (PentCirclePoint offset by 480.00 towards 0.00 degrees)
    • Set PentPoint[3] = (PentCirclePoint offset by 480.00 towards 72.00 degrees)
    • Set PentPoint[4] = (PentCirclePoint offset by 480.00 towards 144.00 degrees)
    • Set PentPoint[5] = (PentCirclePoint offset by 480.00 towards 216.00 degrees)
    • For each (Integer A) from 1 to 5, do (Actions)
      • Loop - Actions
        • Unit - Create 1 Static Field Dummy for Player 1 (Red) at PentPoint[(Integer A)] facing Default building facing degrees
        • Set PentagonUnit[(Integer A)] = (Last created unit)
        • Lightning - Create a Forked Lightning lightning effect from source PentPoint[1] to target PentPoint[2]
        • Set LigPentEffect[1] = (Last created lightning effect)
        • Lightning - Create a Forked Lightning lightning effect from source PentPoint[2] to target PentPoint[3]
        • Set LigPentEffect[2] = (Last created lightning effect)
        • Lightning - Create a Forked Lightning lightning effect from source PentPoint[3] to target PentPoint[4]
        • Set LigPentEffect[3] = (Last created lightning effect)
        • Lightning - Create a Forked Lightning lightning effect from source PentPoint[4] to target PentPoint[5]
        • Set LigPentEffect[4] = (Last created lightning effect)
        • Lightning - Create a Forked Lightning lightning effect from source PentPoint[5] to target PentPoint[1]
        • Set LigPentEffect[5] = (Last created lightning effect)
    • Trigger - Turn on Static Field Damage <gen>
    • Wait 8.00 seconds
    • For each (Integer A) from 1 to 5, do (Actions)
      • Loop - Actions
        • Lightning - Destroy LigPentEffect[(Integer A)]
        • Custom script: call RemoveLocation (udg_PentPoint[1])
        • Custom script: call RemoveLocation (udg_PentPoint[2])
        • Custom script: call RemoveLocation (udg_PentPoint[3])
        • Custom script: call RemoveLocation (udg_PentPoint[4])
        • Custom script: call RemoveLocation (udg_PentPoint[5])
    • Trigger - Turn off Static Field Damage <gen>
 

Dirac

22710180
Reaction score
147
Well i don't know why. But i there's a problem in your triggering that's causing bugs:

You sound't remove the PentPoint locations inside the loop, you're removing each location 5 times, get them out of the loop and test it again
 

BloodySkullz

Active Member
Reaction score
10
+Did you see that the lightning is very thick?
I think your problem lies in your loop (the first one creating the lightnings).

Try getting out your "Create Lightning" action + "Set LigPentEffect()" action out of the loop.
 

Dirac

22710180
Reaction score
147
Oh i did't see that either lol, BloodlySkullz is right. REMEMBER that everytime you put something inside a loop it will repeat itself until finished.
In this case you create the same pentagon 5 times and at the end remove only 1, making 4 pentangons stay lol
 
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