Sir_Skurpsalot Posted March 28, 2020 Share Posted March 28, 2020 I noticed setFov changes the fov of both the first and third person cameras. Is there any way to independently change the fov of the first person camera? Thanks for reading. Quote Link to comment Share on other sites More sharing options...
Bloodknight Posted March 29, 2020 Share Posted March 29, 2020 In default.bind.cs you have this bunch of functions and settings.You could add a check in the camera toggle function which I don't think I've posted, or you could check the camera mode inside of the FoV function, i'd probably do the former, but each game is different. //------------------------------------------------------------------------------ // Zoom and FOV functions //------------------------------------------------------------------------------ if($Player::CurrentFOV $= "") $Player::CurrentFOV = $pref::Player::DefaultFOV / 2; // toggleZoomFOV() works by dividing the CurrentFOV by 2. Each time that this // toggle is hit it simply divides the CurrentFOV by 2 once again. If the // FOV is reduced below a certain threshold then it resets to equal half of the // DefaultFOV value. This gives us 4 zoom levels to cycle through. function toggleZoomFOV() { $Player::CurrentFOV = $Player::CurrentFOV / 2; if($Player::CurrentFOV < 5) resetCurrentFOV(); if(ServerConnection.zoomed) setFOV($Player::CurrentFOV); else { setFov(ServerConnection.getControlCameraDefaultFov()); } } function resetCurrentFOV() { $Player::CurrentFOV = ServerConnection.getControlCameraDefaultFov() / 2; } function turnOffZoom() { ServerConnection.zoomed = false; setFov(ServerConnection.getControlCameraDefaultFov()); Reticle.setVisible(true); zoomReticle.setVisible(false); // Rather than just disable the DOF effect, we want to set it to the level's // preset values. //DOFPostEffect.disable(); ppOptionsUpdateDOFSettings(); } function setZoomFOV(%val) { if(%val) toggleZoomFOV(); } function toggleZoom(%val) { if (%val) { ServerConnection.zoomed = true; setFov($Player::CurrentFOV); Reticle.setVisible(false); zoomReticle.setVisible(true); DOFPostEffect.setAutoFocus( true ); DOFPostEffect.setFocusParams( 0.5, 0.5, 50, 500, -5, 5 ); DOFPostEffect.enable(); } else { turnOffZoom(); } } function mouseButtonZoom(%val) { toggleZoom(%val); } moveMap.bind(keyboard, f, setZoomFOV); // f for field of view moveMap.bind(keyboard, z, toggleZoom); // z for zoom moveMap.bind( mouse, button1, mouseButtonZoom ); Quote Link to comment Share on other sites More sharing options...
Duion Posted March 29, 2020 Share Posted March 29, 2020 The problem here is probably, that there is no first or third person camera and there is just a camera, the only difference is the position of the camera.So you could duplicate the camera and call one first person camera and one third person camera and then make the FOV function only change one of those.Another probably not so nice solution is to just reset the FOV if you switch to third person again, you have to test it to see if the lag is tolerable, but the same problem probably exists if you do the other solution.It depends more on your specific scenario, which I don't know about yet, but I can imagine you zoom aim with a gun in first person and you don't like that it also zooms in third person so you don't want that, since I had the similar issue, but ignored it for now. For that scenario you could try blocking the zoom function in the weapon for third person view. Quote Link to comment Share on other sites More sharing options...
Sir_Skurpsalot Posted March 29, 2020 Author Share Posted March 29, 2020 I see, I was afraid that it was just really one camera... Yeah it's aiming related... I should be able to come up with something that just zooms/unzooms you upon toggling cameras then.. thanks. Quote Link to comment Share on other sites More sharing options...
Duion Posted March 29, 2020 Share Posted March 29, 2020 I would reset the FOV when switching to third person, but you may also want to cancel the aiming image state itself, if you don't want to give the player eventual advantages that come from it, like better accuracy etc. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.