// #autoload // #name = UberZoom // #version = 1.2.5 // #date = May 14, 2002 // #author = Paul Tousignant // #warrior = UberGuy (FT) // #email = uberguy@tribalwar.com // #web = http://scripts.tribalwar.com/uberguy // #web = http://scripts.tribes-universe.com/uberguy // #description = Extensive zoom automation script // #category = UberGuy's Scripts // #status = beta // #readme = scripts/UberGuy/uberZoom.txt // #config = uberZoomGUI // #credit = Kerberus, VeKToR, Crunchy, Wizard and LabRat, for many code snippets. // #include = support/tap.cs // #include = support/loadout.cs // #include = support/callback.cs // #include = support/weapon_list.cs UberZoom Version: 1.2.6 By: UberGuy (FT) E-Mail: uberguy@tribalwar.com Overview: Your one-stop shopping outlet for all things zoom related! Usage: This script has an options GUI here in the script browser and three keybinds. The keybinds are all prefixed with "UberZoom" in the controls section of the Options dialog. Their functions will be explained after the GUI options, below. Here is an explanation of each tabbed panel and all the controls on it. ============================================ Zoom Options Use Wheel While Zoomed: This allows you to use your mouse wheel to control your level of zoom when you are zoomed in. Any other bindings you have for your mouse are preserved when you are not zoomed. Rolling the wheel up zooms in and rolling it down zooms out. Zoom Levels Wrap Around: There are optional "UberZoom Zoom In" and "UberZoom Zoom Out" keys defined in the Tribes 2 keybinds. If this option is checked, pressing "Zoom In" when the zoom level is at max will wrap around to the minimum zoom. The converse is true for "Zoom Out." If this is disabled the respective keys stop changing the zoom level once they reach their maximums. Zoom Key Toggles Zoom: When enabled this changes your zoom key from "zoom while pressed" to "zoom in when pressed, zoom out when pressed again," and so on. I other words, it becomes a toggle key. This option is incompatible with the "Tap Toggle" option and de-selects that option when selected. Tap Toggle: When enabled this changes makes your Zoom key act as either a toggle or a "zoom-while-pressed" key depending on how quickly you press and release it. If you press and release it within the time set in "Tap ms", it acts as a toggle and stays zoomed when you release it. Otherwise it stays zoomed until you realese it and then unzooms normally. This option is incompatible with the "Zoom Key Toggles Zoom" option and de-selects that option when selected. Max Zoom: The highest zoom level you can zoom to, expressed as a magnification factor. The highest allowed value is 20. Max Zoom: The lowest zoom level you can zoom to, expressed as a magnification factor. The lowest allowed value is 1. Values below 1 would be the equivalent of FOV's greater than 90. # Steps: When you change zoom levels, this is how many steps you move through from the minimum to the maximum, inclusive. The zoom multipliers are logarithmically spaced, so selecting 2 steps with a 1 and 10 won't go 1, 5.5, 10, but rather 1, 3.2, 10. Use Default Zoom: When this is selected, the number from the slider below (Default Zoom) is set every time you zoom. The slider snaps to values that are valid steps based on your minimum and maximum zooms and number of steps, described above. If you engage zoom, change your magnification to some other level, and disengage zoom the next time you engage it this value will be the initial magnification level again. Reset Zoom After: If a number besides zero is entered here it is used as a time (in milliseconds) after you zoom out to reset your zoom. Zooming back in before the time is up resets the clock. The zoom resets to the weapon's default if set (see Weapon Options), or the global default (if set) or the minimum zoom. kReticle Enhancements: kReticle is an excellent script written by one Kerberus in the early weeks of Tribes 2. There is also an updated version written by Runar. It gives you Mortar and Grenade Launcher range finder ticks when those weapons are drawn. This button enables the following enhancements to kReticles: All range finders scale to show range properly with varying zoom levels and changes to FOV. Range finders toggle on and off in keeping with the player's weapon reticle. For example the range finder doesn't appear in 3rd the person view. ============================================ Sensitivity Options Custom Zoom Sensitivity: Checking this box scales your mouse sensitivity when zoomed. The multiplier for the sensitivity is the value of the slider below (Sensitivity Scale Factor). A scale factor of 1 is the same as your normal sensitivity. This scale factor is only in effect while you are zoomed in, and is the same no matter your magnification level when zooming. However, higher zoom levels intrinsically have lower sensitivites. This feature lets you bump them all up. ============================================ HUD Options Show Zoom Value HUD: UberZoom has the option of attaching a small zoom level indicator to your aiming reticle. If you check this box, the HUD will be visible. Only When Visible: This checkbox is only enabled if you check the "Show Zoom Value HUD" checkbox to its left. Checking this box makes the Zoom Value HUD only appear when you are actually zoomed in. Reset Zoom Hud Position: This button resets the position of the Zoom Value HUD to it's default position. See the section on keybinds for information on how to move the HUD from it's default position. Show Zoom Box For: The "Zoom Box" is the green rectangular outline that appears when you change your zoom magnification but you aren't zoomed in. It indicates the part of your non-zoomed field of view that will be seen when you zoom in. It normally appears when you change the zoom level and remains on-screen for 5 seconds. Use this numeric entry field to change that persistence time. Box After Zoom For: If you put a non-zero number in this field the "Zoom Box" will appear for that duration when you stop being zoomed in. This is useful as a quick visual indicator of where you left your zoom level. Box After Reset For: If you put a non-zero number in this field the "Zoom Box" will appear for that duration when your zoom automatically resets as a result of the "Reset Zoom" option on the "Zoom" panel. ============================================ Weapon Options Both dropdowns on this panel are disabled until you connect to a game server. Once you connect the dropdowns will be populated with the names of all of the weapons available on that server. Weapon | Zoom List: This box lists all weapons chosen with the "Add Auto Zoom Weapon" button. Double clicking on a weapon brings up a slider dialog box on which you can select the desired default zoom level for that weapon. Read below for further details on how to manipulate data in this list. Add Auto Zoom Weapon: This set of controls allows you to select weapons for which, when drawn, you will can have special zoom management. You select a weapon by picking its name out of the drop down list above the "Add" button and then clicking "Add". You can't add a weapon more than once. An added weapon appears in the list above. Once it's added, you can double click on its row in the list to bring up the default zoom dialog. Set the slider to the zoom of your choice and hit escape when you're done. The new default appears in the "Default Zoom" column of the list above. This slider can also be brought up in-game (See "UberZoom Wpn. Zoom" in the keybinds section). Remove Weapon: If you press this button while you have a weapon highlighted in the list above, that weapon will be deleted from the list. All associated settings for that weapon will be lost. Unset Zoom: Pressing this button while a weapon is selected in the "Weapon | Zoom List" will remove its default zoom setting. That weapon will no longer override the current or general default zoom. Toggle AutoZoom: This button also affects the weapon selected in the list above. Initally, added weapons have "No" in the AutoZoom column. Use this button to toggle between "No" and "Yes". Weapons with AutoZoom set to "Yes" will switch to zoom immediately when selected in-game. If the weapon also has a default zoom, that zoom level is used. Otherwise, if there is a general default zoom, that is used. If there are no defaults, the current zoom level is used. To un-zoom from a weapon that auto-zooms, press and release the key bound to "Zoom". The weapon will not automatically zoom again until you change to a different weapon and back. Changing from an auto-zooming weapon to one with no zoom settings will zoom back out unless you were already zoomed in to start with, or unless you are holding the zoom key while you switch weapons. Toggle Wheel: If you would prefer to disable the use of the mouse wheel for setting zoom levels while zoomed with a particular weapon, you can use this button. Like the other buttons in its cluster, it affects the weapon selected in the list above. Like AutoZoom, this will toggle the "No Wheel" column between "Yes" and "No". Beware the double negative: a "No" in the "No Wheel" column means that the mouse wheel will control the zoom. The default value is "No". Note that wheel-zoom can be disabled in general on the "Zoom" tab (see above section). In general, if you add a weapon to the "Weapon | Zoom" list, don't set a default zoom and don't change one of the two other columns to "Yes", having the weapon in the list has no effect. Auto Use this Weapon on Zoom: Choosing a non-blank weapon name will cause you to switch to this weapon whenever you zoom in (assuming it's in your current loadout). When you zoom out your previous weapon will be reselected. ============================================ Sniper Options Hide Sniper Rifle on Zoom: Checking this checkbox will make the very large sniper rifle not be rendered when you are zooming in. As an added bonus, if you are playing with rendered player body this is also toggled off until you zoom out to normal magnification - otherwise you see your own empty hand holding the invisible sniper rifle. Zoom on Reverse Sniper: This is possibly the most effective feature of all in this script. If you have VeKToR's Reverse Sniper installed, this checkbox enables special functionality. When you press fire in preparation for the fire-on-release you will now automatically zoom to your current or default zoom level. If you prepare to fire by pressing the fire button, the only way to abort the shot is to change weapons. If you do this while zoomed in as a resuly of enabling this feature, UberZoom will immediately zoom back out. It does not wait for the time period described in the next entry. Hold Zoom: If you enable the "Zoom on Reverse Sniper" feature, above, this number determines how long the automatic zoom stays engaged after you fire. 400 ms is a good duration to allow you to see if you hit your target and press the fire again if not (which keeps it from zooming out). ============================================ KeyBinds UberZoom True Toggle: This keybind invokes the Toggle Mode for zoom even when you don't have the toggle option enabled. Each time you press this key you change from zoomed in to zoomed out or back. UberZoom Zoom In: This is basically a duplicate of the normal "Zoom" bind, renamed to match the other binds. If the "Zoom Levels Wrap Around" option is enabled, it works just like the normal zoom key - pressing it increases the magnification up to the max and then it recycles to the minimum and goes up from there. If the "Zoom Levels Wrap Around" option is disabled, the key has no effect beyond the maximum zoom. UberZoom Zoom Out: This is the opposite of the "UberZoom Zoom In" bind. If the "Zoom Levels Wrap Around" option is enabled, it works like the normal zoom key except pressing it decreases the magnification down to the minimum and then it recycles to the max and goes up from there. If the "Zoom Levels Wrap Around" option is disabled, the key has no effect beyond the minimum zoom. UberZoom Move Hud: Pressing this keybind allows you to move the Zoom Value Hud. The mouse cursor appears and drags the HUD with it. The HUD has a limited range of motion around the weapon reticle beyond which it will not travel. Clicking the left mouse button or hitting the "escape" key ends the movement and drops the HUD at its current location. This location is guaranteed to be remembered between games only if the "Save" button is pressed on the UberZoom Gui in the Script Browser. UberZoom Wpn. Zoom: This keybind invokes the same dialog as double clicking on weapons in the "Weapon | Zoom List" (see Weapon Options). If the player's currently selected weapon is not in that list of weapons, nothing happens. If it is in the list, the dialog appears and not only allows the weapon's default zoom to be adjusted, it immediately reflects the change on the game screen. ============================================ General Information Given the sheer number of combinations of zoom effects you can have with this script, it might be useful to go over these guidelines I used when designing it's behavior. If you catch it not behaving as described below, it's a bug and you should let me know. If you were already zoomed in when an automated zoom effect kicked in (based on weapon change or Reverse Sniper) the automated effect will not zoom you out when it normally would if it alone had instigated the zoom. When using Reverse Sniper the normal zoom key's function is reversed - pressing it turns off zoom. The automatic zoom effects that do instigate zoom themselves automatically will zoom back out even if Toggle Mode is on. Testing with this script shows it is compatible with the excellent sniper reticle script DioSniper. In addition to the reticle overlays DioSniper offers zoom features that are present in UberZoom. On my install UberZoom's settings overrode DioSniper's zoom settings, but in any case no functionality was lost. ============================================ Future Ideas Per-Weapon Default Zoom. (Done!) Option to reset the zoom to the Default rather than the minimum. (Done!) Built-in Field of View (FoV) management features. (Minimal, but done.) Credits: Thanks to the following folks for code examples that were worked into parts of this script, or whose scripts were so useful I wanted mine to integrate with theirs: Kerberus, VeKToR, Crunchy, Wizard, LabRat, and Diogenes. Also, of course, Writer, who created this kick-ass script manager. Known Issues/Bugs: Finally defeated the problem where zooming would reset the "don't render my weapons" setting some players use. (v1.2.5) Added a working per-weapon default zoom, and broke out per-weapon auto-zoom and per-weapon wheel zoom disabling as their own functions. (v1.20) Fixed a problem with the zoom resetting to the lowest value when you had no weapon in hand (like in a vehicle). (v1.15) Previously, when using integration with ReverseSniper, there was no way to abort a zoom-in-progress. You had to fire to get out of zoom mode. The only way to abort a ReverseSniper is to change weapons. UberZoom now aborts zooming when you change away from the sniper rifle if the zoom was initiated as a result of ReverseSniper activation. (v1.15) There was a problem where the zoom value indicator would appear even when the option for it was deselected. This has been fixed. (v1.15) Fixed zoom binds not working in vehicles. (v1.14) Fixed a glitch where the zoom indicator would not dissapear when the player enters an inventory station or is generally not holding a weapon. (v1.13) Fixed a bug with the zoomHud not showing post-zoom until you'd changed zoom levels once. (v1.12) Fixed a bug with re-opening the options GUI reset the zoom minimum. (v1.11))