I want my mousewheel to control 3 functions as a commander: camera tilt, building rotation, and camera zoom. I want the functions to be controlled with shift, alt, and no modifier at all (just the mousewheel).
Here's my uneducated attempt that failed:
bind wheeldown "ask iskeydown shift; if [answer] inc cl_cmdr_camtiltx -8; if [!answer] ask iskeydown alt; if [answer] rotateBuilding -1; else inc cl_cmdr_zoom 150"
(mousewheel should zoom, shift+mousewheel should tilt, and alt+mousewheel should rotate buildings .... now that I think about it I'll probably add ctrl+mousewheel to rotate the camera)
Can someone please explain to me where my syntax errors are and how the bind would look when done correctly? I've got a general idea of what/where my problem is but I really don't know the proper syntax to fix it and would love to hear from someone with a lot more experience.
Thanks in advance.
In a spark of inspiration I tried going about the solution in an entirely new way. Here is what I came up with:
(placed in a cfg file and loaded with autoexec.cfg)
bind shift "set shift_down 1"
bindup shift "set shift_down 0"
bind alt "set alt_down 1"
bindup alt "set alt_down 0"
bind ctrl "set ctrl_down 1"
bindup ctrl "set ctrl_down 0"
bind wheelup "if [shift_down] inc cl_cmdr_camtiltx 2; if [alt_down] rotateBuilding 1; if [ctrl_down] inc cl_cmdr_camtiltz 2; if [!(shift_down + alt_down + ctrl_down)] inc cl_cmdr_zoom -50"
bind wheeldown "if [shift_down] inc cl_cmdr_camtiltx -2; if [alt_down] rotateBuilding -1; if [ctrl_down] inc cl_cmdr_camtiltz -2; if [!(shift_down + alt_down + ctrl_down)] inc cl_cmdr_zoom 50"
Everything works fine except when holding ctrl the camera will tilt in both the z and x axes (for wheelup and wheeldown).
WTF is wrong with my ctrl section that would make it misbehave like that? I'm sure there is a much simpler means to reach this end and I'd love to hear it