Navigation
   

Web Hosting
  Proudly hosted by The Business Helpdesk.com, Inc.  
File - Zoom Functions
Download Details
Download Now
Download Now
Downloads 395
Views 1,113
Developer Zear
Last Update Jan 15, 2009 - 16:49
Version
Size 2.3KB
Type TXT
Rank No Votes, out of 0 Votes.
File Tags zoom  
Zoom Functions

I saw some requests for the ability to go straight to a specific zoom level. The code to do this follows.

Steps to set up:
Add the code, below, to your autoexec.cs.
Create an onconnect.cs file in your config folder.
Add the line '$magnification = 1;' to your onconnect.cs file and save it.
Bind your keys:
Bind your increment key to 'incMag();'
Bind your decrement key to 'decMag();'
Bind your magnification-specific keys as follows:
2x -> 'setMag(0);'
5x -> 'setMag(1);'
10x -> 'setMag(2);'
20x -> 'setMag(3);'
On the 'Player Setup' screen in Tribes, set 'Custom Script' to 'onconnect.cs'.

Important notes:

UNBIND YOUR 'z' KEY! (or bind it to something else) You cannot bind to (or use) IDACTION_INC_SNIPER_FOV directly, or setMag() will not work correctly. Use incMag() and decMag() instead.

The custom script can be named anything you want, and can have any other contents you like,, but you have to specify it in 'Player Setup', and you must have the '$magnification = 1;' line in it. This script is run each time you make a connection to a server. Your zoom level is reset to 5x at that point (it is left alone otherwise) and we must reset '$magnification' to 1 at the same time or they will get out of sync and setMag() won't work correctly.

If you are not in need of the setMag() function at all, decrementing the zoom can be accomplished by binding a key to 'postAction(2048, IDACTION_INC_SNIPER_FOV, -1.000000);', and you can leave all the below code out entirely.




------------------------------------------------------------------------

function setMag(%mag)
{
if( (%mag < 0) || (%mag > 3) )
return;

while (%mag != $magnification)
{
postAction(2048, IDACTION_INC_SNIPER_FOV, 1.000000);
$magnification++;
if($magnification > 3)
$magnification = 0;
}
}

function incMag()
{
postAction(2048, IDACTION_INC_SNIPER_FOV, 1.000000);
$magnification++;
if($magnification == 4)
$magnification = 0;
}

bindCommand(keyboard0, make, "numpad+", TO, "decMag();");

function decMag()
{
postAction(2048, IDACTION_INC_SNIPER_FOV, -1.000000);
$magnification--;
if($magnification < 0)
$magnification += 4;
}

http://www.planetstarsiege.com/zear/script/zoom.html
 
Search - Statistics & RSS - Contact Admin - -
PHCDownload 1.1.2 - Copyright (c) 2005 - 2024 - 0.0297 seconds