Script for mouse / mlb the show , video inside.

GPC1 script programming for Titan One. Code examples, questions, requests.

Script for mouse / mlb the show , video inside.

Postby kiet510 » Wed Apr 18, 2018 2:32 am

Mouse acts as left analog stick, lets say for example aiming the cursor. Playing on the controller , if you hold down the left analog in a certain direction, you have to hold it there with your finger in order to keep it in that place/spot. If you let go of left analog stick, the crosshair reverts back to middle of the box. The game I'm talking about is MLB the show zone hitting, is there a way to create a script to imitate what we do on the ps4 controller left analog stick? for example if I look down with the mouse , can it act as if i'm holding down the left analog stick in that direction? b/c like i mentioned , on the controller as soon as you let go of the left analog, crosshair goes back to dead center. Is this even possible? Sorry if I said the same thing twice.
Last edited by kiet510 on Wed Apr 18, 2018 7:53 pm, edited 1 time in total.
User avatar
kiet510
Command Sergeant Major
Command Sergeant Major
 
Posts: 175
Joined: Sat Jan 03, 2015 5:17 am

Re: Script for mouse / mlb the show

Postby kiet510 » Wed Apr 18, 2018 7:47 pm

Please watch these short clips showing you what I mean. First video shows using left analog stick on ps4 controller. Very smooth.

[YouTube]https://youtu.be/A7tHTqUNReE[/YouTube]

Bottom video shows using T1 with mouse , very choppy..

[YouTube]https://youtu.be/B1hcEBSC_wA[/YouTube]

Video 1
https://youtu.be/A7tHTqUNReE
Video 2
https://youtu.be/B1hcEBSC_wA
User avatar
kiet510
Command Sergeant Major
Command Sergeant Major
 
Posts: 175
Joined: Sat Jan 03, 2015 5:17 am

Re: Script for mouse / mlb the show , video inside.

Postby J2Kbr » Fri Apr 20, 2018 8:19 am

You can improve the mouse movement by adjusting the deadzone, based in your video try reduce the deadzone.
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Script for mouse / mlb the show , video inside.

Postby kiet510 » Fri Apr 20, 2018 11:08 pm

Hello.,

Deadzone helped expand the window of limit the window to move around, but it doesn't imitate holding down the left stick in a certain direction. Is that possible with help of a script?
User avatar
kiet510
Command Sergeant Major
Command Sergeant Major
 
Posts: 175
Joined: Sat Jan 03, 2015 5:17 am

Re: Script for mouse / mlb the show , video inside.

Postby J2Kbr » Tue Apr 24, 2018 7:06 am

kiet510 wrote:Is that possible with help of a script?

Yes, the script below will retain the last x, y position right after the mouse stops move.
Code: Select all
int x, y;
 
main {
    if(get_val(PS4_RX)) {
        x = get_val(PS4_RX);
    } else {
        set_val(PS4_RX, x);
    }
    if(get_val(PS4_RY)) {
        y = get_val(PS4_RY);
    } else {
        set_val(PS4_RY, y);
    }
}
 
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Script for mouse / mlb the show , video inside.

Postby kiet510 » Thu Apr 26, 2018 7:03 am

Hello J2K,

Thanks for reply. I changed everything to LX and and LY since it is for left analog stick. I tried the script on my mouse and it still does the same problem, stutters and doesnt stay in one spot when i pull down for example. I tested it on the controller with the script and it just feels like a normal controller where left analog functions correctly, but doesn't do the same on the mouse..
User avatar
kiet510
Command Sergeant Major
Command Sergeant Major
 
Posts: 175
Joined: Sat Jan 03, 2015 5:17 am

Re: Script for mouse / mlb the show , video inside.

Postby kiet510 » Thu Apr 26, 2018 7:11 am

Feels like the script isnt doing anything, i think the script is running without errors correctly, any other ideas?
User avatar
kiet510
Command Sergeant Major
Command Sergeant Major
 
Posts: 175
Joined: Sat Jan 03, 2015 5:17 am

Re: Script for mouse / mlb the show , video inside.

Postby J2Kbr » Thu Apr 26, 2018 10:51 am

Okay, maybe the controller resting values are not zero, causing the script to have no effect.
Please check if this will work:
Code: Select all
int x, y;
 
main {
    if(abs(get_val(PS4_RX)) > 15) {
        x = get_val(PS4_RX);
    } else {
        set_val(PS4_RX, x);
    }
    if(abs(get_val(PS4_RY)) > 15) {
        y = get_val(PS4_RY);
    } else {
        set_val(PS4_RY, y);
    }
}
 
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Script for mouse / mlb the show , video inside.

Postby kiet510 » Fri Apr 27, 2018 2:28 am

J2K, do I change eerything to LX and LY? its for left analog stick.
User avatar
kiet510
Command Sergeant Major
Command Sergeant Major
 
Posts: 175
Joined: Sat Jan 03, 2015 5:17 am

Re: Script for mouse / mlb the show , video inside.

Postby kiet510 » Fri Apr 27, 2018 2:53 am

it doesn't seem to work, here is a video with the script.. still doesn't stay still

[YouTube]https://youtu.be/B7sgO1zwXRk[/YouTube]

https://youtu.be/B7sgO1zwXRk
User avatar
kiet510
Command Sergeant Major
Command Sergeant Major
 
Posts: 175
Joined: Sat Jan 03, 2015 5:17 am

Next

Return to GPC1 Script Programming

Who is online

Users browsing this forum: No registered users and 53 guests