Script request: PS4 swipe NSWE (Ghost of Tsushima)
6 posts
• Page 1 of 1
Script request: PS4 swipe NSWE (Ghost of Tsushima)
Hi there,
Would someone be able to make a script that swipes up, down, left and right when pressing extra button 1, 2 etc...?
Would really help me out!
Thanks in advance!
Would someone be able to make a script that swipes up, down, left and right when pressing extra button 1, 2 etc...?
Would really help me out!
Thanks in advance!
-
Sando - Staff Sergeant
- Posts: 13
- Joined: Fri Jul 21, 2017 9:44 pm
Re: Script request: PS4 swipe NSWE (Ghost of Tsushima)
Please provide more detail,
You are welcome in advanced
You are welcome in advanced
-
DontAtMe - Captain
- Posts: 502
- Joined: Tue Oct 02, 2018 4:49 am
Re: Script request: PS4 swipe NSWE (Ghost of Tsushima)
For example, if I press extra button 1, the titan one should send a swipe up from the touchpad. if I press extra button 2, the titan one should send a swipe down from the touchpad. if I press extra button 3, the titan one should send a swipe left from the touchpad. if I press extra button 4, the titan one should send a swipe right from the touchpad.
I hope you know what I mean now
I hope you know what I mean now
-
Sando - Staff Sergeant
- Posts: 13
- Joined: Fri Jul 21, 2017 9:44 pm
Re: Script request: PS4 swipe NSWE (Ghost of Tsushima)
Here is an example on how emulate swipe actions with the Titan One:
- Code: Select all
int valX, incX;
int valY, incY;
main {
if(event_press(PS4_TRIANGLE)) { // SWIPE UP
valX = 0;
incX = 0;
valY = -100;
incY = 10;
} else if(event_press(PS4_CROSS)) { // SWIPE DOWN
valX = 0;
incX = 0;
valY = 100;
incY = -10;
} else if(event_press(PS4_SQUARE)) { // SWIPE LEFT
valX = -100;
incX = 10;
valY = 0;
incY = 0;
} else if(event_press(PS4_CIRCLE)) { // SWIPE RIGHT
valX = 100;
incX = -10;
valY = 0;
incY = 0;
}
if(incX || incY) {
if(abs(valX) > 100 || abs(valY) > 100) {
incX = 0;
incY = 0;
} else {
combo_run(SwipeEmulator);
}
}
}
combo SwipeEmulator {
ps4_set_touchpad(valX, valY);
wait(10);
ps4_set_touchpad(valX, valY);
if(incX) valX = valX + incX;
if(incY) valY = valY + incY;
}
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
Re: Script request: PS4 swipe NSWE (Ghost of Tsushima)
You learn something new every day
What would be the Titan Two (GPC2) equivalent of this code?
I can see a use for this in other games when pairing T2 with a XIM APEX, which doesn't support touchpad swipes.
What would be the Titan Two (GPC2) equivalent of this code?
I can see a use for this in other games when pairing T2 with a XIM APEX, which doesn't support touchpad swipes.
-
antithesis - Colonel
- Posts: 1912
- Joined: Sat May 28, 2016 10:45 pm
Re: Script request: PS4 swipe NSWE (Ghost of Tsushima)
antithesis wrote:You learn something new every day
What would be the Titan Two (GPC2) equivalent of this code?
I can see a use for this in other games when pairing T2 with a XIM APEX, which doesn't support touchpad swipes.
With the Titan Two would be something like this:
- Code: Select all
#include <ps4.gph>
fix32 valX, incX;
fix32 valY, incY;
main {
if(event_active(PS4_TRIANGLE)) { // SWIPE UP
valX = 0.0;
incX = 0.0;
valY = -100.0;
incY = 10.0;
} else if(event_active(PS4_CROSS)) { // SWIPE DOWN
valX = 0.0;
incX = 0.0;
valY = 100.0;
incY = -10.0;
} else if(event_active(PS4_SQUARE)) { // SWIPE LEFT
valX = -100.0;
incX = 10.0;
valY = 0.0;
incY = 0.0;
} else if(event_active(PS4_CIRCLE)) { // SWIPE RIGHT
valX = 100.0;
incX = -10.0;
valY = 0.0;
incY = 0.0;
}
if(incX || incY) {
if(abs(valX) > 100.0 || abs(valY) > 100.0) {
incX = 0.0;
incY = 0.0;
} else {
combo_run(SwipeEmulator);
}
}
}
combo SwipeEmulator {
set_val(POINT_1_X, valX);
set_val(POINT_1_Y, valY);
set_val(BUTTON_19, 100.0);
wait(10);
set_val(POINT_1_X, valX);
set_val(POINT_1_Y, valY);
set_val(BUTTON_19, 100.0);
if(incX) valX = valX + incX;
if(incY) valY = valY + incY;
}
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
6 posts
• Page 1 of 1
Return to GPC1 Script Programming
Who is online
Users browsing this forum: No registered users and 89 guests