[Solved] Raise Lighting Effect (I tried dummies but they do not work)

Level 9
Joined
Mar 2, 2014
Messages
160
high.jpg

  • Start Copy
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Lightning - Create a Drain Mana lightning effect from source (Position of |cff00ffffUnicorn Path|r 0020 <gen>) to target (Position of |cff00ffffUnicorn Path|r 0019 <gen>)
      • Lightning - Create a Drain Mana lightning effect from source (Position of Gryphon Rider 0021 <gen>) to target (Position of Gryphon Rider 0023 <gen>)
      • Lightning - Create a Drain Mana lightning effect from source (Position of Dummy 0405 <gen>) to target (Position of Dummy 0812 <gen>)
I tried use lighting effect both with destructible in air and flying unit.
I raised destructible in editor if it is relevant.
Any ideas? :cool:2
 
Last edited:
Level 45
Joined
Feb 27, 2007
Messages
5,578
  1. Lightning effect natives take two Z parameters, being the height of the two ends of the lightning effect.
  2. By default, GUI uses the Z-height of the locations that you input as the Z-height for those ends of the lightning effect.
  3. When you use "position of unit", the location returned does not include information about the unit's currently animated height due to its flyheight; it just returns the origin coordinate on the ground that the unit is 'above'.
To resolve this you must manually alter the height of the lightning to include the fly height of the unit in addition to the z height of the location you feed it. GUI cannot do this manually, and every time you use the GUI 'move lightning' action it will reset the ends to be at ground height again. Presuming you have two unit variables Unit1/Unit2 and two location variables Loc1 and Loc2 for each unit, you can properly account for fly height by doing this:
JASS:
call MoveLightningEx(bj_lastCreatedLightning, true, GetUnitX(udg_Unit1), GetUnitY(udg_Unit1), GetLocationZ(udg_Loc1)+GetUnitFlyHeight(udg_Unit1), GetUnitX(udg_Unit2), GetUnitY(udg_Unit2), GetLocationZ(udg_Loc2)+GetUnitFlyHeight(udg_Unit2))
@Nichilus I think if you use MoveLightningEx to set a Z height and then only move the lightning with MoveLightning rather than MoveLightningEx it will retain the current absolute height of its endpoints, since Move is only a 2D function.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Here's a basic system I threw together in GUI that simplifies the process:
Edit: Updated map with some improvements.
 

Attachments

  • Lightning System 3.w3m
    28.6 KB · Views: 4
Last edited:
Level 9
Joined
Mar 2, 2014
Messages
160
You can also always just use lightning effect skill (the drains, spirit shackles) cast between units for a visual effect if you want it to be precise on an air unit without a bunch of triggers.
Yep that is what I ended doing, since when smart people here give advice to my tiny brain I see this:
POW.jpg
This I was able to comprehend:
  • Start Copy
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Unit - Order Gryphon Rider 0021 <gen> to Human Blood Mage - Siphon Mana Gryphon Rider 0023 <gen>
For anyone trying to replicate it, read this first:
and set Data Mana Transfered Per Second (in siphon mana ability) to more than 0

Could save somebody few hours, I did not go to sleep until I figured it out, i went to sleep very late :sad:.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Yep that is what I ended doing, since when smart people here give advice to my tiny brain I see this:
Understandable, I remember the wall of text syndrome before I started learning how to program. But I want to show you just how easy it is, because when I make something I try to make it user friendly. This applies to most systems you'd download from Hive:

Step 1) Open my map, then open the Trigger Editor and copy the Lightning System folder:
1738266984689.png


Step 2) Open your map, then open the Trigger Editor and paste the Lightning System folder.

Step 3) Repeat Step #1 but this time copy the Demo Triggers folder:
1738267096764.png

Note: These are demonstration triggers which show you how to USE the system. Most systems come with these to help the user better understand what they need to do. You don't need to know how/why it works in order to use it.

Step 4) Repeat Step #2 but this time paste the Demo Triggers folder. Now everything related to the system should exist in your map.

Step 5) Disable the DEMO triggers (see how they have a red X in the picture above). Again, these are just examples that you use as a frame of reference. Also, double check to see that JassHelper is enabled (you only have to do this once per map - the menu is at the top of the Trigger Editor). Otherwise, you'll get errors when you try to save.

Step 6) It's finally time to use the system. Since you want to create a Lightning between two Gryphon Riders then all you'd have to do is this:
  • Start copy
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Set VariableSet Lightning_Unit[0] = Gryphon Rider 0021 <gen>
      • Set VariableSet Lightning_Unit[1] = Gryphon Rider 0023 <gen>
      • Set VariableSet Lightning_Targeting = Lightning_U2U
      • Set VariableSet Lightning_Duration = 5.00
      • Set VariableSet Lightning_Offset = 45.00
      • Set VariableSet Lightning_Art = DRAM
      • Trigger - Run Lightning Create <gen> (ignoring conditions)
^ I copied the DEMO u2u trigger and edited it to look like this, saving a lot of hassle. This creates a Lightning attached to your two Gryphons. It lasts 5.00 seconds before fading away and has a 45.00 height offset above the Gryphon's origin. DRAM represents the "Drain Mana" Lightning Art. There's a list of the different types of Art here: Beginner's Guide to Lightning Effects. I also wrote them down in the Comments section of my triggers.
 
Last edited:
Level 9
Joined
Mar 2, 2014
Messages
160
^ I copied the DEMO u2u trigger and edited it to look like this, saving a lot of hassle
Short story: thanks, you system works.

Long Story:
So when reading your message at friday I already had this:
  • Gryphon siphon mana
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Unit - Order Gryphon Rider 0021 <gen> to Human Blood Mage - Siphon Mana Gryphon Rider 0023 <gen>
      • Unit - Order Gryphon Rider 0030 <gen> to Human Blood Mage - Siphon Mana Gryphon Rider 0033 <gen>
      • Unit - Order Gryphon Rider 0040 <gen> to Human Blood Mage - Siphon Mana Gryphon Rider 0038 <gen>
      • Unit - Order Gryphon Rider 0038 <gen> to Human Blood Mage - Siphon Mana Gryphon Rider 0044 <gen>
      • Unit - Order Gryphon Rider 0044 <gen> to Human Blood Mage - Siphon Mana Gryphon Rider 0046 <gen>
      • Unit - Order Gryphon Rider 0046 <gen> to Human Blood Mage - Siphon Mana Gryphon Rider 0048 <gen>
I was like it wokrs okay, me lazy, me keep it.... buuuut it crashed map everytime around 8 mins.

So I used your U2U... but thanks to editor shinnanigens it does not works the same, heights are just off. I needed manulay set heigt of both sides each time, I even edited your trigger, I felt like galaxy brain hacker. Anyway it looked like this:
  • Gryphon 1
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Set VariableSet Lightning_Unit[0] = Gryphon Rider 0021 <gen>
      • Set VariableSet Lightning_Unit[1] = Gryphon Rider 0023 <gen>
      • Set VariableSet Lightning_Targeting = Lightning_U2U
      • Set VariableSet Lightning_Duration = 3600.00
      • Set VariableSet Lightning_Offset = 240.00
      • Set VariableSet Lighnting_Offset2 = 150.00
      • Set VariableSet Lightning_Art = DRAM
      • Trigger - Run Lightning Create <gen> (ignoring conditions)
  • Gryphon 2
    • Events
      • Time - Elapsed game time is 1.10 seconds
    • Conditions
    • Actions
      • Set VariableSet Lightning_Unit[0] = Gryphon Rider 0030 <gen>
      • Set VariableSet Lightning_Unit[1] = Gryphon Rider 0033 <gen>
      • Set VariableSet Lightning_Targeting = Lightning_U2U
      • Set VariableSet Lightning_Duration = 3600.00
      • Set VariableSet Lightning_Offset = 150.00
      • Set VariableSet Lighnting_Offset2 = -100.00
      • Set VariableSet Lightning_Art = DRAM
      • Trigger - Run Lightning Create <gen> (ignoring conditions)
  • Then - Actions
    • Hashtable - Save Lightning_Offset as 0 of Lightning__Index in Lightning__Hash.
    • Hashtable - Save Lightning_Targeting as 1 of Lightning__Index in Lightning__Hash.
    • Hashtable - Save Lightning_Duration as 2 of Lightning__Index in Lightning__Hash.
    • Hashtable - Save Handle OfLightning_Unit[0] as 3 of Lightning__Index in Lightning__Hash.
    • Hashtable - Save Handle OfLightning_Unit[1] as 4 of Lightning__Index in Lightning__Hash.
    • -------- --------
    • Custom script: set udg_LX[0] = GetUnitX( udg_Lightning_Unit[0] )
    • Custom script: set udg_LX[1] = GetUnitX( udg_Lightning_Unit[1] )
    • Custom script: set udg_LY[0] = GetUnitY( udg_Lightning_Unit[0] )
    • Custom script: set udg_LY[1] = GetUnitY( udg_Lightning_Unit[1] )
    • Set VariableSet LZ[0] = (Lightning_Offset + (Current flying height of Lightning_Unit[0]))
    • Set VariableSet LZ[1] = (Lighnting_Offset2 + (Current flying height of Lightning_Unit[1]))
    • Custom script: set udg_Lightning__Array[udg_Lightning__Index] = AddLightningEx( udg_Lightning_Art, true, udg_LX[0], udg_LY[0], udg_LZ[0], udg_LX[1], udg_LY[1], udg_LZ[1] )
But the second lighting effect height was overwriting first one!
So I just tried point to point without flying dummies and it worked perfectly:
  • Gryphon B1
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Set VariableSet Lightning_Point[0] = (Position of |cff00ffffUnicorn Path|r 0020 <gen>)
      • Set VariableSet Lightning_Point[1] = (Position of |cff00ffffUnicorn Path|r Shadowrealm 0029 <gen>)
      • Set VariableSet Lightning_Targeting = Lightning_P2P
      • Set VariableSet Lightning_Duration = 3600.00
      • Set VariableSet Lightning_Offset = 150.00
      • Set VariableSet Lightning_Art = DRAM
      • Trigger - Run Lightning Create <gen> (ignoring conditions)
B2-B5 kinda same
  • Gryphon B6
    • Events
      • Time - Elapsed game time is 1.60 seconds
    • Conditions
    • Actions
      • Set VariableSet Lightning_Point[0] = (Position of |cff00ffffUnicorn Path|r 0045 <gen>)
      • Set VariableSet Lightning_Point[1] = (Position of |cff00ffffUnicorn Path|r 0047 <gen>)
      • Set VariableSet Lightning_Targeting = Lightning_P2P
      • Set VariableSet Lightning_Duration = 3600.00
      • Set VariableSet Lightning_Offset = 150.00
      • Set VariableSet Lightning_Art = DRAM
      • Trigger - Run Lightning Create <gen> (ignoring conditions)



🦄UNICORN PATH POWER 🦄
yay.jpg
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
HD mode had some weird issues related to Lightning, at least the last time I tested it which was probably in ~1.35, but what I made should work perfectly fine in SD mode. Unless I broke something and didn't notice it in my tests...

Glad you got it working, though.
 
Last edited:
Level 9
Joined
Mar 2, 2014
Messages
160
HD mode had some weird issues related to Lightning, at least the last time I tested it which was probably in ~1.35, but what I made should work perfectly fine in SD mode. Unless I broke something and didn't notice it in my tests...

Glad you got it working, though.
I made it more than work I even integrated it to my triggers:
  • Sells to generator
    • Events
      • Unit - A unit Pawns an item (to shop)
    • Conditions
      • |cff00ffffMagic Card - used for traversing unicorn path|r Equal to (Item-type of (Sold Item))
    • Actions
      • Set VariableSet Lightning_Point[0] = (Position of (Buying unit))
      • Special Effect - Create a special effect at (Position of (Buying unit)) using Abilities\Spells\Undead\FrostArmor\FrostArmorTarget.mdl
      • Special Effect - Set Scale of (Last created special effect) to 4.00
      • Special Effect - Set Position - Z of (Last created special effect) to ((Position - Z of (Last created special effect).) + 150.00)
  • Used unicorn path
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Use Unicorn Path
    • Actions
      • Set VariableSet Lightning_Point[1] = (Target point of ability being cast)
      • Set VariableSet Lightning_Targeting = Lightning_P2P
      • Set VariableSet Lightning_Duration = 5.00
      • Set VariableSet Lightning_Offset = 150.00
      • Set VariableSet Lightning_Art = CLPB
      • Trigger - Run Lightning Create <gen> (ignoring conditions)
      • Player - Add -1 to (Owner of (Casting unit)).Current lumber
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (Target point of ability being cast) using Abilities\Spells\Undead\FrostArmor\FrostArmorTarget.mdl
      • Special Effect - Set Scale of (Last created special effect) to 4.00
      • Special Effect - Set Position - Z of (Last created special effect) to ((Position - Z of (Last created special effect).) + 150.00)
      • Unit - Hide (Casting unit)
      • Wait 0.10 seconds
      • Unit - Move (Casting unit) instantly to (Target point of ability being cast)
      • Unit - Unhide (Casting unit)
      • Wait 1.50 seconds
      • Special Effect - Destroy (Last created special effect)
Result:

I guess, for you guys it is nothing special, but for me it is best thing ever :grin:

EDIT:
After around half hour main effect of mana drain just dissapers :eek:
gone.jpg

I guess solution would be some fancy repeat after 20 minutes but I just reactive it manually:
  • Reset
    • Events
      • Player - Player 1 (Red) types a chat message containing r as An exact match
    • Conditions
    • Actions
      • Wait 0.10 seconds
      • Set VariableSet Lightning_Point[0] = (Position of |cff00ffffUnicorn Path|r 0020 <gen>)
      • Set VariableSet Lightning_Point[1] = (Position of |cff00ffffUnicorn Path|r Shadowrealm 0029 <gen>)
      • Set VariableSet Lightning_Targeting = Lightning_P2P
      • Set VariableSet Lightning_Duration = 3600.00
      • Set VariableSet Lightning_Offset = 150.00
      • Set VariableSet Lightning_Art = DRAM
      • Trigger - Run Lightning Create <gen> (ignoring conditions)
      • Wait 0.10 seconds
      • Set VariableSet Lightning_Art = DRAM
      • Set VariableSet Lightning_Point[0] = (Position of |cff00ffffUnicorn Path|r Shadowrealm 0019 <gen>)
      • Set VariableSet Lightning_Point[1] = (Position of |cff00ffffUnicorn Path|r Shadowrealm 0031 <gen>)
      • Set VariableSet Lightning_Targeting = Lightning_P2P
      • Set VariableSet Lightning_Duration = 3600.00
      • Set VariableSet Lightning_Offset = 150.00
      • Set VariableSet Lightning_Art = DRAM
      • Trigger - Run Lightning Create <gen> (ignoring conditions)
      • Wait 0.10 seconds
      • Set VariableSet Lightning_Point[0] = (Position of |cff00ffffUnicorn Path|r 0039 <gen>)
      • Set VariableSet Lightning_Point[1] = (Position of |cff00ffffUnicorn Path|r 0037 <gen>)
      • Set VariableSet Lightning_Targeting = Lightning_P2P
      • Set VariableSet Lightning_Duration = 3600.00
      • Set VariableSet Lightning_Offset = 150.00
      • Set VariableSet Lightning_Art = DRAM
      • Trigger - Run Lightning Create <gen> (ignoring conditions)
      • Wait 0.10 seconds
      • Set VariableSet Lightning_Point[0] = (Position of |cff00ffffUnicorn Path|r 0037 <gen>)
      • Set VariableSet Lightning_Point[1] = (Position of |cff00ffffUnicorn Path|r 0042 <gen>)
      • Set VariableSet Lightning_Targeting = Lightning_P2P
      • Set VariableSet Lightning_Duration = 3600.00
      • Set VariableSet Lightning_Offset = 150.00
      • Set VariableSet Lightning_Art = DRAM
      • Trigger - Run Lightning Create <gen> (ignoring conditions)
      • Wait 0.10 seconds
      • Set VariableSet Lightning_Point[0] = (Position of |cff00ffffUnicorn Path|r 0042 <gen>)
      • Set VariableSet Lightning_Point[1] = (Position of |cff00ffffUnicorn Path|r 0045 <gen>)
      • Set VariableSet Lightning_Targeting = Lightning_P2P
      • Set VariableSet Lightning_Duration = 3600.00
      • Set VariableSet Lightning_Offset = 150.00
      • Set VariableSet Lightning_Art = DRAM
      • Trigger - Run Lightning Create <gen> (ignoring conditions)
      • Wait 0.10 seconds
      • Set VariableSet Lightning_Point[0] = (Position of |cff00ffffUnicorn Path|r 0045 <gen>)
      • Set VariableSet Lightning_Point[1] = (Position of |cff00ffffUnicorn Path|r 0047 <gen>)
      • Set VariableSet Lightning_Targeting = Lightning_P2P
      • Set VariableSet Lightning_Duration = 3600.00
      • Set VariableSet Lightning_Offset = 150.00
      • Set VariableSet Lightning_Art = DRAM
      • Trigger - Run Lightning Create <gen> (ignoring conditions)

EDIT 2:
Cant stop using lighting
  • Ultimate dragon
    • Events
      • Player - Player 1 (Red) types a chat message containing ultimate as An exact match
    • Conditions
    • Actions
      • Unit - Order Salty Phish 0051 <gen> to Move To (Center of Fish ultimate <gen>)
      • Wait 2.00 seconds
      • Item - Remove (Item carried by Salty Phish 0051 <gen> in slot 1)
      • Wait 0.90 seconds
      • Set VariableSet Lightning_Point[0] = (Position of Salty Phish 0051 <gen>)
      • Set VariableSet Lightning_Point[1] = (Center of Dragon1 <gen>)
      • Set VariableSet Lightning_Targeting = Lightning_P2P
      • Set VariableSet Lightning_Duration = 5.00
      • Set VariableSet Lightning_Offset = 150.00
      • Set VariableSet Lightning_Art = CLPB
      • Trigger - Run Lightning Create <gen> (ignoring conditions)
      • Wait 0.10 seconds
      • Unit - Create 1 Blue Drake for Player 22 (Snow) at (Center of Dragon1 <gen>) facing (Position of Salty Phish 0051 <gen>)
      • Set VariableSet D1 = (Last created unit)
      • Wait 1.00 seconds
      • Item - Remove (Item carried by Salty Phish 0051 <gen> in slot 2)
      • Wait 0.90 seconds
      • Set VariableSet Lightning_Point[0] = (Position of Salty Phish 0051 <gen>)
      • Set VariableSet Lightning_Point[1] = (Center of Dragon2 <gen>)
      • Set VariableSet Lightning_Targeting = Lightning_P2P
      • Set VariableSet Lightning_Duration = 5.00
      • Set VariableSet Lightning_Offset = 150.00
      • Set VariableSet Lightning_Art = CLPB
      • Trigger - Run Lightning Create <gen> (ignoring conditions)
      • Wait 0.10 seconds
      • Unit - Create 1 Blue Drake for Player 22 (Snow) at (Center of Dragon2 <gen>) facing (Position of Salty Phish 0051 <gen>)
      • Set VariableSet D2 = (Last created unit)
      • Wait 1.00 seconds
      • Item - Remove (Item carried by Salty Phish 0051 <gen> in slot 3)
      • Wait 0.90 seconds
      • Set VariableSet Lightning_Point[0] = (Position of Salty Phish 0051 <gen>)
      • Set VariableSet Lightning_Point[1] = (Center of Shop <gen>)
      • Set VariableSet Lightning_Targeting = Lightning_P2P
      • Set VariableSet Lightning_Duration = 5.00
      • Set VariableSet Lightning_Offset = 150.00
      • Set VariableSet Lightning_Art = CLPB
      • Trigger - Run Lightning Create <gen> (ignoring conditions)
      • Wait 0.10 seconds
      • Unit - Create 1 Blue Drake for Player 22 (Snow) at (Center of Shop <gen>) facing (Position of Salty Phish 0051 <gen>)
      • Set VariableSet D3 = (Last created unit)
      • Wait 1.00 seconds
      • Set VariableSet Lightning_Point[0] = (Center of Dragon1 <gen>)
      • Set VariableSet Lightning_Point[1] = (Position of Salty Phish 0051 <gen>)
      • Set VariableSet Lightning_Targeting = Lightning_P2P
      • Set VariableSet Lightning_Duration = 5.00
      • Set VariableSet Lightning_Offset = 150.00
      • Set VariableSet Lightning_Art = LEAS
      • Trigger - Run Lightning Create <gen> (ignoring conditions)
      • Set VariableSet Lightning_Point[0] = (Center of Dragon2 <gen>)
      • Set VariableSet Lightning_Point[1] = (Position of Salty Phish 0051 <gen>)
      • Set VariableSet Lightning_Targeting = Lightning_P2P
      • Set VariableSet Lightning_Duration = 5.00
      • Set VariableSet Lightning_Offset = 150.00
      • Set VariableSet Lightning_Art = LEAS
      • Trigger - Run Lightning Create <gen> (ignoring conditions)
      • Set VariableSet Lightning_Point[0] = (Center of Dragon 3 <gen>)
      • Set VariableSet Lightning_Point[1] = (Position of Salty Phish 0051 <gen>)
      • Set VariableSet Lightning_Targeting = Lightning_P2P
      • Set VariableSet Lightning_Duration = 5.00
      • Set VariableSet Lightning_Offset = 150.00
      • Set VariableSet Lightning_Art = LEAS
      • Trigger - Run Lightning Create <gen> (ignoring conditions)
      • Wait 5.00 seconds
      • Unit - Remove D1 from the game
      • Unit - Remove D2 from the game
      • Unit - Remove D3 from the game
      • Unit - Create 1 Blue Dragon for Player 22 (Snow) at (Center of Fish ultimate <gen>) facing (Center of Dragon 3 <gen>)
      • Wait 2.00 seconds
      • Item - Create Ultimate Dragon at (Center of casino <gen>)
      • Hero - Give (Last created item) to Salty Phish 0051 <gen>
      • Unit - Remove (Last created unit) from the game
 
Last edited:
Top