System Third Person View (Another)

Squishy

You can change this now in User CP.
Reaction score
127
After seeing some of other Third Person Cameras, I wanted to make my own. So here it is.

Features:
- The Up and Down arrow keys adjust the Angle of Attack
- The Left and Right arrow keys adjust the Rotation
- The Camera snaps back to normal and releasing the Left or Right Arrow key
- The mouse wheel adjusts the zoom
- The Escape Key toggles the Third Person Camera on/off

Pros:
- Easily adjustable in-game
- No text commands

Cons:
- Inefficient (It's in GUI)
- High Terrain causes problems

Triggers:
Code:
Camera Initalization
    Events
        Map initialization
    Conditions
    Actions
        For each (Integer A) from 1 to 16, do (Actions)
            Loop - Actions
                Trigger - Add to Set Camera Unit <gen> the event (Player - (Player((Integer A))) Selects a unit)
                Trigger - Add to Toggle Camera <gen> the event (Player - (Player((Integer A))) skips a cinematic sequence)
                Trigger - Add to Left Pressed <gen> the event (Player - (Player((Integer A))) Presses the Left Arrow key)
                Trigger - Add to Right Pressed <gen> the event (Player - (Player((Integer A))) Presses the Right Arrow key)
                Trigger - Add to Down Pressed <gen> the event (Player - (Player((Integer A))) Presses the Down Arrow key)
                Trigger - Add to Up Pressed <gen> the event (Player - (Player((Integer A))) Presses the Up Arrow key)
                Trigger - Add to Left Released <gen> the event (Player - (Player((Integer A))) Releases the Left Arrow key)
                Trigger - Add to Right Released <gen> the event (Player - (Player((Integer A))) Releases the Right Arrow key)
                Trigger - Add to Down Released <gen> the event (Player - (Player((Integer A))) Releases the Down Arrow key)
                Trigger - Add to Up Released <gen> the event (Player - (Player((Integer A))) Releases the Up Arrow key)
Code:
Set Camera Unit
    Events
    Conditions
    Actions
        Set Camera_Unit[(Player number of (Triggering player))] = (Triggering unit)
Code:
Toggle Camera
    Events
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Camera_On[(Player number of (Triggering player))] Equal to True
            Then - Actions
                Set Camera_On[(Player number of (Triggering player))] = False
                Camera - Reset camera for (Triggering player) to standard game-view over 0.00 seconds
            Else - Actions
                Set Camera_On[(Player number of (Triggering player))] = True
                Set Camera_Rotation[(Player number of (Triggering player))] = 90.00
Code:
Change Camera
    Events
        Time - Every 0.02 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 16, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Camera_On[(Integer A)] Equal to True
                    Then - Actions
                        Set Temp_Point = (Position of Camera_Unit[(Integer A)])
                        Camera - Pan camera for (Owner of Camera_Unit[(Integer A)]) to Temp_Point over 0.00 seconds
                        Camera - Rotate camera ((Facing of Camera_Unit[(Integer A)]) - Camera_Rotation[(Integer A)]) degrees around Temp_Point for (Owner of Camera_Unit[(Integer A)]) over 0.00 seconds
                        Camera - Set (Owner of Camera_Unit[(Integer A)])'s camera Angle of attack to Camera_AoA[(Integer A)] over 0.00 seconds
                        Custom script:   call RemoveLocation (udg_Temp_Point)
                    Else - Actions
Code:
Modify Rotation
    Events
        Time - Every 0.02 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 16, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Camera_On[(Integer A)] Equal to True
                    Then - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Left_Pressed[(Integer A)] Equal to True
                                Right_Pressed[(Integer A)] Equal to False
                            Then - Actions
                                Set Camera_Rotation[(Integer A)] = (Camera_Rotation[(Integer A)] + 3.00)
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        Camera_Rotation[(Integer A)] Greater than 269.00
                                    Then - Actions
                                        Set Camera_Rotation[(Integer A)] = -90.00
                                    Else - Actions
                            Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Right_Pressed[(Integer A)] Equal to True
                                Left_Pressed[(Integer A)] Equal to False
                            Then - Actions
                                Set Camera_Rotation[(Integer A)] = (Camera_Rotation[(Integer A)] - 3.00)
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        Camera_Rotation[(Integer A)] Less than -89.00
                                    Then - Actions
                                        Set Camera_Rotation[(Integer A)] = 270.00
                                    Else - Actions
                            Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Right_Pressed[(Integer A)] Equal to False
                                Left_Pressed[(Integer A)] Equal to False
                                Camera_Rotation[(Integer A)] Not equal to 90.00
                            Then - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        Camera_Rotation[(Integer A)] Greater than 84.00
                                        Camera_Rotation[(Integer A)] Less than 96.00
                                    Then - Actions
                                        Set Camera_Rotation[(Integer A)] = 90.00
                                    Else - Actions
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                Camera_Rotation[(Integer A)] Greater than 90.00
                                            Then - Actions
                                                Set Camera_Rotation[(Integer A)] = (Camera_Rotation[(Integer A)] - 6.00)
                                            Else - Actions
                                                Set Camera_Rotation[(Integer A)] = (Camera_Rotation[(Integer A)] + 6.00)
                            Else - Actions
                    Else - Actions
Code:
Modify AoA
    Events
        Time - Every 0.02 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 16, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Camera_On[(Integer A)] Equal to True
                    Then - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Up_Pressed[(Integer A)] Equal to True
                                Down_Pressed[(Integer A)] Equal to False
                                Camera_AoA[(Integer A)] Greater than -80.00
                            Then - Actions
                                Set Camera_AoA[(Integer A)] = (Camera_AoA[(Integer A)] - 1.50)
                            Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Up_Pressed[(Integer A)] Equal to False
                                Down_Pressed[(Integer A)] Equal to True
                                Camera_AoA[(Integer A)] Less than -10.00
                            Then - Actions
                                Set Camera_AoA[(Integer A)] = (Camera_AoA[(Integer A)] + 1.50)
                            Else - Actions
                    Else - Actions
Code:
Left Pressed
    Events
    Conditions
    Actions
        Set Left_Pressed[(Player number of (Triggering player))] = True
Code:
Right Pressed
    Events
    Conditions
    Actions
        Set Right_Pressed[(Player number of (Triggering player))] = True
Code:
Down Pressed
    Events
    Conditions
    Actions
        Set Down_Pressed[(Player number of (Triggering player))] = True
Code:
Up Pressed
    Events
    Conditions
    Actions
        Set Up_Pressed[(Player number of (Triggering player))] = True
Code:
Left Released
    Events
    Conditions
    Actions
        Set Left_Pressed[(Player number of (Triggering player))] = False
Code:
Right Released
    Events
    Conditions
    Actions
        Set Right_Pressed[(Player number of (Triggering player))] = False
Code:
Down Released
    Events
    Conditions
    Actions
        Set Down_Pressed[(Player number of (Triggering player))] = False
Code:
Up Released
    Events
    Conditions
    Actions
        Set Up_Pressed[(Player number of (Triggering player))] = False
 

Attachments

  • Third Person View.w3x
    21.3 KB · Views: 342

XxShadyxX

I abused the rep system.
Reaction score
81
Good system different from all the others. looks well done. Haven't tested it yet but does it have to snap back to normal? it will seem kinda annoying? Maybe I guess depends on what other people like.

Anyway really good well dont system. +rep
Also you should make a JASS version if you can :)
 

Squishy

You can change this now in User CP.
Reaction score
127
Thanks for the +rep :).The camera doesn't have to snap back to normal, you could take that out if you modified the code. I prefer it snapping back to normal, because I find it annoying when you rotate the camera to the side, and your stuck looking at the unit from the side until you move the camera back. I would make a JASS version, but I still haven't gotten around to learning it.
 

Leazy

You can change this now in User CP.
Reaction score
50
This is the best third person camera I ever tested :)

+rep
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
"Made in gui" choice your side but it can't be in cons and pros :p
Honestly it's really inefficient.
Test it with 12 players and cry.

Not really your fault but gui is so far poorly coded for short periodic like that.
 

Squishy

You can change this now in User CP.
Reaction score
127
Ok, I modified the first post. And when I get around to learning JASS, I'll write a JASS version if anyone would find it useful.
 

Kazuga

Let the game begin...
Reaction score
110
Add screenies? Also a small question, does it follow the unit's height for example if you walk up on a mountain?
 

Squishy

You can change this now in User CP.
Reaction score
127
I'm on vacation right now, so I can't do anything Warcraft related right now. When I get back, I'll add some screenies and submit an updated version.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Don't know for the "invented" part, but, either way, my personal recommendation would go to a JASS based system.
If nothing else, it's extremely easy to import, and it has no problems with 12 players or terrain height.


As for approving this:
- has anyone actually tested it?
- does it work with non-flat terrain?
- is it still usable with 12 players?
- any settings I can change? Like distance, default angle, ...
- why does it include the Neutrals?
 

Viikuna

No Marlo no game.
Reaction score
265
Don't know for the "invented" part
Well, neither do I, I jus repeated what he said. I just felt like posting that, because that function is best I have ever seen. ( I too had problems with Terrain Z height and Camera Z , before I found that awesome function. )
 

nemesispoi

New Member
Reaction score
5
how do you get the camera right up behind the unit because this one is farther away from teh unit
 

Joker(Div)

Always Here..
Reaction score
86
Let me put it into real-life terms. Say there was a car that had 30 mpg. Then someone else designs an almost identical car that has 20 mpg. Why would you take the 20 mpg when theres a car thats almost the same with 30?
 

Wolfchant666

New Member
Reaction score
0
Well, i tried to import the Third Camera View for my Scenario, and everything worked so far, but:
I can't activate multiple functions after importing it.
For example in "Change Camera" the trigger
"Camera - Set(owner of Camera_Unit[(Integer A)])'s camera perspective to Camera_AoA[(Integer A)] over 0.00 seconds"
It's just outputting the message "The function can't be activated"
Hope somebody can help me

Wolfchant
 

Lupo

New Member
Reaction score
0
Yeah, I have no idea how to get this to work either. Almost all the triggers have say they cant be activated, I made the variables exactly the same on my map and that helped with a few of them, but I don't know what to do with the rest of the triggers. Im super new to this is pretty much my problem. Any help would be awesome.

Thanks!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top