Requesting help with specific Mouse to Joystick script.

Ask gaming related questions
Sylvenia
Posts: 8
Joined: 10 Sep 2018, 16:11

Requesting help with specific Mouse to Joystick script.

12 Sep 2018, 00:07

So it may sound strange but......

What i'm looking for is a script that sets my mouse to the middle of the screen as a neutral x0/y0 position. when i move my joystick, the mouse will move relative to the position of the joystick. My aim for this is to use it for Sacred 2 Gold edition. The idea is this: on console, when you approach an enemy/NPC/chest/etc... you can just push the button and talk without necessarily targeting. My thought is, if the mouse is confined within the vicinity around my character, then targeting is achieved by running my character to what i want to what i want to interact with and push the A button (Left click).
Onimuru
Posts: 14
Joined: 08 Sep 2018, 18:35
GitHub: Onimuru

Re: Requesting help with specific Mouse to Joystick script.

12 Sep 2018, 01:31

This is untested but how I would do it:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Sylvenia
Posts: 8
Joined: 10 Sep 2018, 16:11

Re: Requesting help with specific Mouse to Joystick script.

12 Sep 2018, 12:07

So I tested the script, and I'm unsure if I'm either doing something wrong or the script doesn't work. I took the script and put it in a text document and changed it to .ahk. I ran the game and double clicked the .ahk file to run the script. Nothing seems to happen. I'm new with this type of scripting so it's possible I'm just not doing something correctly. I do appreciate the response.
Onimuru
Posts: 14
Joined: 08 Sep 2018, 18:35
GitHub: Onimuru

Re: Requesting help with specific Mouse to Joystick script.

12 Sep 2018, 14:19

Right click your desktop and create a new AHK file then edit and paste your code inside. Run as admin and make sure you have an AHK icon on your task bar to tell if it's running! You need to modify the code as well, read my comments.
Sylvenia
Posts: 8
Joined: 10 Sep 2018, 16:11

Re: Requesting help with specific Mouse to Joystick script.

12 Sep 2018, 20:41

Ok so I did what the comments say. It does do partially what i want, it moves the mouse to the center of the screen. I was hoping to be able to control the mouse with my joystick on my Xbox One gamepad as well. I've seen the script that allow you to move your mouse with a joystick, but they don't quite do what I'm looking for; they allow you to move the mouse up, down, left and right as you move the joystick. What i'm looking for is; I want the mouse to stay stationary in the center of the screen if i'm not touching the joystick (neutral x0/y0) and if i move the joystick, the mouse moves in relation to where i move the joystick. so if i push the joystick down, the mouse moves down and when i release the joystick it moves back to the middle. or if i push the joystick up and to the right, the mouse moves the same. the idea is that i can move the mouse in a circle around my character in close proximity to my character. i do hope i'm not being too picky because i really do appreciate the help.
Sylvenia
Posts: 8
Joined: 10 Sep 2018, 16:11

Re: Requesting help with specific Mouse to Joystick script.

12 Sep 2018, 20:50

so here's a visual representation of what i'm looking for. imagine that my character is standing in the center of the box in this video and the mouse is the +
https://youtu.be/CxlxlgKqyow
Onimuru
Posts: 14
Joined: 08 Sep 2018, 18:35
GitHub: Onimuru

Re: Requesting help with specific Mouse to Joystick script.

13 Sep 2018, 06:45

Ok, I see I misunderstood you originally. I have no experience with using a controller so I googled it and there was a script already made so this is almost entirely someone else's code, I just made a small addition at the end to reset the cursor to the center of the screen. Obviously I can't test this but it looks like it should do exactly what you want. Read the comments and adjust the variables to your preference.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



You might want to link this to the game window with #IfWinActive ahk_class [gameClass] or build a toggle or your mouse will forever return to the center.

Code: [Select all] [Download] GeSHi © Codebox Plus

^x::SetTimer, WatchJoystick, % ((Toggle_Variable := !Toggle_Variable) ? 10 : "Off")	;Ctrl + x to toggle on/off
Sylvenia
Posts: 8
Joined: 10 Sep 2018, 16:11

Re: Requesting help with specific Mouse to Joystick script.

13 Sep 2018, 22:00

OK so i tried this new script and it keeps crashing (or closing, not sure). i even tried running it as Administrator but no go.
Onimuru
Posts: 14
Joined: 08 Sep 2018, 18:35
GitHub: Onimuru

Re: Requesting help with specific Mouse to Joystick script.

14 Sep 2018, 08:46

I can’t help you any further, I suggest you read the sticky on this sub forum reference controllers or google it, I got a ton of hits.
Sylvenia
Posts: 8
Joined: 10 Sep 2018, 16:11

Re: Requesting help with specific Mouse to Joystick script.

14 Sep 2018, 12:11

ok well thank you for the help.
Sylvenia
Posts: 8
Joined: 10 Sep 2018, 16:11

Re: Requesting help with specific Mouse to Joystick script

17 Sep 2018, 10:43

Welpemarp wrote:Thats gonna be a Problem Because most games reduce walking speed and your FoV when you toggle iron sight. So it would be unplayable. Maybe with some moding you could change this, but then again i.e in Bioshock Infinte Weapons become way more accurate when you use iron sight at least thats what i feel.


Actually i wasn't planning on playing shooter games with this script so that's OK with me. I want to use it to play dungeon crawlers like Diablo 2 or Sacred 2.

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 19 guests