Character movement within a limited space or a specific route.

Ask gaming related questions
Seasona
Posts: 2
Joined: 07 Feb 2024, 18:56

Character movement within a limited space or a specific route.

Post by Seasona » 07 Feb 2024, 19:00

Hello,

I've been working on a certain topic for days and couldn't solve it, so I'm requesting help from you. I want to keep a game character within a limited area using Autohotkey and perform attacks only within this area. The reason for this is that the character moves from one creature to another without any specific area limitation or route, and it can travel far away from the starting point, potentially exploring the entire map.

My goal is to define a route or an area and make the character attack under these conditions. If it deviates from the route or area, I want it to return to this specified location. The problem is that I preferred to define a reference point for this, so I obtained mouse coordinates. However, since the character moves with W, A, S, D keys and the mouse icon remains fixed, the x and y coordinate planes do not change even if the character moves. Therefore, the starting coordinate information does not become a unique reference.

Without coordinates, I also tried image search and pixel search techniques, but they were quite unsuccessful. I just want to learn from you how I can move a character in a limited area or on a defined route. Despite much thought, I couldn't reach a logic or algorithm on this matter.

Thank you in advance for your assistance."


[Mod action: Topic moved to the "Gaming" section.]

Rohwedder
Posts: 7750
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Character movement within a limited space or a specific route.

Post by Rohwedder » 08 Feb 2024, 00:51

Hallo,
does the game character always move the same distance per W, A, S, D key event?
If so, limiting the amount of the (W-S) or (A-D) key events would work.

Seasona
Posts: 2
Joined: 07 Feb 2024, 18:56

Re: Character movement within a limited space or a specific route.

Post by Seasona » 08 Feb 2024, 05:03

Rohwedder wrote:
08 Feb 2024, 00:51
Hallo,
does the game character always move the same distance per W, A, S, D key event?
If so, limiting the amount of the (W-S) or (A-D) key events would work.
If I understood your question correctly... unfortunately, it doesn't cover the same distance because it starts attacking a creature as soon as it presses the skills, then moves on to another one, thus starting to explore the entire map and eventually dying.

Post Reply

Return to “Gaming”