Vampire: The Masquerade - Bloodlines

Vampire: The Masquerade - Bloodlines

Here's a mod I made to fix the Win10 mouse bug
Description of the bug:

When using the current version of Windows 10, the game stops responding to certain input, when the mouse buttons are clicked, until the mouse moves. It makes you unable to continuously attack or spam the same discipline without moving the mouse, breaking melee combos, and causing firearms to be stuck shooting.

Why it happens:

I don't know exactly. The game does a terrible job at handling input, it actually relies on standard windows messaging, instead of using one of the input APIs. When it receives a WM_LBUTTONUP or WM_RBUTTONUP message, it's WindowProc gets stuck, until it receives WM_MOUSEMOVE. It may be a Windows issue, or it may as well rely on some ancient bug Windows has recently fixed.

How this mod works:

I'm not a programmer, I have no idea how to properly fix it. What I did is hijacked its WindowProc, and whenever it receives the above mentioned messages, the mod fakes some momentarily mouse movement. It does not actually move the mouse, it's fake, but it gets the WindowProc unstuck, like real mouse movement.

How to install:

Just drop the extracted dinput8.dll into the main game directory, next to vampire.exe.

Mod compatibility:

It should not affect any mods, unless they're also implemented as a dinput8.dll hook. Note that the game relies on the title of the main game window, and if any other mod changes it, or it differs in localized versions, the game will get into an infinite loop. It is fixable, but at this point I don't know if it's worth the effort.

Known issues:
Nothing I know of, though I did not do thousands of hours of testing. The game seems to work just like in older versions of Windows. Of course, unexpected things may happen, as always. If you don't experience the bug, do not install this mod.

Download link:
https://drive.google.com/file/d/1L6l_1qTb3o8tnghfVqOpBurvm3QOf-6a/view?usp=sharing

Source code:
https://pastebin.com/JW8r2H5W

Feel free to laugh at my code quality, feel free to share it, steal it, improve it, any way you see fit.
< >
Showing 1-13 of 13 comments
Wesp5 21 Dec, 2017 @ 11:45am 
I can't really say if this works as I am on Windows 7, but just in case I want to include this in the next UP beta if you don't mind. I'll create a text file with the content of this post to explain it.
Last edited by Wesp5; 21 Dec, 2017 @ 11:46am
Dusk of Oolacile 22 Dec, 2017 @ 7:24am 
Originally posted by wesp5:
I can't really say if this works as I am on Windows 7, but just in case I want to include this in the next UP beta if you don't mind. I'll create a text file with the content of this post to explain it.
Feel free to include it, though I suggest you only include it for win10 users, as an optional component.
Wesp5 22 Dec, 2017 @ 8:45am 
Originally posted by Dusk of Oolacile:
I suggest you only include it for win10 users, as an optional component.

Yes, it will be in the Extras/Player Mods folder.
Last edited by Wesp5; 22 Dec, 2017 @ 10:41am
Drifter 26 Dec, 2017 @ 12:12am 
Nice job OP.
Konstantin 26 Dec, 2017 @ 6:42am 
Well it does not fix it entirely bot it is with it playable again.
JefferyNothing 28 Dec, 2017 @ 5:30am 
Wow wish id know of this before i soaked in the 25 hours to complete it with this bug haha

I remember it being there on XP too when the game came out

EDIT: it works, nice one man
Last edited by JefferyNothing; 28 Dec, 2017 @ 5:52am
BrotherCaine1111 28 Dec, 2017 @ 5:43pm 
Originally posted by Dusk of Oolacile:
Description of the bug:

When using the current version of Windows 10, the game stops responding to certain input, when the mouse buttons are clicked, until the mouse moves. It makes you unable to continuously attack or spam the same discipline without moving the mouse, breaking melee combos, and causing firearms to be stuck shooting.

Why it happens:

I don't know exactly. The game does a terrible job at handling input, it actually relies on standard windows messaging, instead of using one of the input APIs. When it receives a WM_LBUTTONUP or WM_RBUTTONUP message, it's WindowProc gets stuck, until it receives WM_MOUSEMOVE. It may be a Windows issue, or it may as well rely on some ancient bug Windows has recently fixed.

How this mod works:

I'm not a programmer, I have no idea how to properly fix it. What I did is hijacked its WindowProc, and whenever it receives the above mentioned messages, the mod fakes some momentarily mouse movement. It does not actually move the mouse, it's fake, but it gets the WindowProc unstuck, like real mouse movement.

How to install:

Just drop the extracted dinput8.dll into the main game directory, next to vampire.exe.

Mod compatibility:

It should not affect any mods, unless they're also implemented as a dinput8.dll hook. Note that the game relies on the title of the main game window, and if any other mod changes it, or it differs in localized versions, the game will get into an infinite loop. It is fixable, but at this point I don't know if it's worth the effort.

Known issues:
Nothing I know of, though I did not do thousands of hours of testing. The game seems to work just like in older versions of Windows. Of course, unexpected things may happen, as always. If you don't experience the bug, do not install this mod.

Download link:
https://drive.google.com/file/d/1L6l_1qTb3o8tnghfVqOpBurvm3QOf-6a/view?usp=sharing

Source code:
https://pastebin.com/JW8r2H5W

Feel free to laugh at my code quality, feel free to share it, steal it, improve it, any way you see fit.
Dude, Thank you so much! I felt like WIn 10 users are f'ed. Thanks!
Crystal 29 Dec, 2017 @ 8:56am 
i've done everything and it doesnt work. i even uninstalled some mods incase they were conflicting, but still, nothing. can you help me please?
Alvarun 29 Dec, 2017 @ 4:21pm 
I dont even have VTMB in Steam , but a I had to come here to say DUDE I LOVE YOU
Almost ask refund in GoG because of this annoying bug and now it will be just fun and pleasure <3
JefferyNothing 1 Jan, 2018 @ 12:51pm 
This fix should be included in the unofficial patch
Wesp5 2 Jan, 2018 @ 4:58am 
Originally posted by Hazuki:
This fix should be included in the unofficial patch

It already is, see some postings above...
JefferyNothing 3 Jan, 2018 @ 1:22pm 
Good, just making sure...
Yodowathy 10 Mar, 2018 @ 9:39pm 
For me problem still exists. I did place appropriate file in vampire main folder but still cant click couple of times without moving a mouse. It seems that the only option remained is to set attack button on keybord...
< >
Showing 1-13 of 13 comments
Per page: 1530 50

Date Posted: 21 Dec, 2017 @ 7:13am
Posts: 13