It might depend on the triggers, mind posting them?
Otherwise, it might have to do with visibility. Blizzard added a field,
boolean checkVisibility
, to lightning (it defaults to
true
in GUI). When it is set to "true", it requires the start point and the end point of the lightning to both be
visible in order for the lightning to appear on your screen. For example, if you have black mask/fog of war covering either the start point
or the end point of the lightning, it won't show up.
Note that "visibility" depends on the player. Some players might have that part visible (e.g. a unit is nearby) whereas other players won't. In that case, the players who
can see it will see it, but the other players won't.
GUI doesn't give you access to this field, but JASS does. Let's say you want to create chain lightning from "Point1" to "Point2", and you want it to be visible to players no matter what. It would look like this:
-
Set Point1 = (Position of (Triggering unit))
-
Set Point2 = (Position of (Target unit of ability being cast))
-
Custom script: set bj_lastCreatedLightning = AddLightningEx("CLPB", false, GetLocationX(udg_Point1), GetLocationY(udg_Point1), GetLocationZ(udg_Point1), GetLocationX(udg_Point2), GetLocationY(udg_Point2), GetLocationZ(udg_Point2))
Of course, you'd clear the leaks later on. In case you need an explanation of what each thing does:
set bj_lastCreatedLightning =
-> This assigns the lightning to the GUI variable "Last created lightning". So if you want to destroy this or assign it to your own variable, you can simply use "Last created lightning". Just make sure you put those actions after the custom script action.
AddLightningEx
-> In JASS, you have a list of functions that you can call. These functions do stuff. This one is self-explanatory. It adds lightning. The "Ex" part means it has extra arguments. The normal version doesn't have z-coordinates.
"CLPB"
-> This is the string for "chain lightning". Don't worry about what it means. These are hard-coded. You can find a list of them here: Link (Scroll to the bottom)
- The rest is just grabbing the (x, y, z) coordinates from Point1 and Point2.
Good luck!