- Joined
- Mar 1, 2014
- Messages
- 68
Hey guys please help me.. How can i make a custom lightning effect that is somehow placed on the chest of units ? I saw some maps with those features so i know it will be possible
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 ?
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.
If you want to know how to learn it with aid of GUI, clicky.
Anyway, here's a full gui thing:
Break down:
Custom script: call MoveLightningEx(udg_lightningVariable,true,udg_xPosition1,udg_yPosition1,udg_height1,udg_xPosition2,udg_yPosition2,udg_height2)
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.
I gave you solution with which you can use locations, just read it carefully...