EDIT: This script changes your Field Of View SMOOTHLY when aiming or sprinting. Must be applied to each weapon's script individually in order to take effect for those weapons. Compatible with 99.99% of mods. Look below in comments for two more tutorials.
here's a script of FOV - smoothed out! (there might be some little bug when reloading, but it is hard to notice):
File: View.as, Place: in void AddToScene() {
Code: Select all
Same file, place: class ViewSMGSkin { (don't do CTRL+F, not accurate)
float zoom = AimDownSightStateSmooth * (cg_zoomFov.IntValue - fov); //difference in fov (degrees). below zero when aiming
float run = SprintState * (cg_runFov.IntValue - fov); //above zero when sprinting
cg_fov.IntValue = fov + zoom + run;
if (AimDownSightState == 0 && SprintState == 0)
{
cg_fov.IntValue = fov;
}
Code: Select all
File: Scripts/Gui/Preferences.as Place: about line 660, together with other options
ConfigItem cg_fov("cg_fov");
private ConfigItem cg_fov2("cg_fov2");
private int fov = cg_fov2.IntValue;
private ConfigItem cg_zoomFov("cg_zoomFov");
private ConfigItem cg_runFov("cg_runFov");
Code: Select all
This can be applied to each weapon individually. layouter.AddSliderField(_Tr("Preferences", "FOV"), "cg_fov", 60, 110, 5,
ConfigNumberFormatter(1, " deg"));
layouter.AddSliderField(_Tr("Preferences", "FOV2 - keep same as FOV"), "cg_fov2", 60, 110, 5,
ConfigNumberFormatter(1, " deg"));
layouter.AddSliderField(_Tr("Preferences", "ZoomFOV"), "cg_zoomFov", 20, 90, 5,
ConfigNumberFormatter(1, " deg"));
layouter.AddSliderField(_Tr("Preferences", "SprintFOV"), "cg_runFov", 60, 110, 5,
ConfigNumberFormatter(1, " deg"));
Credit is a must.