[How To] Modify zoom...

agen-|-
08-15-2004, 12:40 AM
How would I modify zoom from 2x 5x 10x 20x to something shorter, like 2x 4x 6x 8x? Searched thru prefs, and couldn't notice anything in particular that stuck out. Is it burried inside a .vol somewhere? Or perhaps something i could add a few lines to the autoexec.cs? idk.

VGT in advance

EDIT: thats for T1

Amadeus
08-15-2004, 03:55 AM
I don't think you can alter the default levels, but it could be easily scripted.

TheRealMysterio
08-15-2004, 04:30 AM
2x zoom just changes your fov to 45 (fov is just a pref that you can change anytime). You can redo the zoom entirely and make a button that will toggo through thorugh different zoom levels setting a new fov. Then when you press the zoom key (e for most) you will change to that desired fov then when u let go of the key it will break it.

gl

-r3y

agen-|-
08-15-2004, 05:41 AM
2x zoom just changes your fov to 45

is that a fact? What happens if I turn my fov down to 45? Ofcoarse, 2x zoom won't work then. [/sarcasm]

Looking for a legit answer, and I know I have saw it in a script (six-pack or newopts maybe), and if somebody knows what script it's in, i'll put forth the effort of digging into it to find it.

agen-|-
08-15-2004, 05:42 AM
some code inserts would be nice ;)

Shinigami
08-15-2004, 06:38 AM
is that a fact? What happens if I turn my fov down to 45? Ofcoarse, 2x zoom won't work then. [/sarcasm]

That was a completely legit answer. He pretty much told you exactly how to do it. You could've just said that you don't understand scripting enough to write it yourself. But no, you had to be a smartass.

Amadeus
08-15-2004, 08:29 AM
This is a script I made that has a lot of features related to zooming. It has built-in smooth zooming too. If you don't like that, tough. It's supposed to be standalone... there's a support script with some variables and function declarations, but I don't think its lack will affect this script by much.

//------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------
//
// ZoomEnchance
//
// by Csaba "Amadeus" Bansaghi
//
//------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------
//
// This script gives you a number of options related to
// zooming in and out, and changing your zoom range.
//
//------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------


$AP::ZoomKey = "e"; // The key you would like to use for zooming
$AP::IdleFOV = 90; // Idle FOV (no zooming)
$AP::UTZoom = "false"; // Set to true for Unreal style zooming
$AP::ZoomSpeed = 1; // Delay between two frames in zooming (milliseconds)

$AP::AutoUseLaser = "False"; // Equip laser rifle when zooming in, switch back to
// previously equipped weapon when zooming out

$AP::AutoCrouch = "False"; // Automatically crouch when zooming


// You do not need to set these variables if you use UT style zooming

$AP::IncZoomKey = "zaxis1"; // The key to increase zoom rate
$AP::DecZoomKey = "zaxis0"; // The key to decrease zoom rate


// Advanced options

$AP::DefaultSniperFOV = 22.5; // Default FOV in sniper mode
$AP::MinSniperFOV = 5; // Max threshold for zooming
$AP::MaxSniperFOV = 45; // Min threshold for zooming
$AP::ZoomChangeRate = 7.5; // Change to FOV in degrees when changing zoom mode
$AP::CycleZoomRate = "False"; // Cycle through zoom rates




// Make the keybinds

// Change mouse0 to keyboard0 if you use the keyboard to change zoom rates

if (!$AP::UTZoom) {
bindCommand(mouse0, $AP::DecZoomKey, to, "AP::DecZoomRate();");
bindCommand(mouse0, $AP::IncZoomKey, to, "AP::IncZoomRate();");
}


bindCommand(keyboard0, make, $AP::ZoomKey, to, "AP::StartZoomIn();");
bindCommand(keyboard0, break, $AP::ZoomKey, to, "AP::StartZoomOut();");

//------------------------------------------------------------------------------------
//-------------------------- DO NOT EDIT PAST THIS LINE ------------------------------
//------------------------------------------------------------------------------------


function AP::IncZoomRate() {
if ($AP::SniperFOV >= $AP::MinSniperFOV) {
if (($AP::SniperFOV - $AP::ZoomChangeRate) < $AP::MinSniperFOV) {
if ($AP::CycleZoomRate) {
$AP::SniperFOV = $AP::MaxSniperFOV - ($AP::SniperFOV - $AP::MinSniperFOV);
$AP::LastFOVChange = $AP::ZoomChangeRate;
}
else {
$AP::LastFOVChange = $AP::SniperFOV - $AP::MinSniperFOV;
$AP::SniperFOV = $AP::MinSniperFOV;
}
}
else {
$AP::SniperFOV = $AP::SniperFOV - $AP::LastFOVChange;
$AP::LastFOVChange = $AP::ZoomChangeRate;
}
}
if ($AP::ZoomOn) AP::SmoothZoomIn();
AP::DevEcho("Sniper FOV decreased to " @ $AP::SniperFOV);
remoteBP(2048, "<jc><f1>Zoom: <f2>" @ string::getSubStr($AP::Id leFOV/$AP::SniperFOV, 0, 3) @ "<f1> x");
$AP::LastZoomChange = getsimtime();
schedule("AP::ClearBP();", 2);
}

function AP::DecZoomRate() {
if ($AP::SniperFOV <= $AP::MaxSniperFOV) {
if (($AP::SniperFOV + $AP::ZoomChangeRate) > $AP::MaxSniperFOV) {
if ($AP::CycleZoomRate) {
$AP::SniperFOV = $AP::MinSniperFOV - ($AP::MaxSniperFOV - $AP::SniperFOV);
$AP::LastFOVChange = $AP::ZoomChangeRate;
}
else {
$AP::LastFOVChange = $AP::MaxSniperFOV - $AP::SniperFOV;
$AP::SniperFOV = $AP::MaxSniperFOV;
}
}
else {
$AP::SniperFOV = $AP::SniperFOV + $AP::LastFOVChange;
$AP::LastFOVChange = $AP::ZoomChangeRate;
}
}
if ($AP::ZoomOn) AP::SmoothZoomIn();
AP::DevEcho("Sniper FOV increased to " @ $AP::SniperFOV);
remoteBP(2048, "<jc><f1>Zoom: <f2>" @ string::getSubStr($AP::Id leFOV/$AP::SniperFOV, 0, 3) @ "<f1> x");
$AP::LastZoomChange = getsimtime();
schedule("AP::clearBP();", 2);
}

function AP::StartZoomIn() {
if ($AP::UTZoom) {
if (!$AP::ZoomOn) {
$AP::ZoomOn = "true";
$AP::Zooming = "true";
AP::DevEcho("Starting UT zoom in");
}
else {
$AP::ZoomOn = "false";
AP::StartZoomOut();
AP::DevEcho("Starting UT zoom back to default FOV");
}
}
else {
$AP::ZoomOn = "True";
if ($AP::AutoUseLaser) {
$AP::LastUsedWeapon = getMountedItem(0);
use("laser rifle");
}
if ($AP::AutoCrouch) postaction(2048, IDACTION_CROUCH, 1);
}
AP::SmoothZoomIn();
}

function AP::SmoothZoomIn() {

if ($AP::UTZoom) {
if ($pref::playerFOV > $AP::MinSniperFOV && $AP::Zooming) {
$pref::playerFOV = $pref::playerFOV - 0.5;
schedule("AP::SmoothZoomIn();", $AP::ZoomSpeed/1000);
AP::DevEcho("UT zooming in...");
}
}

else {
if ($pref::playerFOV > $AP::SniperFOV) {
$pref::playerFOV = $pref::playerFOV-0.5;
if (($pref::playerFOV > $AP::SniperFOV) && $AP::ZoomOn == "True") schedule("AP::SmoothZoomIn();", $AP::ZoomSpeed/1000);
else AP::DevEcho("Zooming in to " @ $AP::SniperFOV @ " FOV...");
}
if ($pref::playerFOV < $AP::SniperFOV) {
$pref::playerFOV = $pref::playerFOV+0.5;
if (($pref::playerFOV < $AP::SniperFOV) && $AP::ZoomOn == "True") schedule("AP::SmoothZoomIn();", $AP::ZoomSpeed/1000);
else AP::EndZoomIn();
}
}
}


function AP::StartZoomOut() {
if ($AP::UTZoom) {
$AP::Zooming = "false";
if (!$AP::ZoomOn) {
AP::SmoothZoomOut();
AP::DevEcho("UT zooming back to Default FOV...");
}
else AP::DevEcho("Stopping UT zoom in");
}
else {
$AP::ZoomOn = "False";
if ($AP::AutoUseLaser && !$AP::ZoomOn) use($WeaponName[$index[$AP::LastUsedWeapon]]);
if ($AP::AutoCrouch) postaction(2048, IDACTION_STAND, 1);
AP::SmoothZoomOut();
}
}

function AP::SmoothZoomOut() {
$pref::playerFOV = $pref::playerFOV+0.5;
if (($pref::playerFOV < $AP::IdleFOV) && $AP::ZoomOn == "False") schedule("AP::SmoothZoomOut();", $AP::ZoomSpeed/1000);
else AP::DevEcho("Zooming back to default " @ $AP::IdleFOV @ " FOV...");
}

function AP::ClearBP() {
if (getSimTime() == $AP::LastZoomChange+2) remoteBP(2048, "");
}

$pref::PlayerFOV = $AP::IdleFOV;
$AP::SniperFOV = $AP::DefaultSniperFOV;
$AP::LastFOVChange = $AP::ZoomChangeRate;
$AP::ChangeWhileZoom = "False";
$AP::ZoomOn = "false";

AP::DevEcho("Default FOV set to " @ $AP::IdleFOV);
AP::DevEcho("Default sniper FOV set to " @ $AP::DefaultSniperFOV);

agen-|-
08-15-2004, 09:37 PM
After getting flamed, I decided to investigate 45 fov, and surprisingly, its true, I was wrong, flame on. And yes, I don't code, and was basically asking somebody to completely do the work for me.