-
Notifications
You must be signed in to change notification settings - Fork 829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hold mouse button to keep attacking (Diablo 2-style) #2349
Hold mouse button to keep attacking (Diablo 2-style) #2349
Conversation
Can't say my memory regarding lines I have changed is much better, but I use Git to track what I have changed :) |
Check |
See #962 |
I like having the information right in front of me in the code. It's also useful in case I need to do big merges. I'll remove them when this feature is done. |
Maybe I could use that for when a specific enemy is targeted, but then use the timer for shift attacks (using only destAction check for shift attacks means any shift attack becomes 2 attacks: one instant and one queued). Edit: Actually, it should always be a combination of both, otherwise clicks with and without shift becomes double attacks. |
ok, maybe add pmode to the mix :) |
Aside from tweaking some comments, this is close to being done I think. I can think of one known issue right now:
|
I hadn't checked this change but I'm surprised to hear talks of a "timer". Is this just a slightly different way to "simulate clicks in time intervals"? Why are we using any sort of timer here at all? |
It's used to prevent a single click from becoming multiple attacks. Otherwise, this ends up happening: you intend to press the mouse button once, it ends up being registered as pressed down for 2 gameplay ticks, thus you do an attack instantly and queue up another one. |
This is the problem though, it should not. We need to add support at the engine level for detection of "holds vs presses" and treat them differently. I think any other solution will end up resulting in hacks somewhere. |
It's just a couple of lines of code. It's easy to change if we ever have a different way of detecting mouse click holds. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a fan of how invasive this is, the fact that hold detection is intertwinned with other logic, all the hardcodes, and the fact that we are not treating "continuous attack" as a separate action.
Won't block the change but I don't think this is the way to go still.
It's not clear to me if this is a general issue with the latest master or specifically with the hold mouse feature, but putting it here for now: #2280 (reply in thread) |
… syndrome after one gameplay session"
…ng down left mouse button.
…GetPerformanceCounter()
…t scales with game speed.
…tion" check into it
…holding down right-click
…avegame load, level switch, and new game).
1e5dcfc
to
1b488e7
Compare
Looks reasonable to me, @FluffyQuack would you strip the name comments from this :) |
I changed the comments and I renamed the enum to be similar to how I think new enums are created in the project. In the long run, I think the track_process() and track_repeat_walk() functions should be simplified. I'd personally make it function similar to how I did the "hold click to attack" as I find it more straightforward. |
yes, and not time based. |
Here's my unfinished implementation of holding down a mouse button to keep attacking or casting spells.
Notes:
//Fluffy
comments are only there so I can keep track of what code snippets I've changed (I've got the memory of a forgetful goldfish).