• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Intro cinematic not playing

Status
Not open for further replies.
Level 5
Joined
Dec 29, 2008
Messages
61
So I managed to make a fairly nice intro cinematic. No problems there. But now I'm trying to show it for all players. I thought I could just use "all players" but it turns out cameras require a specific player input. So I created a player group, assigned player numbers and iterated over the cinematic script. However, it just flat out doesn't play. It does absolutely nothing. What's wrong here? Should I do a Player Group here?

  • Events
    • Time - Elapsed game time is 0.50 seconds
  • Actions
    • Unit Group - Pick every unit in (Units in START <gen> matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Owner of (Picked unit)) slot status) Equal to Is playing
          • Then - Actions
            • Set VariableSet PlayerNumber = (Player number of (Owner of (Picked unit)))
            • Set VariableSet mPlayer[PlayerNumber] = (Owner of mHero[PlayerNumber])
            • -------- Introduction Cinematic --------
            • Cinematic - Turn cinematic mode On for (All players matching ((Owner of (Picked unit)) Equal to mPlayer[PlayerNumber]).)
            • Sound - Clear the music list
            • Sound - Stop music Immediately
            • Sound - Set Ambient Sounds to 0.00%
            • Sound - Set Animation and Spell Sounds to 0.00%
            • Sound - Set Combat Sounds to 0.00%
            • Sound - Set Fire Sounds to 0.00%
            • Sound - Play radiant_dawn_intro <gen>
            • Camera - Set mPlayer[PlayerNumber]'s camera Angle of attack to 330.00 over 0.00 seconds
            • Camera - Set mPlayer[PlayerNumber]'s camera Distance to target to 7000.00 over 0.00 seconds
            • Camera - Pan camera for mPlayer[PlayerNumber] to (Center of ClockTower <gen>) with height 7000.00 above the terrain over 0.00 seconds
            • Wait 1.00 seconds
            • Camera - Set mPlayer[PlayerNumber]'s camera Distance to target to 800.00 over 11.00 seconds
            • Camera - Pan camera for mPlayer[PlayerNumber] to (Center of Amberfall <gen>) with height 800.00 above the terrain over 11.00 seconds
            • Wait 13.00 seconds
            • Camera - Pan camera for mPlayer[PlayerNumber] to (Center of Guard Thomas <gen>) with height 600.00 above the terrain over 11.00 seconds
            • Wait 13.00 seconds
            • Camera - Set mPlayer[PlayerNumber]'s camera Distance to target to 300.00 over 10.00 seconds
            • Camera - Pan camera for mPlayer[PlayerNumber] to (Center of StartingLocCamera <gen>) with height 300.00 above the terrain over 12.00 seconds
            • Wait 15.00 seconds
            • Cinematic - Turn cinematic mode Off for (All players matching ((Owner of (Picked unit)) Equal to mPlayer[PlayerNumber]).)
            • Wait 0.01 seconds
          • Else - Actions
    • Trigger - Run CameraInitialization2 <gen> (ignoring conditions)
And here's my second attempt:
  • Actions
    • Set VariableSet PlayerNumber = 0
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Player((Integer A))) slot status) Equal to Is playing
          • Then - Actions
            • Set VariableSet PlayerNumber = (Integer A)
            • -------- Introduction Cinematic --------
            • Cinematic - Turn cinematic mode On for (Player group((Player((Integer A)))))
            • Sound - Clear the music list
            • Sound - Stop music Immediately
            • Sound - Set Ambient Sounds to 0.00%
            • Sound - Set Animation and Spell Sounds to 0.00%
            • Sound - Set Combat Sounds to 0.00%
            • Sound - Set Fire Sounds to 0.00%
            • Sound - Play radiant_dawn_intro <gen>
            • Camera - Set (Player((Integer A)))'s camera Angle of attack to 330.00 over 0.00 seconds
            • Camera - Set (Player((Integer A)))'s camera Distance to target to 7000.00 over 0.00 seconds
            • Camera - Pan camera for (Player((Integer A))) to (Center of ClockTower <gen>) with height 7000.00 above the terrain over 0.00 seconds
            • Wait 1.00 seconds
            • Camera - Set (Player((Integer A)))'s camera Distance to target to 800.00 over 11.00 seconds
            • Camera - Pan camera for (Player((Integer A))) to (Center of Amberfall <gen>) with height 800.00 above the terrain over 11.00 seconds
            • Wait 13.00 seconds
            • Camera - Pan camera for (Player((Integer A))) to (Center of Guard Thomas <gen>) with height 600.00 above the terrain over 11.00 seconds
            • Wait 13.00 seconds
            • Camera - Set (Player((Integer A)))'s camera Distance to target to 400.00 over 10.00 seconds
            • Camera - Pan camera for (Player((Integer A))) to (Center of StartingLocCamera <gen>) with height 300.00 above the terrain over 12.00 seconds
            • Wait 15.00 seconds
            • Cinematic - Turn cinematic mode Off for (All players)
            • Wait 0.01 seconds
          • Else - Actions
    • Trigger - Run CameraInitialization2 <gen> (ignoring conditions)
This second attempt works. However, I'm not sure why.

Of course, this DOES NOT work on multiplayer. The second player doesn't see the cinematic at all.
 
Last edited:

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,378
You pretty much never want to use Waits within any kind of Loop.

Instead, use the Pick Every Player action to run your Camera actions for each (Picked player):
  • Example
    • Events
      • Time - Elapsed game time is 0.50 seconds
    • Conditions
    • Actions
      • Set VariableSet ActiveUsers = (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)).)
      • Sound - Clear the music list
      • Sound - Stop music Immediately
      • Cinematic - Turn cinematic mode On for (All players)
      • -------- --------
      • Wait 0.00 game-time seconds
      • -------- --------
      • Set VariableSet TempPoint = (Center of a <gen>)
      • Player Group - Pick every player in ActiveUsers and do (Actions)
        • Loop - Actions
          • Camera - Set (Picked player)'s camera Angle of attack to 330.00 over 0.00 seconds
          • Camera - Set (Picked player)'s camera Distance to target to 7000.00 over 0.00 seconds
          • Camera - Pan camera for (Picked player) to TempPoint over 0.00 seconds
      • Custom script: call RemoveLocation(udg_TempPoint)
      • -------- --------
      • Wait 1.00 game-time seconds
      • -------- --------
      • Set VariableSet TempPoint = (Center of b <gen>)
      • Player Group - Pick every player in ActiveUsers and do (Actions)
        • Loop - Actions
          • Camera - Set (Picked player)'s camera Distance to target to 800.00 over 11.00 seconds
          • Camera - Pan camera for (Picked player) to TempPoint with height 800.00 above the terrain over 11.00 seconds
      • Custom script: call RemoveLocation(udg_TempPoint)
      • -------- --------
      • Wait 13.00 game-time seconds
      • -------- --------
      • Set VariableSet TempPoint = (Center of c <gen>)
      • Player Group - Pick every player in ActiveUsers and do (Actions)
        • Loop - Actions
          • Camera - Pan camera for (Picked player) to TempPoint with height 600.00 above the terrain over 11.00 seconds
      • Custom script: call RemoveLocation(udg_TempPoint)
      • -------- --------
      • Wait 13.00 game-time seconds
      • -------- --------
      • Set VariableSet TempPoint = (Center of d <gen>)
      • Player Group - Pick every player in ActiveUsers and do (Actions)
        • Loop - Actions
          • Camera - Set (Picked player)'s camera Distance to target to 400.00 over 10.00 seconds
          • Camera - Pan camera for (Picked player) to TempPoint with height 300.00 above the terrain over 12.00 seconds
      • Custom script: call RemoveLocation(udg_TempPoint)
      • -------- --------
      • Wait 15.00 game-time seconds
      • -------- --------
      • Cinematic - Turn cinematic mode Off for (All players)
      • -------- --------
      • Wait 0.00 game-time seconds
      • -------- --------
      • Trigger - Run Example <gen> (ignoring conditions)
 

Attachments

  • Camera Example 1.w3m
    18 KB · Views: 3
Level 5
Joined
Dec 29, 2008
Messages
61
Set VariableSet ActiveUsers = (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)).)

How do you set two conditions simultaneously in this line?

Edit: Nevermind. I saw the And condition type.

Edit 2: This works!
 
Last edited:

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,378
Ideally, you would set these Player Groups in a different trigger that occurs before everything else, like so:
  • Setup Player Groups
    • Events
      • Time - Elapsed game time is 0.10 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) controller) Equal to User
              • ((Picked player) slot status) Equal to Is playing
            • Then - Actions
              • Player Group - Add (Picked player) to PG_Users
              • Player Group - Add (Picked player) to PG_UsersActive
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked player) controller) Equal to Computer
                • Then - Actions
                  • Player Group - Add (Picked player) to PG_Computers
                • Else - Actions
You can use this to track Users regardless of their current state (PG_Users) and Users that are still actively playing the game (PG_UsersActive).

To make PG_UsersActive work properly you'll need another trigger that removes leaving players from it:
  • Player Leaves
    • Events
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 3 (Teal) leaves the game
    • Conditions
    • Actions
      • -------- The user is no longer actively playing the game so remove them from the active Player Group: --------
      • Player Group - Remove (Triggering player) from PG_UsersActive.
These two triggers enable you great control over all of your Players. Do you want to create a special unit for Users that are still playing the game? Then reference PG_UsersActive. Do you want to Add gold to each User regardless of whether they've left the game or not? Then reference PG_Users. It's also more efficient to use PG_UsersActive whenever possible since you aren't running unnecessary code for leavers.

You can reference these Player Groups in all of your other triggers including the Cinematic one above. Just make sure that the variables are actually setup before using them. Speaking of which, it's important that you don't create the Player Groups during Map Initialization as it can cause a desync, hence why I chose this specific time.
 
Last edited:
Status
Not open for further replies.
Top