### Adding FOV Slider to Options

Scripts and codes that enhances or changes the GUI in the engine.

#### Adding FOV Slider to Options

Jason Campbell
Posts: 204
Joined: Fri Feb 13, 2015 2:51 am

Not much of a resource but it seems that some players want this option and I've seen some complaints, 'Why no FOV options?'

Anyway it's real simple and only really adds the ability to raise the FOV, 9 above it's default from 65 to 74. It's 74 because any further and you see the end of the FPS arms. I chose the ability to go from 50 to 74 in the slider. It's easily altered from the GUI editor by clicking the slider and altering the range within the properties.

Step 1:

If you haven't altered your optionsDlg.gui, just replace your current file with the one from the download below. Back-up your current one, if you like.

FOV_Slider.zip

Step 2:

Open game/art/datablocks/player.cs

in datablock PlayerData(DefaultPlayerData) find:

cameraDefaultFov = 55.0;cameraMinFov = 5.0;cameraMaxFov = 65.0;

and change it to this:

cameraDefaultFov = $pref::Player::currentFov; // ChangecameraMinFov = 5.0;cameraMaxFov = 75; // Change Step 3: Open game/scripts/client/default.bind.cs find: 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();} and change it to: function turnOffZoom(){ ServerConnection.zoomed = false; setFov($pref::Player::CurrentFOV);  // Change   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();}

Hopefully that will do it. Load up a level and hit Ctrl-O and knock yourself silly with an almost useless slider!

#### Who is online

Users browsing this forum: No registered users and 1 guest