Using mouse wheel for zoom control

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Hypersonic
Posts: 134
Joined: Mon Aug 14, 2017 3:04 pm

Using mouse wheel for zoom control

Post by Hypersonic »

I'd like to incorporate evals somehow for less wordy code
https://zdoom.org/wiki/CCMDs

Current setup in autoexec (using defaults: m_yaw 1, m_pitch 1)
alias zoom120 "fov 120; mouse_sensitivity 2; bind mwheelup zoom060; bind mwheeldown zoom120"
alias zoom060 "fov 60; mouse_sensitivity 1; bind mwheelup zoom030; bind mwheeldown zoom120"
alias zoom030 "fov 30; mouse_sensitivity 0.5; bind mwheelup zoom015; bind mwheeldown zoom060"
alias zoom015 "fov 15; mouse_sensitivity 0.25; bind mwheelup zoom015; bind mwheeldown zoom030"
zoom120

Is there a way to print FOV on the display so I know my zoom level without having to type fov in the console? Also is there a difference between bind and rebind?

EDIT: rebind is for re-defining aliases, not for keys?
I'm now using print $fov but it also prints unknown, perhaps I need to add type? Is there a way to print a command but not log it in the console?

Return to “Scripting”