Whats wrong with my Lightning Trigger?

redhybrid

New Member
Reaction score
1
Trigger:
  • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
    • (Ability being cast) Equal to Lockdown
    • Actions
    • Set LockdownTarget = (Target unit of ability being cast)
    • Set x = 0
    • Unit Group - Add LockdownTarget to LockdownTargets
    • Unit Group - Pick every unit in LockdownTargets and do (Actions)
      • Loop - Actions
    • Unit Group - Pick every unit in LockdownTargets and do (Actions)
      • Loop - Actions
    • Lightning - Create a Chain Lightning - Primary lightning effect from source ((Position of (Target unit of ability being cast)) offset by (-100.00, 100.00)) to target ((Position of (Target unit of ability being cast)) offset by (100.00, 100.00))
    • Set x = (x + 1)
    • Lightning - Create a Chain Lightning - Primary lightning effect from source ((Position of (Target unit of ability being cast)) offset by (100.00, 100.00)) to target ((Target point of ability being cast) offset by (0.00, -100.00))
    • Set x = (Lightning - Create a Chain Lightning - Primary lightning effect from source ((Target point of ability being cast) offset by (0.00, -100.00)) to target ((Position of (Target unit of ability being cast)) offset by (-100.00, 100.00))
    • x + 1)
    • Set x = (x + 1)
    • Set LightningEffectsArray[x] = (Last created lightning effect)
    • If ((Level of Lockdown for (Triggering unit)) Equal to 1) then do (Wait 8.00 seconds) else do (If ((Level of Lockdown for (Triggering unit)) Equal to 2) then do (Wait 16.00 seconds) else do (If ((Level of Lockdown for (Triggering unit)) Equal to 3) then do (Wait 24.00 seconds) else do (If ((Level of (Triggering unit)) Equal to 4) then do (Wait 32.00 seconds) else (Do Nothing)
    • For each (Integer A) from 1 to x, do (Lightning - Destroy LightningEffectsArray[(Integer A)])


Hi everyone, I'm trying to add lightning effects to the Lockdown ability for my Ghost Hero, (i.e electricity disruption effect around the lockdown affected unit). The lightning effects are composed of multiple (3 separate) lightning effects that form a singular triangular 'cage' surrounding the locked down unit.

However, after the elapsed time, only the one of the lightning effects (the last created one) is destroyed while the other 2 stay on the map permanently...

I studied this thread for 30 mins:
http://www.thehelper.net/forums/showthread.php?t=133180

And tried to copy the usage of Integer Variables and Arrays, but still get the same result.. Can anyone what am i doing wrong??

Much appreciated
 

Tyrulan

Ultra Cool Member
Reaction score
37
You have created several Special Effects and this is the only time you are adding the effect into your array

Trigger:
  • Set LightningEffectsArray[x] = (Last created lightning effect)


You have to the effect into the array each time you create it. (I suggest a loop, if you can)
 

NetherHawk

New Member
Reaction score
26
You are not registering your lightning variables correctly.

# Set x = 1
# Lightning - Create a Chain Lightning - Primary lightning effect from source ((Position of (Target unit of ability being cast)) offset by (-100.00, 100.00)) to target ((Position of (Target unit of ability being cast)) offset by (100.00, 100.00))
# Set LightningEffectsArray[x] = (Last created lightning effect)
# Set x = (x + 1)
# Lightning - Create a Chain Lightning - Primary lightning effect from source ((Position of (Target unit of ability being cast)) offset by (100.00, 100.00)) to target ((Target point of ability being cast) offset by (0.00, -100.00))
# Set LightningEffectsArray[x] = (Last created lightning effect)
# Set x = (x + 1)
# Set x = (Lightning - Create a Chain Lightning - Primary lightning effect from source ((Target point of ability being cast) offset by (0.00, -100.00)) to target ((Position of (Target unit of ability being cast)) offset by (-100.00, 100.00))
# x + 1)
# Set LightningEffectsArray[x] = (Last created lightning effect)
 

redhybrid

New Member
Reaction score
1
Trigger:
  • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
    • (Ability being cast) Equal to Lockdown
    • Actions
    • Set LockdownTarget = (Target unit of ability being cast)
    • Set x = 1
    • Unit Group - Add LockdownTarget to LockdownTargets
    • Unit Group - Pick every unit in LockdownTargets and do (Actions)
      • Loop - Actions
    • Lightning - Create a Chain Lightning - Primary lightning effect from source ((Position of (Target unit of ability being cast)) offset by (-100.00, 100.00)) to target ((Position of (Target unit of ability being cast)) offset by (100.00, 100.00))
    • Set LightningEffectsArray[x] = (Last created lightning effect)
    • Set x = (x + 1)
    • Lightning - Create a Chain Lightning - Primary lightning effect from source ((Position of (Target unit of ability being cast)) offset by (100.00, 100.00)) to target ((Target point of ability being cast) offset by (0.00, -100.00))
      • Set LightningEffectsArray[x] = (Last created lightning effect)
    • Set x = (x + 1)
    • Lightning - Create a Chain Lightning - Primary lightning effect from source ((Target point of ability being cast) offset by (0.00, -100.00)) to target ((Position of (Target unit of ability being cast)) offset by (-100.00, 100.00))
      • Set LightningEffectsArray[x] = (Last created lightning effect)
    • Set x = (x + 1)
    • If ((Level of Lockdown for (Triggering unit)) Equal to 1) then do (Wait 8.00 seconds) else do (If ((Level of Lockdown for (Triggering unit)) Equal to 2) then do (Wait 16.00 seconds) else do (If ((Level of Lockdown for (Triggering unit)) Equal to 3) then do (Wait 24.00 seconds) else do (If ((Level of Lockdown for (Triggering unit)) Equal to 4) then do (wait 32.00 seconds)
    • For each (Integer A) from 1 to x, do (Lightning - Destroy LightningEffectsArray[(Integer A)])



Thanks for your help, now I have 2 other minor problems that i can't seem to fix, would love it if someone would please tell me how to get around them

1 ) Firstly I want the lightning effects to occur after the unit is hit by lockdown, not when the caster starts casting the spell, I added a 'wait for 1.50 seconds' at the start of the 'actions', but that doesn't work and it just makes all the lightning effects not show up at all??, so what would be the correct way to make the effects appear after the unit is hit by the spell?

2) Secondly The lightning effects work fine when there is only one instance of the lightning effects, but it but lightning effects aren't destroyed properly anymore when more than one unit is 'locked down', how do i fix this??

I get the impression that this could be solved by changing the final Destroylightningeffects array action from 1 to x to the earliest 3 undestroyed lightning effects but have no idea to go about doing it..

Once again, much thanks for your help
 

redhybrid

New Member
Reaction score
1
i deleted the above post cause i accidentally double-posted, i'm still in need of assistance :banghead::banghead:
 
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