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

How to reveal a rect/region?

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,337
Hi,

What is the native to reveal a rect/region to the player, e.g. they have vision of that rect/region.

I tried using this call

JASS:
call SetFogStateRect(owner, FOG_OF_WAR_VISIBLE, townArea, true)

But all it did was keep the fog, except reveal that there were buildings under it.
 
Apparently the BJ does this.

JASS:
function CreateFogModifierRectBJ takes boolean enabled, player whichPlayer, fogstate whichFogState, rect r returns fogmodifier
    set bj_lastCreatedFogModifier = CreateFogModifierRect(whichPlayer, whichFogState, r, true, false)
    if enabled then
        call FogModifierStart(bj_lastCreatedFogModifier)
    endif
    return bj_lastCreatedFogModifier
endfunction

Probably FogModifiers have to be started via that call?
 
Level 15
Joined
Aug 7, 2013
Messages
1,337
Ah many thanks. But do I need to destroy the fog modifier as well (store it in a variable then call destroy)? Or does it not leak?
 
Status
Not open for further replies.
Top