Jump to content
Qualx

Hold-To-Whatever Interface & Another Zoom Widget

Recommended Posts

EDIT: Finally updated to stop the scoreboard showing while you zoom. I've also combined the two files into one.

Someone asked me about a zoom script today. I'm pretty sure someone's done a proper zoom script already but I searched and all I could find was the autohotkey version which is borderline cheating in my opinion. So I made a hold-to-whatever interface (which overloads the functionality of +showscores) and implemented it for a zoom script.

Zoom Widget: http://reflex.kiai.eu/widgets/HoldToZoom.lua


You previously needed ShowScoresOverload.lua but the code from that is now included in HoldToZoom.lua so you can put it wherever you want without problems. If you install this file, don't forget to remove your old ShowScoresOverload.lua, otherwise everything might break.

To bind mouse4 to +zoom, use

bind game mouse4 ui_showscoresoverload_zoom 1;+showscores

You can set the console variables ui_holdtozoom_fov and ui_holdtozoom_sensitivityratio to set your desired zoom FoV and sensitivity ratio (although the widget currently scales sensitivity linearly, you can adjust that by this factor).

 

For coders:

Standalone ShowScoresOverload metawidget: http://reflex.kiai.eu/widgets/ShowScoresOverload.lua but do not download this if you also have HoldToZoom, because everything will break.

In the top level of any Lua file (ie, the same level where registerWidget goes), you can declare a flag with

declareShowScoresFlag("foo")

and then if you bind a key to

ui_showscoresoverload_foo 1;+showscores

the function

checkShowScoresFlag("foo")

will return true as long as it is pressed. If you use the require line correctly, then the widget will stomp showScores if any flagged binds are pressed, so you won't get your scoreboard popping up whenever you zoom.

Share this post


Link to post
Share on other sites

This is beautiful.  Thank you :).

The sensitivity scale doesn't quite work as I would have expected.  I see that you are scaling it based on fov/zoomfov, but I know that the Q3 community found that the most accurate way was a much uglier formula.  Does anyone know if that's a relic of the way Q3 scales sensitivity when using +zoom, or is it actually a function related to field of view?

Sources indicate for Q3, CZM came up with this:

arctan( tan(zoomfov * PI/360) * height/width ) * (360/PI) / 75

Edited by KovaaK

Share this post


Link to post
Share on other sites

Someone asked me about a zoom script today. I'm pretty sure someone's done a proper zoom script already but I searched and all I could find was the autohotkey version which is borderline cheating in my opinion.

 

​I don't know about others but I have used this for some time now

Share this post


Link to post
Share on other sites

Ah! I thought it was Quartz who posted something but I couldn't find it. But apparently yours was just toggle, so I didn't waste my time. :D

Kovaak - You could well be right. That looks very related to the field of view formula. I could spam a load of maths here but it probably won't be terribly comprehensible so I'll just scribble on a piece of paper and get back to you.

Share this post


Link to post
Share on other sites

A little off tropic.... But is it possible to overload the console map command somehow? I have notice that you are enable to put maps in subfolders and load them via console like subfolder/mapname. But if you exec map command then they don't show up.

 

Why I'm asking is because I don't really like the way maps is beeing listed...

Share this post


Link to post
Share on other sites

Given the map maker prefix to map names, it doesn't seem necessary to group them in folders by creator, and given that many maps can be played seriously in multiple modes, it doesn't seem possible to group them by game mode.

I could personally find this useful for map pools; for example have a folder on every server called "eRath," and have within this folder cpm22, cpmdm6, q2dm1, monsoon, d3dm3, dm sacred, qwe1m2, qwdm6, qwdm4, deck16, thct2, and dp8. I would imagine these copies of the maps would be in addition to existing copies in the main folder, so as to not confuse players unaware of the map grouping in folders.

ED: but this would not be a good idea at the vanilla Reflex level (given that tournaments and map pools change). Rather, this is the most useful way I can think of to use sub directories, and the prerogative of server owners if they are interested.

Edited by klyph0rd

Share this post


Link to post
Share on other sites

I would like that the map command worked like in quake3 and in that way that memphis allready said here: http://www.reflexfps.net/forums/index.php?/topic/2804-download-maps-from-a-map-database-straight-into-the-game/

in other words:

word completion and you can search for maps like "map rr_" <enter> would match rr_grad and rr_woosh.

 

Listings would be better with fixed lenght:

 

Instead of this:

bdm3, brcpm24, brrun1, colourpalette, cpm-dm6, cpm1, cpm32r, cpm22, devscene0, devscene2, mazut2, parkourstation-b64, reflexJump, rflx-race1, rrWenTower, rr_castlerun, xdm15

You will get this:

bdm3,        brcpm24,    brrun1,             colourpalette, cpm-dm6,     cpm1,      cpm32r,         cpm22,   devscene0, 
devscene2,   mazut2,     parkourstation-b64, reflexJump,     rflx-race1, rrWenTower, 
rr_castlerun, xdm15

Just an example.

Share this post


Link to post
Share on other sites

Someone asked me about a zoom script today. I'm pretty sure someone's done a proper zoom script already but I searched and all I could find was the autohotkey version which is borderline cheating in my opinion. So I made a hold-to-whatever interface (which overloads the functionality of +showscores) and implemented it for a zoom script.

 Thank you for making this. I was the one who posted the AHK Hold-to-Zoom script, I didn't think that it would be perceived as borderline cheating though. It was only a workaround for something that you should be able to do in a .cfg file.

Thanks again =]

Share this post


Link to post
Share on other sites

Hey there!

First of all: Nice job on coming up with the idea! It's not always easy to find a hacky way like that in order to implement the desired functionality!

However, I'm having trouble with getting your script to work. The first thing I did was save the overload script in my widgets directory and integrate it into an existing widget. The hold thing worked perfectly, it's just that the scoreboard would appear every time I held the key! I decided to try out your zoom script, which already had the functionality built in - no difference. The zoom worked fine, but again, the scoreboard kept getting in the way and I haven't yet come up with a way to get rid of it.

I don't think a description of how I used the script is required, since I already said that the same problem happened with your zoom script. However, it's probably a good idea to show how I'm binding my keys:

bind game [key] ui_showscoresoverload_myvar 1;+showscores

...though that doesn't seem to differ much from the examples in your post.

The first question is: is your workaround still valid in Reflex 0.38? Or have there been some recent changes that would affect it?

And the other question, which might be valid as well: Am I doing something wrong?

On 27.07.2015 at 0:01 AM, Qualx said:

you need to put the line


require "base/internal/ui/widgets/kiai/ShowScoresOverload"

at the top of any lua files which use either showScores or this interface, otherwise you'll get scoreboards popping up at surprising times

Does that mean that I should edit out the internal Reflex widgets responsible for displaying the scoreboard (I thought I should never do that)? Or is it that your script does not work with the default scoreboard widget?

Thanks for help and cheers!

Edited by rhino
Extra information provided

Share this post


Link to post
Share on other sites
On 7/27/2015 at 6:45 PM, KovaaK said:

This is beautiful.  Thank you :).

The sensitivity scale doesn't quite work as I would have expected.  I see that you are scaling it based on fov/zoomfov, but I know that the Q3 community found that the most accurate way was a much uglier formula.  Does anyone know if that's a relic of the way Q3 scales sensitivity when using +zoom, or is it actually a function related to field of view?

Sources indicate for Q3, CZM came up with this:

https://www.reddit.com/r/GlobalOffensive/comments/43urd4/why_0818933027098955175_is_the_best_zoom/

https://www.reddit.com/r/GlobalOffensive/comments/3vxkav/how_zoomed_sensitivity_works/

https://github.com/ValveSoftware/source-sdk-2013/blob/56accfdb9c4abd32ae1dc26b2e4cc87898cf4dc1/sp/src/game/client/in_mouse.cpp#L389

That formula you mentioned is definitely related to your FOV. In fact, CS:GO uses a similar formula. The links above describe how it works, also provided the source code from the Source 2013 SDK.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×