Lord
TH.net Regular
- Reaction score
- 18
Everyone needs help sometimes, and I'm a Unit of Group - Everyone. Well, my problem is this:
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
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