Zoom out with mouse scroll in spec mode

Request help for teeworlds-related subjects (mapping, servers, ..).
For client issues, see our repositories (https://github.com/ddnet/ddnet/issues).
Post Reply
yolozzz
Posts: 2
Joined: Mon Nov 23, 2020 2:56 pm
Player profile: https://ddnet.tw/players/yolo/

Zoom out with mouse scroll in spec mode

Post by yolozzz »

I just thought it will be cool to unzoom with a scroll button in spec mode while plyaing, like if you need to fast check the next part or see a big picture of a map. And each time you spec/unspec the zoom amount will reset to default. What do you think about it?
User avatar
deen
TECHNICAL Team
Posts: 3575
Joined: Mon May 05, 2014 2:30 pm
Player profile: https://ddnet.org/players/deen/
Discord: deen#5910

Re: Zoom out with mouse scroll in spec mode

Post by deen »

You could automatically zoom out every time you pause by adding these 2 files in config_directory.bat:
spec1.cfg:

Code: Select all

bind q "say /spec; zoom-; zoom-; zoom-; zoom-; zoom-; exec spec2.cfg"
spec2.cfg:

Code: Select all

bind q "say /spec; zoom; exec spec1.cfg"
Then activate it by running exec spec1.cfg in F1.
yolozzz
Posts: 2
Joined: Mon Nov 23, 2020 2:56 pm
Player profile: https://ddnet.tw/players/yolo/

Re: Zoom out with mouse scroll in spec mode

Post by yolozzz »

I would love to have this feature instead but thanks for the binds, they're helpful!
Index
Posts: 1133
Joined: Mon May 05, 2014 7:30 pm
Clan: Eagle

Re: Zoom out with mouse scroll in spec mode

Post by Index »

You can even bind the exact feature you requested.
Just as a quick draft (it might be more elegant to use .cfg-files for enable/disable):

ON
bind x "say /spec; bind mousewheelup zoom+; bind mousewheeldown zoom-"
OFF
bind y "say /spec; zoom; bind mousewheelup +nextweapon; bind mousewheeldown +prevweapon"
GG Kid
Posts: 266
Joined: Sun Apr 16, 2017 2:33 am
Location: U.S.A.
Player profile: https://ddnet.tw/players/Bolto/
Clan: Kerger

Binding fun

Post by GG Kid »

Sounds like my kind of topic. i like the idea, but sense i don't code.... lets bind.

As for the issues that arise from using binds, it's that they are just an extension of your actions, let say you use Deens bind solution & when paused(& zoomed out) you leave the sever, the state of zoom will now be reversed. i.e. zoomed out when joined. same 'reverse issue' will happen with Index's except it's the ScrollWheel binds this time.

Now that you understand the limitations what should you do? well the only thing i can think of is bind a reset key. i suggest 'composed binds' like shift+x or a moment key not used is spec mode.
Zoom out on /spec {By Deen}Show
SpecOut.cfg

Code: Select all

 bind q "say /spec; zoom-; zoom-; zoom-; zoom-; zoom-; exec JoinReset.cfg"


JoinReset.cfg

Code: Select all

bind q "say /spec; zoom; exec SpecOut.cfg"

Zooms out 5 times on /spec

To initialize it: exec SpecOut.cfg , then use Q in-game to toggle it.

to work around the revese issue bind space "+jump; zoom; exec SpecOut.cfg" & use SPACE in game to reset back to normal.
ScrollWheel Zooms in /spec {by ٭ıƞdex'<3}Show
SpecZoom.cfg
say /spec
bind mousewheelup zoom+
bind mousewheeldown zoom-
bind p exec JoinRebind.cfg

JoinRebind.cfg
say /spec
zoom
bind mousewheelup +nextweapon
bind mousewheeldown +prevweapon
bind p exec SpecZoom.cfg

WheelZoomReset.cfg
zoom
bind mousewheelup +nextweapon
bind mousewheeldown +prevweapon
bind p exec SpecZoom.cfg
ScrollWheel Zooms when it Spectator Mode

To initiate: bind p exec SpecZoom.cfg, then use P in-game to toggle it on & off.

to work around the revese issue bind shift+p "exec WheelZoomReset.cfg" & use SHIFT+P in game to reset back to normal.

also you might as well make a "autoexec.cfg" file & put the initialization binds in there so that when you start your client they will be set to the beginning. if you need anymore help i made a tut viewtopic.php?f=16&t=5819 Long time no see, hope your doing well man. life happens & these little side things stop being so important, i sure do like the challenge of thinking though the Binding system sometimes tho...
SpecZoomBinds.zip
Yes, i did make it easy 4 U.
(1.15 KiB) Downloaded 99 times
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests