lightning effects

ironfist19

New Member
Reaction score
3
Hi, I need help! I want my spell to create a lightning effect that will follow the units rotated in a range. I am having a problem because my trigger is created noobishly.
My Triggers :
Trigger:
  • Magnetic Rotation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Magnetic Rotation
    • Actions
      • Set MRCaster = (Triggering unit)
      • Set RotatedUnit = (Units within 500.00 of CasterLoc matching (((Matching unit) belongs to an enemy of (Owner of MRCaster)) Equal to True))
      • Lightning - Create a Drain Life lightning effect from source CasterLoc to target (Position of (Random unit from RotatedUnit))
      • Trigger - Turn on Rotation Units <gen>
      • Wait 10.00 seconds
      • Trigger - Turn off Rotation Units <gen>
      • Lightning - Destroy (Last created lightning effect)


Trigger:
  • Rotation Units
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Set CasterLoc = (Position of MRCaster)
      • Unit Group - Pick every unit in RotatedUnit and do (Actions)
        • Loop - Actions
          • Unit - Move (Picked unit) instantly to (CasterLoc offset by ((Distance between CasterLoc and (Position of (Picked unit))) - 5.00) towards ((Angle from CasterLoc to (Position of (Picked unit))) + 10.00) degrees)
 

DuelPlayer

Member
Reaction score
21
Try this, i am not sure if this will work
And if i am not wrong, nice double thread

First in 2nd trigger create the lightning effect between two points
Then create a new variable call LightningsEffect with array
Then create a new integer. For every units in range, +1 to the integer and set the last created lightnings effect to LightningsEffect(integer)
Then after all the action
Run the created trigger below
Create another trigger
That wait 0.03 second
Then create a new variable integer call integer 2
Set integer 2 = integer
Then use for each (integer) from 1 to (integer 2)
Destroy LightningsEffect(integer)
 

Tyrulan

Ultra Cool Member
Reaction score
37
Can you explain the behavior this code is giving? This will help diagnose the problem.

And if i am not wrong, nice double thread

Also, this is a single thread. This technique however is used in many triggers for smooth movement of units.
 

DuelPlayer

Member
Reaction score
21
Can you explain the behavior this code is giving? This will help diagnose the problem.



Also, this is a single thread. This technique however is used in many triggers for smooth movement of units.

:O ITS A SINGLE THREAD???? THEN I MUST BE WRONG...
He asked the question in other thread and got a reply
 

Tyrulan

Ultra Cool Member
Reaction score
37
Heh, strange. I remember that now. My apologies. I misinterpreted your use of the word thread.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top