• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] Problem with Moving Camera

Status
Not open for further replies.
Level 22
Joined
Feb 3, 2009
Messages
3,292
Hello, so I used to have a trigger which uses the function Pan Camera (Timed).
Whenever I played in multiplayer it disconnected all players whenever the function activated.

I was thinking of re-adding it but first I wanted to ask here how I could solve it to not disconnect the players?
 
Level 22
Joined
Feb 3, 2009
Messages
3,292
Here are the triggers in which the move camera is (happens in all of them):

  • Ar
    • Events
      • Player - Player 1 (Red) types a chat message containing -ar as An exact match
    • Conditions
    • Actions
      • Game - Display to (All players) for 30.00 seconds the text: (|cff + ((Player_Colours[(Player number of (Triggering player))] + (Name of (Triggering player))) + (|r + has selected mode |cff00ffffAll Random|r)))
      • Set Mode = ar
      • 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
              • Unit - Create 1 (Unit-type of (Random unit from PossibleHeroes)) for (Player((Integer A))) at (Center of Heroes <gen>) facing Default building facing degrees
              • Set Heroes[(Player number of (Player((Integer A))))] = (Last created unit)
              • Unit - Move Heroes[(Player number of (Player((Integer A))))] instantly to (Center of Region 056 <gen>)
              • Set TempHeroLoc = (Position of Heroes[(Player number of (Player((Integer A))))])
              • Camera - Pan camera as necessary for (Player((Player number of (Player((Integer A)))))) to TempHeroLoc over 0.50 seconds
              • Custom script: call RemoveLocation(udg_TempHeroLoc)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • RepickInt[(Player number of (Owner of (Triggering unit)))] Equal to 0
                • Then - Actions
                  • Game - Display to (All players) for 15.00 seconds the text: (|cff + ((Player_Colours[(Player number of (Player((Integer A))))] + (Name of (Player((Integer A))))) + (|r + ( has repicked into |cff0080ff + ((Name of (Last created unit)) + |r)))))
                • Else - Actions
                  • Game - Display to (All players) for 15.00 seconds the text: (|cff + ((Player_Colours[(Player number of (Player((Integer A))))] + (Name of (Player((Integer A))))) + (|r + ( has randomed |cff0080ff + ((Name of (Last created unit)) + |r)))))
              • Unit Group - Pick every unit in (Units owned by (Player((Integer A))) of type ) and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
              • Custom script: call DestroyGroup(bj_lastCreatedGroup)
              • Custom script: if GetLocalPlayer() == Player(GetForLoopIndexA() - 1) then
              • Visibility - Destroy VisionMod
              • Unit - Hide Inteligence Heroes 0259 <gen>
              • Unit - Hide Agility Heroes 0213 <gen>
              • Unit - Hide Strength Heroes 0260 <gen>
              • Trigger - Turn off Choose Hero <gen>
              • Trigger - Turn off Ap <gen>
              • Trigger - Turn off Ar <gen>
              • Custom script: endif
            • Else - Actions
      • Trigger - Turn off Ap <gen>
      • Trigger - Turn off (This trigger)
      • Trigger - Turn off Default <gen>
  • Choose Hero
    • Events
      • Unit - A unit enters Heroes <gen>
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Triggering unit) is A Hero) Equal to True
          • (Owner of (Triggering unit)) Not equal to Neutral Hostile
          • Mode Equal to ap
          • RandomInt[(Player number of (Owner of (Triggering unit)))] Equal to 1
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RepickInt[(Player number of (Owner of (Triggering unit)))] Equal to 0
        • Then - Actions
          • Game - Display to (All players) for 15.00 seconds the text: (|cff + ((Player_Colours[(Player number of (Owner of (Triggering unit)))] + (Name of (Owner of (Triggering unit)))) + (|r + ( has repicked into |cff0080ff + ((Name of (Triggering unit)) + |r)))))
        • Else - Actions
          • Game - Display to (All players) for 15.00 seconds the text: (|cff + ((Player_Colours[(Player number of (Owner of (Triggering unit)))] + (Name of (Owner of (Triggering unit)))) + (|r + ( has picked |cff0080ff + ((Name of (Triggering unit)) + |r)))))
      • Set Heroes[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
      • Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) of type ) and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Custom script: call DestroyGroup(bj_lastCreatedGroup)
      • Unit - Move (Triggering unit) instantly to (Center of Region 056 <gen>)
      • Set TempHeroLoc = (Position of (Triggering unit))
      • Camera - Pan camera as necessary for (Owner of (Triggering unit)) to TempHeroLoc over 0.50 seconds
      • Custom script: call RemoveLocation(udg_TempHeroLoc)
      • Custom script: if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then
      • Visibility - Destroy VisionMod
      • Unit - Hide Inteligence Heroes 0259 <gen>
      • Unit - Hide Agility Heroes 0213 <gen>
      • Unit - Hide Strength Heroes 0260 <gen>
      • Trigger - Turn off Choose Hero <gen>
      • Trigger - Turn off Ap <gen>
      • Trigger - Turn off Ar <gen>
      • Custom script: endif
  • Random
    • Events
      • Player - Player 1 (Red) types a chat message containing -random as An exact match
      • Player - Player 2 (Blue) types a chat message containing -random as An exact match
      • Player - Player 3 (Teal) types a chat message containing -random as An exact match
      • Player - Player 4 (Purple) types a chat message containing -random as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -random as An exact match
      • Player - Player 6 (Orange) types a chat message containing -random as An exact match
      • Player - Player 7 (Green) types a chat message containing -random as An exact match
      • Player - Player 8 (Pink) types a chat message containing -random as An exact match
      • Player - Player 9 (Gray) types a chat message containing -random as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -random as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -random as An exact match
      • Player - Player 12 (Brown) types a chat message containing -random as An exact match
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RandomInt[(Player number of (Triggering player))] Equal to 1
        • Then - Actions
          • Trigger - Turn on Choose Hero <gen>
          • Set RandomInt[(Player number of (Triggering player))] = 0
          • Unit - Create 1 (Unit-type of (Random unit from PossibleHeroes)) for (Triggering player) at (Center of Heroes <gen>) facing Default building facing degrees
          • Set Heroes[(Player number of (Triggering player))] = (Last created unit)
          • Unit - Move Heroes[(Player number of (Triggering player))] instantly to (Center of Region 056 <gen>)
          • Set TempHeroLoc = (Position of Heroes[(Player number of (Triggering player))])
          • Camera - Pan camera as necessary for (Triggering player) to TempHeroLoc over 0.50 seconds
          • Custom script: call RemoveLocation(udg_TempHeroLoc)
          • Visibility - Create an initially Disabled visibility modifier for (Triggering player) emitting Visibility across Heroes <gen>
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RepickInt[(Player number of (Owner of (Triggering unit)))] Equal to 0
            • Then - Actions
              • Game - Display to (All players) for 15.00 seconds the text: (|cff + ((Player_Colours[(Player number of (Triggering player))] + (Name of (Triggering player))) + (|r + ( has repicked into |cff0080ff + ((Name of (Last created unit)) + |r)))))
            • Else - Actions
              • Game - Display to (All players) for 15.00 seconds the text: (|cff + ((Player_Colours[(Player number of (Triggering player))] + (Name of (Triggering player))) + (|r + ( has randomed |cff0080ff + ((Name of (Last created unit)) + |r)))))
          • Unit Group - Pick every unit in (Units owned by (Triggering player) of type ) and do (Actions)
            • Loop - Actions
              • Unit - Remove (Picked unit) from the game
          • Custom script: call DestroyGroup(bj_lastCreatedGroup)
          • Custom script: if GetLocalPlayer() == GetTriggerPlayer() then
          • Visibility - Destroy VisionMod
          • Unit - Remove Inteligence Heroes 0259 <gen> from the game
          • Unit - Remove Agility Heroes 0213 <gen> from the game
          • Unit - Remove Strength Heroes 0260 <gen> from the game
          • Trigger - Turn off Choose Hero <gen>
          • Trigger - Turn off Ap <gen>
          • Trigger - Turn off Ar <gen>
          • Custom script: endif
        • Else - Actions
  • Repick
    • Events
      • Player - Player 1 (Red) types a chat message containing -repick as An exact match
      • Player - Player 2 (Blue) types a chat message containing -repick as An exact match
      • Player - Player 3 (Teal) types a chat message containing -repick as An exact match
      • Player - Player 4 (Purple) types a chat message containing -repick as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -repick as An exact match
      • Player - Player 6 (Orange) types a chat message containing -repick as An exact match
      • Player - Player 7 (Green) types a chat message containing -repick as An exact match
      • Player - Player 8 (Pink) types a chat message containing -repick as An exact match
      • Player - Player 9 (Gray) types a chat message containing -repick as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -repick as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -repick as An exact match
      • Player - Player 12 (Brown) types a chat message containing -repick as An exact match
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) Current lumber) Less than 1
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RepickInt[(Player number of (Triggering player))] Equal to 1
            • Then - Actions
              • Trigger - Turn on Choose Hero <gen>
              • Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
              • Custom script: call DestroyGroup(bj_lastCreatedGroup)
              • Unit - Create 1 for (Triggering player) at (Center of Heroes <gen>) facing Default building facing degrees
              • Set TempHeroLoc = (Position of (Last created unit))
              • Camera - Pan camera as necessary for (Triggering player) to TempHeroLoc over 0.50 seconds
              • Custom script: call RemoveLocation(udg_TempHeroLoc)
              • Set RandomInt[(Player number of (Triggering player))] = 1
              • Set RepickInt[(Player number of (Triggering player))] = 0
              • Trigger - Run Random <gen> (checking conditions)
            • Else - Actions
        • Else - Actions
          • Game - Display to (Player group((Triggering player))) for 15.00 seconds the text: |cffff0000Too late ...
 
Last edited:
Level 17
Joined
Apr 27, 2008
Messages
2,455
First, second and third triggers, you hide units with GetLocalPlayer and turn off triggers, even if maybe it could be safe because you do it for all human players ( 1 to 12).
Also maybe destroy a visibility isn't safe with GetLocalPlayer, in general creating/destructing handles cause a desync in a local bloc.
 
Status
Not open for further replies.
Top