Diablo IV WASD movement with AutoHotKey
Vložit
- čas přidán 13. 05. 2023
- Demonstration of Diablo IV gameplay utilizing WASD keys to control character movement similar to Diablo:Immortal.
On-screen keys are little bit janky, sorry about that.
WASD controls are achieved with AutoHotKey rebinding specific keyboard keys to mouse clicks at specific points on the screen. I've programmed the rebind mostly to avoid right hand click-spam due to some health issues with my hand. Coordinates of those clicks match 8 points at the corners and midpoints of the edges of the screen. Releasing all the directional keys sends a click message to the middle of the screen to stop the character. Holding the key sends click message every predefined time interval for continuous movement.
Regarding D4 controls options: turning off 'Combine Move/Interact/Basic Skill Slot' setting and binding movement to LMB is necessary. So attacking with LMB is not a possibility here unfortunately. I am using spacebar for my primary skill.
The script was prepared during 'Server Slam' open beta with quick-and-dirty approach. I've reworked it since and tested it in Diablo III, although it is not intended for Diablo III as you can't unbind left mouse click from primary skill there, which is necessary for the program to work as intended.
Source code: github.com/hwnd-git/Diablo-IV...
New version, much less spammy: github.com/hwnd-git/Diablo-IV...
Timestamps:
0:00 - Start
0:25 - First fight, free roaming
1:08 - Cellar 1
1:57 - Options / Controls
2:35 - Free roaming
3:35 - Cellar 2 / Conduit Shrine
4:14 - Free roaming
5:54 - Cellar 3
6:43 - Options / Controls again - Zábava
As long as controllers are a thing for D4, the keyboard controls should be as well. This is 2023 and I am tired to move my mouse all over the screen.
Yup, my first Diablo game and I hate using controller but I’m using a Xbox remote to play since click movement is so annoying.
Unplayable without wasd. Just learn from Battlerite/bloodline champions already.
This is awesome. A great option, though we really need native WASD support in D4. Don't worry about people against remapping software, they don't know what they're talking about. There's tons of programs similar to AutoHotKey that people use almost all the time. Such as Razer Synapse or Logitech G-hub. Even Wooting keyboards can do almost anything. Plus people have been using a controller+mouse at the same time in games for a long time, such as in FPS like Overwatch. Some people don't understand that remapping software is practically the remapping settings you see within a game's menu. There's no auto-aim or wall hacks, it's purely for convenience and preference, not cheating.
Man, you did a great job! thanks a lot! your's script improve the game really a lot! thanks thanks thanks!
This is great! I hope blizzard allows its use. Also lots of people seem to want you banned in the post you made for using this, don't know why that attitude
I think they are instantly assuming malevolent intent and not understanding how AutoHotKey works. It's fine though, it's in Blizzard's hands now.
Hello, stupid people in the forums will say that anything is third party and Violates Tos. I just ignores the forums. Blizzard couldn't care less about it, as long you don't use a bot to farm while you sleep you're good.
Many people uses auto clicking macros (source my diablo clan and plenty other clans) and not a single ban.
People on the forums will never be opened for suggestions or improvements that isn't from Blizzard.
I am not buying the game because I refuse to play point click.
If you share your script I'll happily use it and finally have fun with a decent movement scheme.
Subbed to your channel to get updates, thanks.
I need this. This is my first time buying a diablo game on steam and I've played so many games that are top down and 3rd person that use WASD and diablo is the first game I have ever seen with these movement controls.
You're a hero
Amazing! I'll consider using this as an inspiration to make thumbstick movement possible (in addition to a mouse setup). Would be great for keypads with thumbstick like the Azeron. This way, you are not limited to 8 axis, while having all the advantages still.
Thanks man, no more carpal tunnel!
Все отлично работает, спасибо)
i would love to use this on league of legends since the only thing i hate about the game is the click movemnt but i doesnt seem to work at all with this script, it activates but no movement is done from pressing wasd, any idea what i could modify to make it work for league of legends?
Hello ! any way to change the left click to right click on script ? Thanks in advance
Can I ask why binding move to LMB is required? Is there some limitation that stops us from editing the script to work with RMB?
Hey, regarding LMB - it was just something that popped into my mind when thinking about WASD movement implementation and I followed through with it without too much thought really. It was during the beta, so I tried to create the script ASAP. But you should be fine to modify it to RMB or MMB. Just scan the script for ControlClick instructions (e.g. ControlClick, x%xTarget% y%yTarget%, A,, L, 1, NA) and replace 'L' to 'R', or 'M'. Let us know if that worked. If it does' I will update the instructions on GitHub to let people know they can do that. PS. Binding movement to MMB in game: czcams.com/video/JIvOM9zBkSE/video.html
I remember now why the LMB. For unknown reason, at least in my case (it seems that @j4ysixx836 managed to rebind it just fine), when I've beed using MMB to move, the game has been registering the clicks correctly, but the character moved towards the cursor, regardless the click location. So it was breaking correct directional movement.
@@HighWindd87 hey, I did not have this particular issue, but one related: evading can occasionally use the direction of the cursor. This is tested using both L and R clicks. Another 2 things of note related to mounts is that any offset value that is not near the edge of the screen tends to be slower on a mount when Spur is used, as well as high delay values tend to make North and South movement worse than E/W/Diagonal, but is remedied with a lower delay.
Any issues using the mouse at the same time? A couple of scripts I've run in the past for various games really mess up mouse targetting when using them. Like the mouse keeps resetting to the center of the screen etc. Watching your vid it doesn't look like it, just checkin ;)
I didn't notice such issues and I've been playing since the game release regurarily. Sometimes direction of movement becomes messed after a lot of alt-tabbing though. In such case reloading the script helps.
@@HighWindd87 Cool beans! Will defs have to play with that if I re-purchase ;)
wasd Can it be done with g hub script?
Awesome!!! Does it works in POE and another games like this?
In theory it should be applicable as long as the character follows mouse clicks and is located near the center of the screen. But the devil is in the details and each script should be tweaked for given application.
@@HighWindd87 thank you very much for your work! I will definitely try) by the way I did WASD config for undecember and compared it with a click that move: czcams.com/video/gTAkv5Iy47s/video.html
@@HighWindd87 unfortunately does not work in POE, could you write a script for this game? would be extremely grateful!
@@ExoticBomj have you tried editing the ahk ? there's a line called "appname" that checks for application window
@@b.8127 tried but still the character just moves in the direction of the mouse while pressing WASD and not as it should
any updates on this ?
i cant use basic skill slot anything i bind to it when pressed acts as a move button
Did you turn off 'Combine Move/Interact/Basic skill slot'?
@@HighWindd87 i have turned off that setting still not sure what i am doing wrong. i can still use basic skill slot just that when pressed it moves me to that location even if i am hovered over an enemy. that might be what is intended though
@@cameronbirnie3061 You can try adding a line into the code to do very simple debugging. Search for CallClick function and at the end of it, after ControlClick and before curly bracked add 'SoundBeep' line (without apostrophe):
CallClick(coord)
{
Global
If !WinActive(appName)
return
xCoord := coord.x
yCoord := coord.y
ControlClick, x%xCoord% y%yCoord%, A,, L, 1, NA
SoundBeep
}
This will make a beeping sound every time the script enforces movement click (sound takes approx 0.5 sec, so script will become laggy when movement buttons are spammed). But you'll be able to at least learn whether the script is the source of unwanted movement. You'll hear the beep if it is. If it's not, then I have no clue what's going on. If you have programmable mouse or keyboard try replacing them temporarily with something more basic. Maybe one of them loads predefined preset for D4 that somehow binds back the skill and the movement.
How can I not select anything in the key assignments?
I am not sure how to do it directly. But there is a workaround. Let's say you want to unbind 'A' completely. Use it as a secondary bind somewhere, then replace it with primary bind of that thing.
Wonderful script. I made a minor tweak and it does amazing for me.
If you change from control click with LMB to MMB (use ControlClick, x%xCoord% y%yCoord%, A,, M, 1, NA --------instead of ControlClick, x%xCoord% y%yCoord%, A,, L, 1, NA) for each instance of control click then bind move or force move (depending on how you'd like to bind your keys) you free up your LMB to use for primary attack as it is by default.
I personally keep Combine Move/Interact/Basic Skill Slot turned on now myself so I bind the MMB to force move, but it works when binding it to move as well if you're not combining. I'm amazed with how well this script works, and with the slight tweak I made I can hardly even tell I'm running a script to play.
Damn, this is great idea, but I can't implement it on my side. For some reason, when I use any other mouse button than LMB, the movement works, but the character is always advancing towards the cursor, which breaks the direction control. Probably I am missing some in game setting...
I'm curious as to what your settings are as well. Can you post an image of it somewhere?
@cryptichigh5517 I'm assuming this is happening after changing ControlClick commands to M or R. In that case, it's happening for me too and I dunno why. Because of that, I am using LMB for ControlClick (in script) and to move (in game option), spacebar for the primary skill, F for interaction. I do not use LMB in game at all...
But if the character follows the cursor even for ControlClick binded with L mouse button, then I have no idea how to help you :/ The only thing that comes to mind (but it's a stretch nonetheless) is that maybe you are using some gaming mouse software/drivers and it interferes with AHK.
@@drr7774 I ended up changing it to Right button, then using logitech ghub to switch middle click with right click. The only slight problem is that the icons are wrong in he toolbar.
pls share your script
I am a Chinese language player
The name of the game window has the symbol "《》"
Can't seem to be read by AHK
Do you have any solution?
thank you
Hi there, try to change the parameter of SetTitleMatchMode from 3 to 2 (www.autohotkey.com/docs/v1/lib/SetTitleMatchMode.htm). It will change behavior of how AHK searches for windows, and will stop looking for exact name, but instead will search for anything that contains given string of characters. But be careful as it may aim for wrong window if you will have for example a web page opened with a string "Diablo IV" somewhere in the title.
@@HighWindd87 ok it works! thx u very much
I'm looking to try this out. Is there any way this is bannable?
There is a possibility, yes. More details in readme section of the code.
Can you explain how to do this??
Do what exactly? There is a link in the description, it points to GitHub repository where the necessary files are. There is a readme file there. Check out the 'Installation' paragraph in it.
Did you ever get banned? I want to use it but I hesitant
No. Played for few hundred hours.
i hope blizzard adds WASD to the game... RSI would be grateful.
I have no idea you can send mouse click signals without actually moving your mouse there, that's kinda crazy.
Me neither. Standard AHK Click command does actually move mouse. But ControlClick can somehow bypass this. I'm guessing it is sending winapi click message to given control and how control reacts to such message without mouse hovered over is up to devs. Thankfully D4 doesn't mind this :)
Your script + Logitech g502
Makes it feel like native (wasd) you can make middle mouse = right click and right click a skill
can someone share the script ?
Don't you see the links in the video's description?
can you share the script plz? that looks awesome.!
I am not comfortable with sharing it yet. First of all it's written abhorrently ;). Secondly, I am not even sure if it's legal and if you won't get banned for using it in a full game. But I can help with explaining how it works. I've created a post on official Diablo IV forum to ask about the legality of using it. Probably will have to write to Blizzard support directly though.
@@HighWindd87 please go ahead with this project please!!!
@@HighWindd87 Please inform us when they answer
@@atakan5909 They did already. But they respectfully evaded the question, really. They said that they can't help me with the dilemma of the script legality. But if they don't know, then who? I predict they might have evaded the question for potential legal reasons. I will try to share the code before the game release. I'm going to tweak and test it in Diablo 3 first.
@@HighWindd87 - I want to port the Source to C# and open source my version. Any chance you can DM me the script so I can port it over? I am very interested in how you got the movement to interact with the LMB to directional it while controlling the mouse. I am guessing postmessage, but I could be wrong?
it is a shame that d4 has a better experience with a controller then a mouse
Honestly
hello ~!Can I use it on Diablo 2?
If you reprogram it accordingly, then it should be worth a try.
well, download links? Script link?
Link is in the description. Another one, probably more advanced is here:
github.com/ExploreTheFloor/KeyToMouse
@@HighWindd87 Uzywasz to caly czas? Nie ma bana do tej pory?
@@pandzior2801 Nie gram jeszcze. Jutro zacznę.