-
Notifications
You must be signed in to change notification settings - Fork 831
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
[Controller] feat: no more melee auto-chasing #6441
base: master
Are you sure you want to change the base?
Conversation
I can still get my character to chase down enemies if I press-and-hold the primary action button while moving the analog stick in a direction. I can no longer interact with Snotspill without the aforementioned workaround. It feels a bit odd to me to pass the |
You are right, the previous commit wasn't good enough. I've changed the approach and played with
Not yet tested:
|
Nice work. Your changes here are better than I envisioned. Unfortunately, I can see one issue that will still need to be addressed, though I'm not sure if it needs to be done in this PR. NetSendCmdLoc(MyPlayerId, true, myPlayer.UsesRangedWeapon() ? CMD_RATTACKXY : CMD_SATTACKXY, position);
LastMouseButtonAction = MouseActionType::Attack; This breaks the "repeat action" logic in I was thinking about how to handle this problem yesterday, and I think it would probably be best to introduce |
@StephenCWills thanks, |
Yes, it should affect virtual gamepad in the same way it affects gamepad.
The answer to that is subjective, but there's a good chance your experience with virtual gamepad would be similar to your experience with gamepad. |
1. when target enemy is close do a legacy type of attack 2. when target enemy is far do mock shift attack
I think I have a workaround in my latest commit. I've tried to use |
Hey @StephenCWills, |
Primary Action Button changes
A proposition of change described in: #6436
These changes prevent player's character from chasing targets with melee weapons when using a controller.
When Primary Action button is pressed, the following checks are being done from top to bottom:
The result is smooth combat using melee weapon and controller when movement is controlled only by stick and Primary Action fights the closest enemy.
Implementation details
I am using preexisting function
GetMinDistance(position)
to determine if target is close or distant.
Bugfix
I found a bug when testing PvP with controllers.
The bug prevented targeting another player in melee mode.
newDdistance = GetDistance(player.position.future, distance);where
distance
is a maxDistance for a distance calculation so should not be0
as initial value. I've changed the initial value from0
toINT_MAX
.Bugfix is in a separate PR:
#6494
Tests
The tests where done on two PCs using controller and mouse/keyboard. Tested: