• 🏆 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!

Lighting Effects Does not appear corretly at Fog of War!

Status
Not open for further replies.
Hello. I want to make my lighting effects visible on map even in the fog of war. I've found fucntion:

JASS:
set bj_lastCreatedLightning = AddLightningEx("CLPB", false, 0, 0, 800, 0, 0, 800)

It workes, however, not how i am expecting. Maybe someone know how to make lightings effect visible on the fog of war at the same way how it's visible when all map vision open.
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,013
AddLightningEx takes Z (height) values. AddLightning does not. The only thing you need to change is to make the second argument false like you have done. Put the following function in your map and call it with whatever arguments you would normally give to AddLightningLoc (the one GUI uses):
JASS:
function AddLightningLocVisible takes string codeName, location where1, location where2 returns lightning
    set bj_lastCreatedLightning = AddLightningEx(codeName, false, GetLocationX(where1), GetLocationY(where1), GetLocationZ(where1), GetLocationX(where2), GetLocationY(where2), GetLocationZ(where2))
    return bj_lastCreatedLightning
endfunction
 
AddLightningEx takes Z (height) values. AddLightning does not. The only thing you need to change is to make the second argument false like you have done. Put the following function in your map and call it with whatever arguments you would normally give to AddLightningLoc (the one GUI uses):
JASS:
function AddLightningLocVisible takes string codeName, location where1, location where2 returns lightning
    set bj_lastCreatedLightning = AddLightningEx(codeName, false, GetLocationX(where1), GetLocationY(where1), GetLocationZ(where1), GetLocationX(where2), GetLocationY(where2), GetLocationZ(where2))
    return bj_lastCreatedLightning
endfunction

Yep, this is exactly what i did, however, this does not works, the lighting still not visible in fog of war.

The exact issue i have is the visual bug with fog of war. When all map is visible open the ligting looks fine, however, when map is full fog of war it's very buggy and not visible. I wish to make lighting visible like such sprite over entire map, like map visible open, but with the fog of war. I hope you can understand the idea.

Probably there should be SLK data or something like this, which can set up by default the settings of the lighting or the fog of war.

Hope this video can explain what going on with lighting in the map:
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,013
Actually I figured it out. The MoveLightning function also has a checkVisbility flag so you need to use an updated version of that one too otherwise it goes back to not-visible when it's moved anywhere.
JASS:
function MoveLightningLocVisible takes lightning whichBolt, location where1, location where2 returns boolean
    return MoveLightningEx(whichBolt, false, GetLocationX(where1), GetLocationY(where1), GetLocationZ(where1), GetLocationX(where2), GetLocationY(where2), GetLocationZ(where2))
endfunction
 
Actually I figured it out. The MoveLightning function also has a checkVisbility flag so you need to use an updated version of that one too otherwise it goes back to not-visible when it's moved anywhere.
JASS:
function MoveLightningLocVisible takes lightning whichBolt, location where1, location where2 returns boolean
    return MoveLightningEx(whichBolt, false, GetLocationX(where1), GetLocationY(where1), GetLocationZ(where1), GetLocationX(where2), GetLocationY(where2), GetLocationZ(where2))
endfunction

WORKED! Thank you so much!
 
Status
Not open for further replies.
Top