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

Revealing entire map unintended

Status
Not open for further replies.
Level 18
Joined
Mar 16, 2008
Messages
721
The cinematic triggers reveal the entire map's visibility for all players and I don't know why. I don't intend for them to reveal.
  • OJ Black Altar
    • Events
      • Unit - A unit owned by Player 6 (Orange) Dies
    • Conditions
      • (Dying unit) Equal to OJ_Hero
    • Actions
      • Cinematic - Turn cinematic mode On for Solo_Group_OJ
      • Cinematic - Send transmission to Solo_Group_OJ from a Neutral Passive.Orb Forger named GAME OVER at (Center of (Playable map area)): Play No sound and display You died while flyi.... Modify duration: Add 300.00 seconds and Wait
      • Camera - Apply Orb Forge Cam <gen> for Player 6 (Orange) over 1.00 seconds with ease in time: 1.00 seconds, ease out time: 1.00 seconds, and smooth factor: 1.00
      • Wait 1.00 seconds
      • Game - Defeat Player 6 (Orange) with the message: Defeat! ...
      • Camera - Apply Orb Forge Cam Zoomed In <gen> for Player 6 (Orange) over 18.00 seconds with ease in time: 18.00 seconds, ease out time: 1.00 seconds, and smooth factor: 1.00
      • Unit Group - Pick every unit in (Units in (Entire map) owned by Player 6 (Orange)) and do (Unit - Change ownership of (Picked unit) to Player 21 (Coal) and Change color)
      • Unit - Remove Hidden Altar of Knights 0319 <gen> from the game
      • Quest - Display to (All players) the Quest Update message: The |cffd45e19Orang...
      • Leaderboard - Remove Player 6 (Orange) from Alliances_Leaderboard.
 
Last edited:
This has to do with how Blizzard wrote the function for "Turn cinematic mode On". Here are some related threads:

Usually, people will write a custom function to make sure fog doesn't get turned off. You can place this function in your map's header to be able to use it in your code. You can access your map header by opening the Trigger Editor > Selecting your map's name > Pasting the following code in that text area:
JASS:
function CinematicModeWithoutChangingFog takes boolean cineMode, force forForce, real interfaceFadeTime returns nothing
    // If the game hasn't started yet, perform interface fades immediately
    if (not bj_gameStarted) then
        set interfaceFadeTime = 0
    endif

    if (cineMode) then
        // Save the UI state so that we can restore it later.
        if (not bj_cineModeAlreadyIn) then
            set bj_cineModeAlreadyIn = true
            set bj_cineModePriorSpeed = GetGameSpeed()
            // set bj_cineModePriorFogSetting = IsFogEnabled()
            // set bj_cineModePriorMaskSetting = IsFogMaskEnabled()
            set bj_cineModePriorDawnDusk = IsDawnDuskEnabled()
            set bj_cineModeSavedSeed = GetRandomInt(0, 1000000)
        endif

        // Perform local changes
        if (IsPlayerInForce(GetLocalPlayer(), forForce)) then
            // Use only local code (no net traffic) within this block to avoid desyncs.
            call ClearTextMessages()
            call ShowInterface(false, interfaceFadeTime)
            call EnableUserControl(false)
            call EnableOcclusion(false)
            call SetCineModeVolumeGroupsBJ()
        endif

        // Perform global changes
        call SetGameSpeed(bj_CINEMODE_GAMESPEED)
        call SetMapFlag(MAP_LOCK_SPEED, true)
        // call FogMaskEnable(false)
        // call FogEnable(false)
        // call EnableWorldFogBoundary(false)
        call EnableDawnDusk(false)

        // Use a fixed random seed, so that cinematics play consistently.
        call SetRandomSeed(0)
    else
        set bj_cineModeAlreadyIn = false

        // Perform local changes
        if (IsPlayerInForce(GetLocalPlayer(), forForce)) then
            // Use only local code (no net traffic) within this block to avoid desyncs.
            call ShowInterface(true, interfaceFadeTime)
            call EnableUserControl(true)
            call EnableOcclusion(true)
            call VolumeGroupReset()
            call EndThematicMusic()
            call CameraResetSmoothingFactorBJ()
        endif

        // Perform global changes
        call SetMapFlag(MAP_LOCK_SPEED, false)
        call SetGameSpeed(bj_cineModePriorSpeed)
        // call FogMaskEnable(bj_cineModePriorMaskSetting)
        // call FogEnable(bj_cineModePriorFogSetting)
        // call EnableWorldFogBoundary(true)
        call EnableDawnDusk(bj_cineModePriorDawnDusk)
        call SetRandomSeed(bj_cineModeSavedSeed)
    endif
endfunction

Then you can use it like so:
  • Custom script: call CinematicModeWithoutChangingFog(true, udg_Solo_Group_OJ, bj_CINEMODE_INTERFACEFADE)
Untested, but hopefully it works. And if you have problems with visibility during your cinematic, consider making a visibility modifier instead of disabling the entire fog of war.
 
Level 18
Joined
Mar 16, 2008
Messages
721
Thank you for this mini tutorial. Above and beyond.

edit: works perfectly as copy pasted. thank you so much. i found those other forum posts but could not believe this was really the problem.
 
Last edited:
Status
Not open for further replies.
Top