Help with the Game Camera during and after Cinematics

Status
Not open for further replies.
Level 7
Joined
Feb 13, 2022
Messages
87
Hey everyone! This is a pretty straight forward set of problems, all involving the game camera for players during this tutorial cinematic. This cinematic scene plays for one player at a time (multiple players should be able to use this tutorial just fine all at the same time) , but when this cinematic plays it reveals the map to all of the other players not in the cinematic scene. The second issue is that the camera gets wonky for the person who finishes watching this cinematic, it shows the map boundaries(this issue might happen to players not in the tutorial, I haven't tested it enough to know). I need both of these issues to be fixed to have my tutorial fully functional without interfering in the game/gameplay! Here is the trigger current as is, all feedback on possible solutions are appreciated.
  • TutorialStart
    • Events
      • Player - Player 1 (Red) types a chat message containing -T as An exact match
      • Player - Player 2 (Blue) types a chat message containing -T as An exact match
      • Player - Player 3 (Teal) types a chat message containing -T as An exact match
      • Player - Player 4 (Purple) types a chat message containing -T as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -T as An exact match
      • Player - Player 6 (Orange) types a chat message containing -T as An exact match
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering player) Equal to Player 1 (Red)
        • Then - Actions
          • Cinematic - Fade out over 1.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Wait 1.00 seconds
          • Cinematic - Turn cinematic mode On for Player Group - Player 1 (Red)
          • Environment - Set sky to Dalaran Ruins Sky
          • Camera - Apply Goal Camera <gen> for Player 1 (Red) over 0.00 seconds
          • Cinematic - Fade out over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Cinematic - Fade in over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Cinematic - Send transmission to Player Group - Player 1 (Red) from Rat 0107 <gen> named A Friendly Rat: Play No sound and display Your goal as a Rat .... Modify duration: Add 10.00 seconds and Wait
          • Camera - Apply The Power Shop <gen> for Player 1 (Red) over 0.00 seconds
          • Cinematic - Fade out over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Cinematic - Fade in over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Cinematic - Send transmission to Player Group - Player 1 (Red) from Rat 0107 <gen> named A Friendly Rat: Play No sound and display Use your Rat Soul p.... Modify duration: Add 5.50 seconds and Wait
          • Camera - Apply Camera Opener <gen> for Player 1 (Red) over 0.00 seconds
          • Cinematic - Fade out over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Cinematic - Fade in over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Unit - Order Rat 0106 <gen> to Night Elf Keeper Of The Grove - Tranquility.
          • Cinematic - Send transmission to Player Group - Player 1 (Red) from Rat 0106 <gen> named A Helpful Rat: Play No sound and display When teammates peri.... Modify duration: Add 6.00 seconds and Wait
          • Unit - Order Rat 0106 <gen> to Stop.
          • Camera - Apply Cheese n Shops <gen> for Player 1 (Red) over 0.00 seconds
          • Cinematic - Fade out over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Cinematic - Fade in over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Cinematic - Send transmission to Player Group - Player 1 (Red) from Rat 0163 <gen> named A Helpful Rat: Play No sound and display Grab Cheese for gol.... Modify duration: Add 10.00 seconds and Wait
          • Camera - Apply Minigame camera <gen> for Player 1 (Red) over 0.00 seconds
          • Cinematic - Fade out over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Cinematic - Fade in over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Cinematic - Send transmission to Player Group - Player 1 (Red) from Rat 0181 <gen> named A Wise Rat: Play No sound and display There are seven bui.... Modify duration: Add 7.50 seconds and Wait
          • Cinematic - Send transmission to Player Group - Player 1 (Red) from Rat 0181 <gen> named A Wise Rat: Play No sound and display Each minigame has d.... Modify duration: Add 6.25 seconds and Wait
          • Camera - Apply Camera Opener <gen> for Player 1 (Red) over 0.00 seconds
          • Cinematic - Fade out over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Cinematic - Fade in over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Cinematic - Send transmission to Player Group - Player 1 (Red) from Rat 0106 <gen> named A Helpful Rat: Play No sound and display Check out the quest.... Modify duration: Add 5.00 seconds and Wait
          • Cinematic - Turn cinematic mode Off for Player Group - Player 1 (Red)
          • Selection - Select Rat 0001 <gen> for Player 1 (Red)
          • Camera - Pan camera for Player 1 (Red) to (Position of Rat 0001 <gen>) over 0.00 seconds
          • Camera - Reset camera for Player 1 (Red) to standard game-view over 0.01 seconds
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering player) Equal to Player 2 (Blue)
            • Then - Actions
            • Else - Actions
 
Level 19
Joined
Mar 16, 2008
Messages
810
If only some players are experiencing a cinematic then you need to use this custom function that @PurgeandFire wrote:

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
One problem with it is it will trigger for players watching the replay. I'm sure there's some way to add a condition to this to prevent spectators? from being 'victim' to this function but I haven't figured it out. So it pretty much renders replays useless. [EDIT: This has been fixed, see PurgedandFire's profile.]
( Revealing entire map unintended )

There are some systems to detect whether the player is in a replay, such as this one:
www.hiveworkshop.com

GameStatus - Replay Detection

This map allows you to detect if the game is online, offline, or a replay. Based on: [vJASS] - GameStatus (Replay Detection) GameStatus Events Time - Elapsed game time is 0.00 seconds Conditions Actions -------- Initialize -------- Set GAME_STATUS_OFFLINE = 0...
www.hiveworkshop.com
www.hiveworkshop.com

You can import that and either wrap your cinematics in an if-condition in GUI by checking if GameStatus not equal to GAME_STATUS_REPLAY, or you can edit the function to have something like this at the top (after the line function CinematicModeWithoutChangingFog...):
JASS:
if (udg_GameStatus == udg_GAME_STATUS_REPLAY) then
return
endif

That'll make sure it just returns immediately and doesn't do any of the subsequent code if the user is in a replay. I haven't personally used the system though. Let me know if that works out for you!

I'm not quite sure exactly what your second problem is. Could you elaborate on it more? Your trigger seems fine to me.
 
Last edited:
Level 7
Joined
Feb 13, 2022
Messages
87
If only some players are experiencing a cinematic then you need to use this custom function that @PurgeandFire wrote:

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
One problem with it is it will trigger for players watching the replay. I'm sure there's some way to add a condition to this to prevent spectators? from being 'victim' to this function but I haven't figured it out. So it pretty much renders replays useless.
( Revealing entire map unintended )



I'm not quite sure exactly what your second problem is. Could you elaborate on it more? Your trigger seems fine to me.
Awesome thank you for the reply! The second issue isn't a big deal, so you don't need to help with that one. Do you know how I would type my custom script(the script that calls the Jass code) for when the cinematic is playing? Where in my cinematic trigger should I put the custom script to call for the jass script? Also last question do I need to modify the jass script for my game or for each player group? Sorry for the basic questions, I'm just a bit confused on how to properly implement this into my game, thank you in advance :)!
 

Uncle

Warcraft Moderator
Level 69
Joined
Aug 10, 2018
Messages
7,282
This isn't a solution to your problem but I recommend using local variables in triggers like these. You can save yourself a pretty big headache:
  • Events
    • Player - Player 1 (Red) types a chat message containing -T as An exact match
    • Player - Player 2 (Blue) types a chat message containing -T as An exact match
    • Player - Player 3 (Teal) types a chat message containing -T as An exact match
    • Player - Player 4 (Purple) types a chat message containing -T as An exact match
    • Player - Player 5 (Yellow) types a chat message containing -T as An exact match
    • Player - Player 6 (Orange) types a chat message containing -T as An exact match
  • Conditions
  • Actions
    • Custom script: local player udg_Cinematic_Player = GetTriggerPlayer()
    • Custom script: local force udg_Cinematic_PG = GetForceOfPlayer(GetTriggerPlayer())
    • Cinematic - Fade out over 1.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Wait 1.00 seconds
    • Cinematic - Turn cinematic mode On for Cinematic_Player
    • Environment - Set sky to Dalaran Ruins Sky
    • Camera - Apply Goal Camera <gen> for Cinematic_Player over 0.00 seconds
    • Cinematic - Fade out over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Cinematic - Fade in over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Cinematic - Send transmission to Cinematic_PG from Rat 0107 <gen> named A Friendly Rat: Play No sound and display Your goal as a Rat .... Modify duration: Add 10.00 seconds and Wait
    • Camera - Apply The Power Shop <gen> for Cinematic_Player over 0.00 seconds
    • Cinematic - Fade out over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Cinematic - Fade in over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Cinematic - Send transmission to Cinematic_PG from Rat 0107 <gen> named A Friendly Rat: Play No sound and display Use your Rat Soul p.... Modify duration: Add 5.50 seconds and Wait
    • Camera - Apply Camera Opener <gen> for Cinematic_Player over 0.00 seconds
    • Cinematic - Fade out over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Cinematic - Fade in over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Unit - Order Rat 0106 <gen> to Night Elf Keeper Of The Grove - Tranquility.
    • Cinematic - Send transmission to Cinematic_PG from Rat 0106 <gen> named A Helpful Rat: Play No sound and display When teammates peri.... Modify duration: Add 6.00 seconds and Wait
    • Unit - Order Rat 0106 <gen> to Stop.
    • Camera - Apply Cheese n Shops <gen> for Cinematic_Player over 0.00 seconds
    • Cinematic - Fade out over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Cinematic - Fade in over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Cinematic - Send transmission to Cinematic_PG from Rat 0163 <gen> named A Helpful Rat: Play No sound and display Grab Cheese for gol.... Modify duration: Add 10.00 seconds and Wait
    • Camera - Apply Minigame camera <gen> for Cinematic_Player over 0.00 seconds
    • Cinematic - Fade out over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Cinematic - Fade in over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Cinematic - Send transmission to Cinematic_PG from Rat 0181 <gen> named A Wise Rat: Play No sound and display There are seven bui.... Modify duration: Add 7.50 seconds and Wait
    • Cinematic - Send transmission to Cinematic_PG from Rat 0181 <gen> named A Wise Rat: Play No sound and display Each minigame has d.... Modify duration: Add 6.25 seconds and Wait
    • Camera - Apply Camera Opener <gen> for Cinematic_Player over 0.00 seconds
    • Cinematic - Fade out over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Cinematic - Fade in over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Cinematic - Send transmission to Cinematic_PG from Rat 0106 <gen> named A Helpful Rat: Play No sound and display Check out the quest.... Modify duration: Add 5.00 seconds and Wait
    • Cinematic - Turn cinematic mode Off for Cinematic_PG
    • Selection - Select Rat 0001 <gen> for Cinematic_Player
    • Camera - Pan camera for Cinematic_Player to (Position of Rat 0001 <gen>) over 0.00 seconds
    • Camera - Reset camera for Cinematic_Player to standard game-view over 0.01 seconds
Now the trigger will run for any Player without the need of the If Then Else. If there is a specific Rat for each Player then you can store those in variables as well. Also, your Cinematic - Fade filters are going to apply to everyone unless you wrap them in a GetLocalPlayer() block.

This requires two variables:
Cinematic_Player = Player
Cinematic_PG = Player Group

Edit:
Also, if a Player types -T quick enough they can make this trigger run multiple times at once.
You should have a Boolean that prevents them from running it again:
  • Conditions
    • IsWatchingCinematic[Player number of (Triggering player)] Equal to False
  • Actions
    • Custom script: local player udg_Cinematic_Player = GetTriggerPlayer()
    • Custom script: local force udg_Cinematic_PG = GetForceOfPlayer(GetTriggerPlayer())
    • Set Variable IsWatchingCinematic[Player number of Cinematic_Player] = True
    • // then set it to false at the end of the trigger or keep it true to limit each player to one tutorial viewing per game
    • Set Variable IsWatchingCinematic[Player number of Cinematic_Player] = False
 
Last edited:
Level 19
Joined
Mar 16, 2008
Messages
810
  • Custom script: call CinematicModeWithoutChangingFog(true, udg_PLAYERGROUP_VARIABLE, bj_CINEMODE_INTERFACEFADE)
PurgedandFire's original post explains it well. Click around those posts or just reply if it doesn't make sense.
 
Level 7
Joined
Feb 13, 2022
Messages
87
This isn't a solution to your problem but I recommend using local variables in triggers like these. You can save yourself a pretty big headache:
  • Events
    • Player - Player 1 (Red) types a chat message containing -T as An exact match
    • Player - Player 2 (Blue) types a chat message containing -T as An exact match
    • Player - Player 3 (Teal) types a chat message containing -T as An exact match
    • Player - Player 4 (Purple) types a chat message containing -T as An exact match
    • Player - Player 5 (Yellow) types a chat message containing -T as An exact match
    • Player - Player 6 (Orange) types a chat message containing -T as An exact match
  • Conditions
  • Actions
    • Custom script: local player udg_Cinematic_Player = GetTriggerPlayer()
    • Custom script: local force udg_Cinematic_PG = GetForceOfPlayer(GetTriggerPlayer())
    • Cinematic - Fade out over 1.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Wait 1.00 seconds
    • Cinematic - Turn cinematic mode On for Cinematic_Player
    • Environment - Set sky to Dalaran Ruins Sky
    • Camera - Apply Goal Camera <gen> for Cinematic_Player over 0.00 seconds
    • Cinematic - Fade out over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Cinematic - Fade in over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Cinematic - Send transmission to Cinematic_PG from Rat 0107 <gen> named A Friendly Rat: Play No sound and display Your goal as a Rat .... Modify duration: Add 10.00 seconds and Wait
    • Camera - Apply The Power Shop <gen> for Cinematic_Player over 0.00 seconds
    • Cinematic - Fade out over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Cinematic - Fade in over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Cinematic - Send transmission to Cinematic_PG from Rat 0107 <gen> named A Friendly Rat: Play No sound and display Use your Rat Soul p.... Modify duration: Add 5.50 seconds and Wait
    • Camera - Apply Camera Opener <gen> for Cinematic_Player over 0.00 seconds
    • Cinematic - Fade out over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Cinematic - Fade in over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Unit - Order Rat 0106 <gen> to Night Elf Keeper Of The Grove - Tranquility.
    • Cinematic - Send transmission to Cinematic_PG from Rat 0106 <gen> named A Helpful Rat: Play No sound and display When teammates peri.... Modify duration: Add 6.00 seconds and Wait
    • Unit - Order Rat 0106 <gen> to Stop.
    • Camera - Apply Cheese n Shops <gen> for Cinematic_Player over 0.00 seconds
    • Cinematic - Fade out over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Cinematic - Fade in over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Cinematic - Send transmission to Cinematic_PG from Rat 0163 <gen> named A Helpful Rat: Play No sound and display Grab Cheese for gol.... Modify duration: Add 10.00 seconds and Wait
    • Camera - Apply Minigame camera <gen> for Cinematic_Player over 0.00 seconds
    • Cinematic - Fade out over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Cinematic - Fade in over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Cinematic - Send transmission to Cinematic_PG from Rat 0181 <gen> named A Wise Rat: Play No sound and display There are seven bui.... Modify duration: Add 7.50 seconds and Wait
    • Cinematic - Send transmission to Cinematic_PG from Rat 0181 <gen> named A Wise Rat: Play No sound and display Each minigame has d.... Modify duration: Add 6.25 seconds and Wait
    • Camera - Apply Camera Opener <gen> for Cinematic_Player over 0.00 seconds
    • Cinematic - Fade out over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Cinematic - Fade in over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
    • Cinematic - Send transmission to Cinematic_PG from Rat 0106 <gen> named A Helpful Rat: Play No sound and display Check out the quest.... Modify duration: Add 5.00 seconds and Wait
    • Cinematic - Turn cinematic mode Off for Cinematic_PG
    • Selection - Select Rat 0001 <gen> for Cinematic_Player
    • Camera - Pan camera for Cinematic_Player to (Position of Rat 0001 <gen>) over 0.00 seconds
    • Camera - Reset camera for Cinematic_Player to standard game-view over 0.01 seconds
Now the trigger will run for any Player without the need of the If Then Else. If there is a specific Rat for each Player then you can store those in variables as well. Also, your Cinematic - Fade filters are going to apply to everyone unless you wrap them in a GetLocalPlayer() block.

This requires two variables:
Cinematic_Player = Player
Cinematic_PG = Player Group

Edit:
Also, if a Player types -T quick enough they can make this trigger run multiple times at once.
You should have a Boolean that prevents them from running it again:
  • Conditions
    • IsWatchingCinematic[Player number of (Triggering player)] Equal to False
  • Actions
    • Custom script: local player udg_Cinematic_Player = GetTriggerPlayer()
    • Custom script: local force udg_Cinematic_PG = GetForceOfPlayer(GetTriggerPlayer())
    • Set Variable IsWatchingCinematic[Player number of Cinematic_Player] = True
    • // then set it to false at the end of the trigger or keep it true to limit each player to one tutorial viewing per game
    • Set Variable IsWatchingCinematic[Player number of Cinematic_Player] = False
You're brilliant! Thank you for the advice! I will definitely take you up on how to make this cinematic more efficient! How would I set up the condition and what would I set the variable to when I create it? Thanks again Uncle for the great tip!
 
Last edited:
Level 7
Joined
Feb 13, 2022
Messages
87
You're brilliant! Thank you for the advice! I will definitely take you up on how to make this cinematic more efficient! How would I set up the condition and what would I set the variable to when I create it? Thanks again Uncle for the great tip!
"Also, your Cinematic - Fade filters are going to apply to everyone unless you wrap them in a GetLocalPlayer() block." It would be of the greatest aid to me if you could tell/show me what this looks like inside my current cinematic tutorial trigger?
 

Uncle

Warcraft Moderator
Level 69
Joined
Aug 10, 2018
Messages
7,282
You would do it like this:
  • Custom script: if GetLocalPlayer() == udg_Cinematic_Player then
  • // put actions here
  • Custom script: endif
Note that the shadowing technique that I'm using to make the global variables behave like local variables breaks if you try to reference the local variables in a Condition. However, I think the above will work because it's not using a separate Condition function.
 
Level 7
Joined
Feb 13, 2022
Messages
87
You would do it like this:
  • Custom script: if GetLocalPlayer() == udg_Cinematic_Player then
  • // put actions here
  • Custom script: endif
Note that the shadowing technique that I'm using to make the global variables behave like local variables breaks if you try to reference the local variables in a Condition. However, I think the above will work because it's not using a separate Condition function.
Awesome that does clear some things up! Here is how I currently have the trigger setup. Is this correct for the placement of the custom script for the GetLocalPlayer() block or do i need to place this custom script at the start and end of each instance of the fade in and fade out? Or does the placement look completely different from both of those?
  • TutorialStart
    • Events
      • Player - Player 1 (Red) types a chat message containing -T as An exact match
      • Player - Player 2 (Blue) types a chat message containing -T as An exact match
      • Player - Player 3 (Teal) types a chat message containing -T as An exact match
      • Player - Player 4 (Purple) types a chat message containing -T as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -T as An exact match
      • Player - Player 6 (Orange) types a chat message containing -T as An exact match
    • Conditions
      • ((Triggering unit) is A structure) Equal to True
    • Actions
      • Custom script: local player udg_Cinematic_Player = GetTriggerPlayer()
      • Custom script: local force udg_Cinematic_PG = GetForceOfPlayer(GetTriggerPlayer())
      • Custom script: if GetLocalPlayer() == udg_Cinematic_Player then
      • Cinematic - Fade out over 1.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Wait 1.00 seconds
      • Cinematic - Turn cinematic mode On for Cinematic_PG
      • Environment - Set sky to Dalaran Ruins Sky
      • Camera - Apply Goal Camera <gen> for Cinematic_Player over 0.00 seconds
      • Cinematic - Fade out over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Cinematic - Fade in over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Cinematic - Send transmission to Cinematic_PG from Rat 0107 <gen> named A Friendly Rat: Play No sound and display Your goal as a Rat .... Modify duration: Add 10.00 seconds and Wait
      • Camera - Apply The Power Shop <gen> for Cinematic_Player over 0.00 seconds
      • Cinematic - Fade out over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Cinematic - Fade in over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Cinematic - Send transmission to Cinematic_PG from Rat 0107 <gen> named A Friendly Rat: Play No sound and display Use your Rat Soul p.... Modify duration: Add 5.50 seconds and Wait
      • Camera - Apply Camera Opener <gen> for Cinematic_Player over 0.00 seconds
      • Cinematic - Fade out over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Cinematic - Fade in over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Unit - Order Rat 0106 <gen> to Night Elf Keeper Of The Grove - Tranquility.
      • Cinematic - Send transmission to Cinematic_PG from Rat 0106 <gen> named A Helpful Rat: Play No sound and display When teammates peri.... Modify duration: Add 6.00 seconds and Wait
      • Unit - Order Rat 0106 <gen> to Stop.
      • Camera - Apply Cheese n Shops <gen> for Cinematic_Player over 0.00 seconds
      • Cinematic - Fade out over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Cinematic - Fade in over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Cinematic - Send transmission to Cinematic_PG from Rat 0163 <gen> named A Helpful Rat: Play No sound and display Grab Cheese for gol.... Modify duration: Add 10.00 seconds and Wait
      • Camera - Apply Minigame camera <gen> for Cinematic_Player over 0.00 seconds
      • Cinematic - Fade out over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Cinematic - Fade in over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Cinematic - Send transmission to Cinematic_PG from Rat 0181 <gen> named A Wise Rat: Play No sound and display There are seven bui.... Modify duration: Add 7.50 seconds and Wait
      • Cinematic - Send transmission to Cinematic_PG from Rat 0181 <gen> named A Wise Rat: Play No sound and display Each minigame has d.... Modify duration: Add 6.25 seconds and Wait
      • Camera - Apply Camera Opener <gen> for Cinematic_Player over 0.00 seconds
      • Cinematic - Fade out over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Cinematic - Fade in over 0.25 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Cinematic - Send transmission to Cinematic_PG from Rat 0106 <gen> named A Helpful Rat: Play No sound and display Check out the quest.... Modify duration: Add 5.00 seconds and Wait
      • Cinematic - Turn cinematic mode Off for Cinematic_PG
      • Camera - Reset camera for Cinematic_Player to standard game-view over 0.01 seconds
      • Camera - Pan camera for Cinematic_Player to (Center of Region 230 <gen>) over 0.20 seconds
      • Custom script: endif
I also need help with this condition:
  • IsWatchingCinematic[Player number of (Triggering player)] Equal to False
how do I set it up through the condition settings on this trigger? Finally what do I set the IsWatchingCinematic variable type to? I apologize for all of my basic questions! Thank you Uncle for all of the amazing advice and help you have provided me in general!
 

Uncle

Warcraft Moderator
Level 69
Joined
Aug 10, 2018
Messages
7,282
You do not want to put everything inside of the GetLocalPlayer() script. You want to put just the Cinematic - Filter action(s) inside of it, meaning you'll need to use the Custom Script multiple times throughout the trigger. Your trigger would desync everyone in the game in it's current state. GetLocalPlayer() is only safe with certain Actions that don't need to be synced with other players.

IsWatchingCinematic is a Boolean array variable. Booleans are always True or False and default to False.

You would set that variable to True at the start of the trigger and False at the end of the trigger. But when I say the start of the trigger I mean after the "local" Custom Script actions since local variables always need to come first in a trigger. Also, it should happen before the first Wait action to avoid timing issues.

So to break it down:
When the Event runs, a unique instance of the trigger is created. The game then checks the trigger's Conditions to see if they are all being met. It does this one by one, starting from the top most Condition and working it's way down. If ANY of the Conditions fail then the trigger stops right then and there and nothing else happens. However, if all of the Conditions are met then the game proceeds to the Actions.

In your case the Conditions are asking the question: Is our Boolean array variable equal to False for the given Player? So if it is False then the Actions will run and immediately set the Boolean to True before any Waits happen. This is important since Waits create gaps in time where the Player could cause the trigger to run again. Finally, the Boolean is set to False at the very of the trigger, thus allowing the trigger to run again.

Also, you could keep the Boolean set to True forever which would prevent the Player from ever running the trigger's Actions again.
 
Last edited:
Status
Not open for further replies.
Top