• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Spell] Floating Lightning effect

Status
Not open for further replies.
Level 4
Joined
Mar 1, 2014
Messages
68
Kind of impossible. You can create a lightning between 2 points, however you can't attach it to a unit's chest.

you can change the Z value (height) of the lightning, but there is no way to get the exact value that match the unit's chest height.

How ? that's what i want to know eh ? .. And how about two dummies while the other one is channeling drain ?
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
How ? that's what i want to know eh ? .. And how about two dummies while the other one is channeling drain ?
  • Lightning - Create a Chain Lightning - Primary lightning effect from source (Position of (Triggering unit)) to target (Center of (Playable map area))
Well a dummy spell would work, but I always assume people want to do it with triggers only :p
 

Deleted member 219079

D

Deleted member 219079

You'll need to use JASS. SetLightningPositionEx(lightning,x1,y1,z1,x2,y2,z2). For chest height, get unit fly height and add 50. Store unit ID in hash table for units that you know can't be that small.
 

Deleted member 219079

D

Deleted member 219079

If you want to know how to learn it with aid of GUI, clicky.

Anyway, here's a full gui thing:
  • Custom script: call MoveLightningEx(udg_lightningVariable,true,udg_xPosition1,udg_yPosition1,udg_height1,udg_xPosition2,udg_yPosition2,udg_height2)
Break down:
udg_lightningVariable = udg_ : prefix, don't remove. lightningVariable, replace with the name of variable assigned to your lightning.
true = don't change.
xPosition1 = replace with the name of variable assigned to your first x coordinate. Alternatively, use GetLocationX(udg_myLocation) , where you'll need to replace myLocation with the name of the variable assigned to your point 1.
yPosition1 = replace with the name of variable assigned to your first y coordinate. Alternatively, use GetLocationY(udg_myLocation) , where you'll need to replace myLocation with the name of the variable assigned to your point 1.
height1 = replace with the name of variable assigned to the outcome of get unit fly height. Alternative, use GetUnitFlyHeight(udg_myUnit), where you'll need to replace myUnit with the name of first unit. Alternatively, use a number from 0 to 1000. For example a value of 0 will mean the lightning's at the ground level. E.g. 240 is the height of gryphon rider. Remember that you should add ~50 to the number to make it more to a chest level, so it'll become udg_height1 + 50.
xPosition2 = replace with the name of variable assigned to your second x coordinate. Alternatively, use GetLocationX(udg_myLocation2) , where you'll need to replace myLocation2 with the name of the variable assigned to your point 2.
yPosition2 = replace with the name of variable assigned to your second y coordinate. Alternatively, use GetLocationY(udg_myLocation2) , where you'll need to replace myLocation2 with the name of the variable assigned to your point 2.
height2 = replace with the name of variable assigned to the outcome of get unit 2 fly height. Alternative, use GetUnitFlyHeight(udg_myUnit2), where you'll need to replace myUnit2 with the name of second unit. Alternatively, use a number from 0 to 1000. For example a value of 0 will mean the lightning's at the ground level. E.g. 240 is the height of gryphon rider. Remember that you should add ~50 to the number to make it more to a chest level, so it'll become udg_height1 + 50.
 
Level 4
Joined
Mar 1, 2014
Messages
68
If you want to know how to learn it with aid of GUI, clicky.

Anyway, here's a full gui thing:
  • Custom script: call MoveLightningEx(udg_lightningVariable,true,udg_xPosition1,udg_yPosition1,udg_height1,udg_xPosition2,udg_yPosition2,udg_height2)
Break down:
udg_lightningVariable = udg_ : prefix, don't remove. lightningVariable, replace with the name of variable assigned to your lightning.
true = don't change.
xPosition1 = replace with the name of variable assigned to your first x coordinate. Alternatively, use GetLocationX(udg_myLocation) , where you'll need to replace myLocation with the name of the variable assigned to your point 1.
yPosition1 = replace with the name of variable assigned to your first y coordinate. Alternatively, use GetLocationY(udg_myLocation) , where you'll need to replace myLocation with the name of the variable assigned to your point 1.
height1 = replace with the name of variable assigned to the outcome of get unit fly height. Alternative, use GetUnitFlyHeight(udg_myUnit), where you'll need to replace myUnit with the name of first unit. Alternatively, use a number from 0 to 1000. For example a value of 0 will mean the lightning's at the ground level. E.g. 240 is the height of gryphon rider. Remember that you should add ~50 to the number to make it more to a chest level, so it'll become udg_height1 + 50.
xPosition2 = replace with the name of variable assigned to your second x coordinate. Alternatively, use GetLocationX(udg_myLocation2) , where you'll need to replace myLocation2 with the name of the variable assigned to your point 2.
yPosition2 = replace with the name of variable assigned to your second y coordinate. Alternatively, use GetLocationY(udg_myLocation2) , where you'll need to replace myLocation2 with the name of the variable assigned to your point 2.
height2 = replace with the name of variable assigned to the outcome of get unit 2 fly height. Alternative, use GetUnitFlyHeight(udg_myUnit2), where you'll need to replace myUnit2 with the name of second unit. Alternatively, use a number from 0 to 1000. For example a value of 0 will mean the lightning's at the ground level. E.g. 240 is the height of gryphon rider. Remember that you should add ~50 to the number to make it more to a chest level, so it'll become udg_height1 + 50.

All coordinates are variables right ? :ogre_rage: oh my .. XD
 

Deleted member 219079

D

Deleted member 219079

I gave you solution with which you can use locations, just read it carefully...
 
Status
Not open for further replies.
Top