3rd Person Camera Help - How to Reset Camera?

Lord

TH.net Regular
Reaction score
18
Everyone needs help sometimes, and I'm a Unit of Group - Everyone. Well, my problem is this:

Code:
Periodic Adjustment
    Events
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Set NumUnitsSelected = (Number of units in (Units owned by (Picked player) matching (((Matching unit) is selected by (Picked player)) Equal to True)))
                Game - Display to (All players) for 1.00 seconds the text: (numselected:  + (String(NumUnitsSelected)))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        NumUnitsSelected Equal to 1
                    Then - Actions
                        Set CameraTarget = (Random unit from (Units owned by (Picked player) matching (((Matching unit) is selected by (Picked player)) Equal to True)))
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        CameraTarget Equal to No unit
                    Then - Actions
                        Skip remaining actions
                    Else - Actions
                Camera - Pan camera for (Picked player) to (Position of CameraTarget) over 1.00 seconds
                Camera - Lock camera target for (Picked player) to CameraTarget, offset by (0.00, 0.00) using Default rotation
                Camera - Set (Picked player)'s camera Distance to target to 1100.00 over 0.75 seconds
                Camera - Set (Picked player)'s camera Angle of attack to -20.00 over 0.75 seconds
                Camera - Set (Picked player)'s camera Rotation to (Facing of CameraTarget) over 0.75 seconds
        Wait 0.50 seconds
        Trigger - Run (This trigger) (checking conditions)

As you can see, it's Darg's 3rd person cam trig. A very short, simple and (I hope) leakless system. It works cool in game, but it has a small defect. We start the game in normal cam view. If I select a unit, the camera will switch into a 3rd cam view. It's cool, but what if I wanna reset my cammie to normal mode? I tell ya. Nothing. So lets get to the point, I need a trig which makes the camera reset if I deselect my currently selected unit. It would be very important for me to make this, so if you can please help (+rep for HeLpAs). Thanks in advance!

Lord
 
Reaction score
456
Code:
Camera - Reset camera for Player 1 (Red) to standard game-view over 0.00 seconds

That maybe? :p
 

Lord

TH.net Regular
Reaction score
18
Buddy

It's cool, but what if I wanna reset my cammie to normal mode? I tell ya. Nothing.
This system won't allow me to do that. It forces the camera to stay in 3rd view. I can use that trig, but nothing will happen. Already tried.
 
Reaction score
456
Well.. When are you trying to reset the camera? And when is this trigger ran?
 

Lord

TH.net Regular
Reaction score
18
I use this:

Code:
des
    Events
        Player - Player 1 (Red) types a chat message containing -des as An exact match
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                Selection - Remove (Picked unit) from selection for Player 1 (Red)
                Camera - Reset camera for Player 1 (Red) to standard game-view over 0.00 seconds
                Camera - Stop the camera for Player 1 (Red)
 

Chocobo

White-Flower
Reaction score
409
Code:
Periodic Adjustment
    Events
    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
                        boolean[(Player number of (Picked Player))] Equal to True
                    Then - Actions
                        [COLOR="Red"]//no actions[/COLOR]
                    Else - Actions
                Set NumUnitsSelected = (Number of units in (Units owned by (Picked player) matching (((Matching unit) is selected by (Picked player)) Equal to True)))
                Game - Display to (All players) for 1.00 seconds the text: (numselected:  + (String(NumUnitsSelected)))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        NumUnitsSelected Equal to 1
                    Then - Actions
                        Set CameraTarget = (Random unit from (Units owned by (Picked player) matching (((Matching unit) is selected by (Picked player)) Equal to True)))
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        CameraTarget Equal to No unit
                    Then - Actions
                        Skip remaining actions
                    Else - Actions
                Camera - Pan camera for (Picked player) to (Position of CameraTarget) over 1.00 seconds
                Camera - Lock camera target for (Picked player) to CameraTarget, offset by (0.00, 0.00) using Default rotation
                Camera - Set (Picked player)'s camera Distance to target to 1100.00 over 0.75 seconds
                Camera - Set (Picked player)'s camera Angle of attack to -20.00 over 0.75 seconds
                Camera - Set (Picked player)'s camera Rotation to (Facing of CameraTarget) over 0.75 seconds
        Wait 0.50 seconds
        Trigger - Run (This trigger) (checking conditions)

Code:
des
    Events
        Player - Player 1 (Red) types a chat message containing -des as An exact match
        Player - Player 2 (Blue) types a chat message containing -des as An exact match
        Player - Player 3 (Teal) types a chat message containing -des as An exact match
    Conditions
    Actions
        Set boolean[(Player number of (Triggering player))] = True
        Custom script:   set bj_wantDestroyGroup=true
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                Selection - Remove (Picked unit) from selection for (Triggering player)
                Camera - Reset camera for (Triggering player) to standard game-view over 0.00 seconds

Code:
undes
    Events
        Player - Player 1 (Red) types a chat message containing -undes as An exact match
        Player - Player 2 (Blue) types a chat message containing -undes as An exact match
        Player - Player 3 (Teal) types a chat message containing -undes as An exact match
    Conditions
    Actions
        Set boolean[(Player number of (Triggering player))] = False
 

Lord

TH.net Regular
Reaction score
18
Ehh thanks Chocobo, but you misunderstood me.

Code:
Player - Player 1 (Red) types a chat message containing -des as An exact match

I don't want this to be the event. It's just a test thing for me to see what happens if I deselect a unit. I want to make it so if I deselect the unit the camera stops following it and resets to nomal view. Using a "Player deselects a unit"-like event.


Überplayer. I can't disable it coz I want it to work for all players in game. It's not for a single player map.
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
Alrighty, just follow this:

Code:
Untitled Trigger 001
    Events
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Set Group = (Units currently selected by (Player((Integer A))))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of units in Group) Not equal to 0
                    Then - Actions
                        // Your actions
                    Else - Actions
                Custom script:   call DestroyGroup(udg_Group)
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
My bad:

Code:
Untitled Trigger 001
    Events
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Set Group = (Units currently selected by ([B]Picked player[/B]))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of units in Group) Not equal to 0
                    Then - Actions
                        // Your actions
                    Else - Actions
                Custom script:   call DestroyGroup(udg_Group)
 

Lord

TH.net Regular
Reaction score
18
Something isn't good. Here are the trigs I have now:

Code:
Periodic Adjustment
    Events
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Set NumUnitsSelected = (Number of units in (Units owned by (Picked player) matching (((Matching unit) is selected by (Picked player)) Equal to True)))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        NumUnitsSelected Equal to 1
                    Then - Actions
                        Set CameraTarget = (Random unit from (Units owned by (Picked player) matching (((Matching unit) is selected by (Picked player)) Equal to True)))
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        CameraTarget Equal to No unit
                    Then - Actions
                        Skip remaining actions
                    Else - Actions
                Camera - Pan camera for (Picked player) to (Position of CameraTarget) over 1.00 seconds
                Camera - Lock camera target for (Picked player) to CameraTarget, offset by (0.00, 0.00) using Default rotation
                Camera - Set (Picked player)'s camera Distance to target to 700.00 over 1.00 seconds
                Camera - Set (Picked player)'s camera Angle of attack to -20.00 over 1.00 seconds
                Camera - Set (Picked player)'s camera Rotation to (Facing of CameraTarget) over 1.00 seconds
        Wait 0.50 seconds
        Trigger - Run (This trigger) (checking conditions)

Code:
Deselection
    Events
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Set Group = (Units currently selected by (Picked player))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of units in Group) Not equal to 0
                    Then - Actions
                        Camera - Reset camera for (Picked player) to standard game-view over 0.00 seconds
                    Else - Actions
                        Custom script:   call DestroyGroup(udg_Group)

The problem is with the camera again. If I deselect it still remains locked on the last controlled unit.
 

Guest3z

New Member
Reaction score
22
Code:
If - Conditions
     CameraTarget Equal to No unit
Then - Actions
     Skip remaining actions
Did you ever set CameraTarget to no unit? Cuz if not won't it just keep repeating?
 

Lord

TH.net Regular
Reaction score
18
Thx for the help buddies, but I've found an easier way to do things. +rep for all who helped!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top