3 level zoom in/out script - it's working now

Discuss Nexuiz gameplay here.

Moderators: Nexuiz Moderators, Moderators

3 level zoom in/out script - it's working now

Postby AceOfThumbs » Wed Sep 05, 2007 12:06 am

WHAT IT IS
A variation on the FOV zoom scripts that sets up a zoom in button and a zoom out button with 3 levels. It would be easy to add more levels if you want.

HOW IT WORKS
- press R to set the zoom level higher (more zoom)
- press F to set the zoom level lower (less zoom)
- press SHIFT or CAPSLOCK to zoom (starts at level 1 zoom)

PROBLEMS
- Used to give an error message but I fixed it.

- If you are holding shift or have capslock on, adjusting the zoom level doesn't take effect yet. You have to release zoom and zoom again. I came up a better script here:
http://alientrap.org/forum/viewtopic.php?t=2164

Let me know if you have any suggestions/comments/requests. Below is the script that would go in your autoexec.cfg file. I used "aot" at the beginning of each variable and alias to try to make sure it isn't conflicting with something Nexuiz is using internally. aot=AceOfThumbs.

// AceOfThumbs 3 level FOV zoom with lock

// adjust zoom and sensitivity levels to suit yourself
set aotzoom1 70
set aotzoom2 50
set aotzoom3 20
set aotsens1 2
set aotsens2 1.5
set aotsens3 1

// current values for zoom mode. Default to zoom level 1.
set aot_cur_zoom $aotzoom1
set aot_cur_sens $aotsens1

// save non-zoom values
set aot_zoom0 $fov
set aot_sens0 $sensitivity

// zoom level commands
alias "aot_zoom_level3" "set aot_cur_zoom $aotzoom3 ; set aot_cur_sens $aotsens3 ; echo zoom3 ; alias aot_zoom_in aot_zoom_level3 ; alias aot_zoom_out aot_zoom_level2"
alias "aot_zoom_level2" "set aot_cur_zoom $aotzoom2 ; set aot_cur_sens $aotsens2 ; echo zoom2 ; alias aot_zoom_in aot_zoom_level3 ; alias aot_zoom_out aot_zoom_level1"
alias "aot_zoom_level1" "set aot_cur_zoom $aotzoom1 ; set aot_cur_sens $aotsens1 ; echo zoom1 ; alias aot_zoom_in aot_zoom_level2 ; alias aot_zoom_out aot_zoom_level1"

alias "aot_zoom_in" "aot_zoom_level2"
alias "aot_zoom_out" "aot_zoom_level1"

bind "mwheelup" "aot_zoom_in"
bind "mwheeldown" "aot_zoom_out"

alias "+aot_zoom_now" "fov $aot_cur_zoom ; sensitivity $aot_cur_sens"
alias "-aot_zoom_now" "fov $aot_zoom0 ; sensitivity $aot_sens0"

bind "shift" "+aot_zoom_now"
bind "capslock" "+aot_zoom_now"
Last edited by AceOfThumbs on Thu Sep 06, 2007 7:16 am, edited 1 time in total.
AceOfThumbs
Alien
 
Posts: 158
Joined: Tue Sep 04, 2007 11:12 pm

Postby TVR » Wed Sep 05, 2007 12:40 am

Your problem is that all commands separated by a semicolon are executed at once.

Unfortunately your bind is redundant and inferior compared to Xeno' zoom script.
TVR
Alien trapper
 
Posts: 404
Joined: Fri Jun 01, 2007 12:56 am

Postby ai » Wed Sep 05, 2007 1:31 am

What's Xeno's script? I'm using Morfar's, and it's, you could say, perfect. Works like a charm.
ai
Forum addon
 
Posts: 2131
Joined: Sun Mar 05, 2006 3:54 pm
Location: Behind you

Postby torus » Wed Sep 05, 2007 1:32 am

Where are any of you getting these elusive scripts? It would seem I'm out of the loop.
Image
torus
Forum addon
 
Posts: 1341
Joined: Sun Dec 24, 2006 6:59 am
Location: USA

Postby ai » Wed Sep 05, 2007 1:38 am

Well, some post them here, others share them on IRC. And for the enthusiastic people, they create their own :)

Here's Morfar's script:
Code: Select all
// zoom script
set fov_orginal $fov
set fov_zoomvalue 50
set fov_sensorginal $sensitivity
set fov_sens 1.2
alias "+fov_zoom" "fov $fov_zoomvalue ; sensitivity $fov_sens"
alias "-fov_zoom" "fov $fov_orginal ; sensitivity $fov_sensorginal"

alias zoom_toggle "zoom_on"
alias zoom_on "fov $fov_zoomvalue ; sensitivity $fov_sens ; alias zoom_toggle zoom_off"
alias zoom_off "fov $fov_orginal ; sensitivity $fov_sensorginal ; alias zoom_toggle zoom_on"

bind mouse4 "+fov_zoom" // zoom while pressing
// bind x "zoom_toggle" // zoom toggle

Put that in "autoexec.cfg" in the /data directory. Then you can use whatever buttons you like. I personally don't use that zoom_toggle thing as it only got in my way. But if you like it, knock yourself out :D
Also, you can change the sensitivity of the zoom thing if it's too low/high. FOV zoom stuff aren't shown on demos so if you don't know about these scripts it might seem someone aims like a god :P
ai
Forum addon
 
Posts: 2131
Joined: Sun Mar 05, 2006 3:54 pm
Location: Behind you

Postby torus » Wed Sep 05, 2007 1:45 am

Word. Thanks.
Image
torus
Forum addon
 
Posts: 1341
Joined: Sun Dec 24, 2006 6:59 am
Location: USA

Postby AceOfThumbs » Thu Sep 06, 2007 7:21 am

TVR wrote:Your problem is that all commands separated by a semicolon are executed at once.

Unfortunately your bind is redundant and inferior compared to Xeno' zoom script.


Sorry, TVR but you are incorrect. The commands execute sequentially when separated with a semicolon. The problem I was having was with syntax. When I added a space before the semicolons, it fixed the problem. Maybe this is Mac-specific, because I've seen other users' scripts that use don't have the extra space. See my revised script at the top of this topic.
AceOfThumbs
Alien
 
Posts: 158
Joined: Tue Sep 04, 2007 11:12 pm

Postby divVerent » Thu Sep 06, 2007 8:15 am

This space won't be needed any more in the next release, as the parsing of cfg files/aliases will change. The aliases posted here will continue to work.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby morfar » Thu Sep 06, 2007 2:20 pm

ai wrote:Here's Morfar's script: .....


That's my old script. I made a smaller version some months ago but the function is the same.
Code: Select all
// zoom script
set z_fov $fov ; set z_sens $sensitivity
set z_zoomfov 50 ; set z_zoomsens 1.5
alias +z_zoom "fov $z_zoomfov ; sensitivity $z_zoomsens ; alias z_toggle -z_zoom"
alias -z_zoom "fov $z_fov ; sensitivity $z_sens ; alias z_toggle +z_zoom"
alias z_toggle "+z_zoom"
// Zoom Binds
bind mouse3 "+z_zoom" // zoomed in while pressing
//bind x "z_toggle" // zoom toggle
morfar
Site Admin
 
Posts: 938
Joined: Tue Feb 28, 2006 6:08 pm
Location: The Island

Postby Longhorn » Thu Sep 06, 2007 4:09 pm

who has time to zoom???? :twisted:
Longhorn
Member
 
Posts: 39
Joined: Sun Feb 04, 2007 5:59 am
Location: Indiana, USA


Return to Nexuiz - Gameplay

Who is online

Users browsing this forum: No registered users and 1 guest

cron