Skip to content
  • 0 Unread 0
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse

Plutonium

  1. Home
  2. MW3 Modding Support & Discussion
  3. Draw the crosshair when in third person with cg_thirdPerson

Draw the crosshair when in third person with cg_thirdPerson

Scheduled Pinned Locked Moved MW3 Modding Support & Discussion
6 Posts 3 Posters 3.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Resxtundefined Offline
    Resxtundefined Offline
    Resxt
    Plutonium Staff
    wrote on last edited by Resxt
    #1

    Hello,

    So I'm trying to add toggle-able third person on my server and with the help of several people on the Discord I got it to work but my only issue is that before I was using camera_thirdPerson 1 to set everyone in third person because it allowed me to keep the crosshair on screen.

    From what I understood camera_thirdPerson is not a client dvar so I have to use cg_thirdPerson instead but it takes away the crosshair for both normal state and aiming.

    I checked and both cg_drawCrosshair and ui_drawCrosshair are set to 1.

    Below are screenshots of what I have with camera_thirdPerson that I would like to replicate with cg_thirdPerson either for both normal and aiming states or even better: only when aiming.

    45e7da55-487a-4385-97eb-fe600d815296-image.png

    86cabbd4-9ce1-4355-9050-ab94c19c9b40-image.png

    1 Reply Last reply
    0
    • FutureRaveundefined Offline
      FutureRaveundefined Offline
      FutureRave
      VIP
      wrote on last edited by FutureRave
      #2

      camera_thirdPerson's value is propagated by the server to all connecting clients, it is cheat protected and has another flag I don't know about.
      It's a dvar shared by both game and the server. So I guess it depends what's your definition of client dvar, but I would consider it one.
      So, by all means, camera_thirdPerson is good to use because you just need to change it server-side and its value will be updated to all clients.
      Since it's cheat protected it will be reset to its original value once a client disconnects from your server so you don't have to worry about messing with client config. So if the reason for not using camera_thirdPerson was because you thought it was not a client dvar, now you know.

      GerardS0406undefined Resxtundefined 2 Replies Last reply
      0
      • FutureRaveundefined FutureRave

        camera_thirdPerson's value is propagated by the server to all connecting clients, it is cheat protected and has another flag I don't know about.
        It's a dvar shared by both game and the server. So I guess it depends what's your definition of client dvar, but I would consider it one.
        So, by all means, camera_thirdPerson is good to use because you just need to change it server-side and its value will be updated to all clients.
        Since it's cheat protected it will be reset to its original value once a client disconnects from your server so you don't have to worry about messing with client config. So if the reason for not using camera_thirdPerson was because you thought it was not a client dvar, now you know.

        GerardS0406undefined Offline
        GerardS0406undefined Offline
        GerardS0406
        VIP
        wrote on last edited by
        #3

        Premake5 client means each client can change it themselves. Therefore camera_thirdPerson would not work. As for getting this done, I know for a fact it can’t be done in bo2, so in mw3, i would feel the same. However I dont work with mw3 so idk haha

        1 Reply Last reply
        0
        • FutureRaveundefined FutureRave

          camera_thirdPerson's value is propagated by the server to all connecting clients, it is cheat protected and has another flag I don't know about.
          It's a dvar shared by both game and the server. So I guess it depends what's your definition of client dvar, but I would consider it one.
          So, by all means, camera_thirdPerson is good to use because you just need to change it server-side and its value will be updated to all clients.
          Since it's cheat protected it will be reset to its original value once a client disconnects from your server so you don't have to worry about messing with client config. So if the reason for not using camera_thirdPerson was because you thought it was not a client dvar, now you know.

          Resxtundefined Offline
          Resxtundefined Offline
          Resxt
          Plutonium Staff
          wrote on last edited by Resxt
          #4

          Premake5 I'm not 100% sure I explained it right or if I misunderstand what you're saying.
          I want each player to be in third person by default and to be able to switch his own camera and only his camera to first person by pressing a button.

          With cg_thirdPerson the script below works fine but with camera_thirdPerson it doesn't work.
          It's a server/global dvar so it doesn't work and to my understanding removing self would override the dvar for every player on the server
          68a9fa65-21ff-4104-84c7-fe0c87291308-image.png

          fun_buttonPressed2(button)
          {
              self endon("disconnect");
              level endon("game_ended");
          
              self notifyOnPlayerCommand("third_person_button", button);
              while(1)
              {
                  self waittill("third_person_button");
          	   isInThirdPerson = GetDvar( "camera_thirdPerson" );
                     self iprintlnbold(isInThirdPerson);
          	   if (isInThirdPerson == "0")
          	   {
          		self SetClientDvar("camera_thirdPerson", "1");
          	   }
          	   else if (isInThirdPerson == "1")
          	   {
          		self SetClientDvar("camera_thirdPerson", "0");
          	   }
          
                     wait(1);
              }
          }
          
          1 Reply Last reply
          0
          • FutureRaveundefined Offline
            FutureRaveundefined Offline
            FutureRave
            VIP
            wrote on last edited by FutureRave
            #5

            If the crosshair is disabled by that dvar then I suggest you find in the game's code where the cross hair is supposed to be rendered and force it to always render. It's not impossible, just difficult.

            1 Reply Last reply
            0
            • Resxtundefined Offline
              Resxtundefined Offline
              Resxt
              Plutonium Staff
              wrote on last edited by Resxt
              #6

              Since this is a global dvar and I really want to keep the camera this way I decided to make a vote system on my server instead so that players can choose which camera they want at any time in the game
              If anyone is interested in this see my Github

              1 Reply Last reply
              0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Unread 0
              • Recent
              • Tags
              • Popular
              • Users
              • Groups