Can't MouseGetPos/MouseMove properly in an old 3D game

Ask gaming related questions (AHK v1.1 and older)
Kaligula
Posts: 1
Joined: 28 Jan 2023, 11:10

Can't MouseGetPos/MouseMove properly in an old 3D game

Post by Kaligula » 29 Jan 2023, 14:35

(AutoHotkey v1.1 & v2.0)

I was trying to MouseMove in an old 3D game ("Harry Potter and the Sorcerer's Stone") playing in screen resolution 640x480. but the resulting mouse movement pattern was FAR from what I programmed. And I don't say about moving character's view or moving the character – it was a 2D move during a spell exam on flat surface (like writing on a blackboard). I tried DllCall("SetCursorPos", …), too. Let's say it was a rectangle, because I also tried that:

Code: Select all

CoordMode "Mouse", "Screen"
q::
{
	DllCall("SetCursorPos", "int", 10, "int", 10)
	Sleep 400
	DllCall("SetCursorPos", "int", 10, "int", 470)
	Sleep 400
	DllCall("SetCursorPos", "int", 630, "int", 470)
	Sleep 400
	DllCall("SetCursorPos", "int", 630, "int", 10)
	Sleep 400
	return
}
and the shape created by the code above was an L shape but drawn from bottom right to upper left direction.

I also tried collecting MouseGetPos (every 1 sec, for 10 secs while moving mouse around) but I always got coords around (320±few pixels,250±few pixels).

Is there anything else I can try?

I know that at this stage it becomes easier to skill the game than skill the code, but I'm curious and furious. ;)

User avatar
mikeyww
Posts: 26604
Joined: 09 Sep 2014, 18:38

Re: Can't MouseGetPos/MouseMove properly in an old 3D game

Post by mikeyww » 29 Jan 2023, 22:50

Welcome to this AutoHotkey forum!
The resulting mouse movement pattern was FAR from what I programmed.
The screen itself has only two dimensions, so "3D" has no real meaning. You can use the default coordinate mode (window) to test your MouseMove command. Start with (0, 0), which is the top left corner of the active window. After that, you could try (100, 100) and (200, 200). The coordinates would work with whatever resolution is active. Of course, your program (game) can move the mouse as well.

Post Reply

Return to “Gaming Help (v1)”