• 🏆 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!

Third Person Cam Help!

Status
Not open for further replies.
Level 2
Joined
Aug 19, 2010
Messages
4
Hello!
I am making a small map just to learn how to make some RPG/FPS triggers and stuff in the data editor. I have learned how to make a inventory and equipment inventory. But now i am trying to make an third person cam and well, it doesnt work so good thats why i ask ofc.:ugly: If someone just could like post a guide or trigger that would make a nice third person cam it would be really helpful. And if you need to know i give +rep
 
Level 17
Joined
Jun 28, 2008
Messages
776
This is what I use, its very simple, but it works.

Initialization

  • Variable - Set TPC_Unit[1] = Marauder [49.29, 64.46]
  • UI - Hide game UI for (All players)
  • Camera - Lock camera mouse relative mode On for player 1
  • Camera - Turn camera mouse rotation On for player 1
  • UI - Enable mouse cursor auto hide for (All players), using a 0.0 second delay for hiding
  • Camera - Apply (Copy of Player Camera) for player 1 over 0.0 seconds with Existing Velocity% initial velocity, 10% deceleration, and Include Target
  • Camera - Follow for player (Owner of TPC_Unit[1]) (Unit group(TPC_Unit[1])) with the camera and Clear Current Target
Timer Event

  • Camera Controlls
    • Events
      • Timer - Every 0.05 seconds of Game Time
    • Local Variables
    • Conditions
    • Actions
      • Player Group - Pick each player in (All players) and do (Actions)
        • Actions
          • General - If (Conditions) then do (Actions) else do (Actions)
            • If
              • (Current camera pitch of player (Picked player)) < 0.0
            • Then
              • Camera - Set Player Camera Angle Of Attack to 0.0
              • Camera - Apply (Copy of Player Camera) for player 1 over 0.0 seconds with Existing Velocity% initial velocity, 10% deceleration, and Include Target
            • Else
and

  • Move Forward
    • Events
      • Timer - Every 0.05 seconds of Real Time
    • Local Variables
      • Temp_Pos = No Point <Point[4]>
    • Conditions
    • Actions
      • General - Pick each integer from 1 to 16, and do (Actions)
        • Actions
          • General - If (Conditions) then do (Actions) else do (Actions)
            • If
              • TPC_Unit[(Picked integer)] != No Unit
            • Then
              • General - If (Conditions) then do (Actions) else do (Actions)
                • If
                  • TPC_Move[(Owner of TPC_Unit[(Picked integer)])] == false
                • Then
                  • Unit - Make TPC_Unit[(Picked integer)] face (Current camera yaw of player (Picked integer)) over 0.0 seconds
                • Else
              • General - If (Conditions) then do (Actions) else do (Actions)
                • If
                  • TPC_Move[(Owner of TPC_Unit[(Picked integer)])] == true
                • Then
                  • Variable - Set Temp_Pos[1] = (Position of TPC_Unit[(Picked integer)])
                  • Variable - Set Temp_Pos[2] = (Temp_Pos[1] offset by 1.0 towards (Current camera yaw of player (Picked integer)) degrees)
                  • Unit - Order TPC_Unit[(Picked integer)] to ( Move targeting Temp_Pos[2]) (Replace Existing Orders)
                • Else
            • Else
Here is a demo map
 

Attachments

  • TPS - NoName.SC2Map
    114.5 KB · Views: 135
Level 2
Joined
Aug 19, 2010
Messages
4
This is what I use, its very simple, but it works.

Initialization

  • Variable - Set TPC_Unit[1] = Marauder [49.29, 64.46]
  • UI - Hide game UI for (All players)
  • Camera - Lock camera mouse relative mode On for player 1
  • Camera - Turn camera mouse rotation On for player 1
  • UI - Enable mouse cursor auto hide for (All players), using a 0.0 second delay for hiding
  • Camera - Apply (Copy of Player Camera) for player 1 over 0.0 seconds with Existing Velocity% initial velocity, 10% deceleration, and Include Target
  • Camera - Follow for player (Owner of TPC_Unit[1]) (Unit group(TPC_Unit[1])) with the camera and Clear Current Target
Timer Event

  • Camera Controlls
    • Events
      • Timer - Every 0.05 seconds of Game Time
    • Local Variables
    • Conditions
    • Actions
      • Player Group - Pick each player in (All players) and do (Actions)
        • Actions
          • General - If (Conditions) then do (Actions) else do (Actions)
            • If
              • (Current camera pitch of player (Picked player)) < 0.0
            • Then
              • Camera - Set Player Camera Angle Of Attack to 0.0
              • Camera - Apply (Copy of Player Camera) for player 1 over 0.0 seconds with Existing Velocity% initial velocity, 10% deceleration, and Include Target
            • Else
and

  • Move Forward
    • Events
      • Timer - Every 0.05 seconds of Real Time
    • Local Variables
      • Temp_Pos = No Point <Point[4]>
    • Conditions
    • Actions
      • General - Pick each integer from 1 to 16, and do (Actions)
        • Actions
          • General - If (Conditions) then do (Actions) else do (Actions)
            • If
              • TPC_Unit[(Picked integer)] != No Unit
            • Then
              • General - If (Conditions) then do (Actions) else do (Actions)
                • If
                  • TPC_Move[(Owner of TPC_Unit[(Picked integer)])] == false
                • Then
                  • Unit - Make TPC_Unit[(Picked integer)] face (Current camera yaw of player (Picked integer)) over 0.0 seconds
                • Else
              • General - If (Conditions) then do (Actions) else do (Actions)
                • If
                  • TPC_Move[(Owner of TPC_Unit[(Picked integer)])] == true
                • Then
                  • Variable - Set Temp_Pos[1] = (Position of TPC_Unit[(Picked integer)])
                  • Variable - Set Temp_Pos[2] = (Temp_Pos[1] offset by 1.0 towards (Current camera yaw of player (Picked integer)) degrees)
                  • Unit - Order TPC_Unit[(Picked integer)] to ( Move targeting Temp_Pos[2]) (Replace Existing Orders)
                • Else
            • Else
Here is a demo map

haha thank you, will check the map out and tomorrow i will (if i think the cam is good) i will make the trigger and ofc give you your +rep! horray for rep :cute: :mwahaha:
 
Status
Not open for further replies.
Top