PS4 LED flash instead of rumble
8 posts
• Page 1 of 1
PS4 LED flash instead of rumble
Does anyone have code for flashing the PS4 controller LED when activating a mod? I don't have rumbles in any of my controllers and I would like to have the led flash different colors for each mod I activate.
I just need a combo code. So instead of
combo RUMBLE_ON {
ffb_set(FFB_1, 66.0, 320);
wait(0); wait(320);
It would flash less. code for 6 different colors would be nice, but i'll take one that I can use universally to know that a mod activated or deactivated.
I just need a combo code. So instead of
combo RUMBLE_ON {
ffb_set(FFB_1, 66.0, 320);
wait(0); wait(320);
It would flash less. code for 6 different colors would be nice, but i'll take one that I can use universally to know that a mod activated or deactivated.
Trying to teach myself how to program these scripts even though I'm old
-
umpmanjoe - First Sergeant
- Posts: 45
- Joined: Mon May 25, 2015 1:23 am
Re: PS4 LED flash instead of rumble
- Code: Select all
bool toggle;
main {
//hit triangle or Y button to test
if(event_active(BUTTON_14)) {
toggle = !toggle;
if(toggle) {
// Blink LED_1 10 times and then stop
led_vmset(LED_1, 250, 250, 10);
}
}
}
Here is example to test!
- bonefisher
- Lieutenant General
- Posts: 5413
- Joined: Thu Jan 29, 2015 10:49 am
Re: PS4 LED flash instead of rumble
this is perfect. How do you get it to return to the original color after flashing? Basically I would want it to flash 5 times (I figured out how to do that) and then return to the previous color or any any other color
Trying to teach myself how to program these scripts even though I'm old
-
umpmanjoe - First Sergeant
- Posts: 45
- Joined: Mon May 25, 2015 1:23 am
Re: PS4 LED flash instead of rumble
umpmanjoe wrote:this is perfect. How do you get it to return to the original color after flashing? Basically I would want it to flash 5 times (I figured out how to do that) and then return to the previous color or any any other color
To reset it: use led_reset ;-)
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
Re: PS4 LED flash instead of rumble
Scachi wrote:umpmanjoe wrote:this is perfect. How do you get it to return to the original color after flashing? Basically I would want it to flash 5 times (I figured out how to do that) and then return to the previous color or any any other color
To reset it: use led_reset ;-)
Thanks. What wound that line of code look like? Do you put it right below the other code? Sorry, but I’m completely new at this.
Would it be this?
led_vmset(LED_1, 250, 250, 55);
led_reset;
Trying to teach myself how to program these scripts even though I'm old
-
umpmanjoe - First Sergeant
- Posts: 45
- Joined: Mon May 25, 2015 1:23 am
Re: PS4 LED flash instead of rumble
It should be something like this:
- Code: Select all
bool toggle;
main {
//hit triangle or Y button to test
if(event_active(BUTTON_14)) {
toggle = !toggle;
if(toggle) {
// Blink LED_1 10 times and then stop
led_vmset(LED_1, 250, 250, 10);
} else {
led_reset();
}
}
}
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
Re: PS4 LED flash instead of rumble
J2Kbr wrote:It should be something like this:
- Code: Select all
bool toggle;
main {
//hit triangle or Y button to test
if(event_active(BUTTON_14)) {
toggle = !toggle;
if(toggle) {
// Blink LED_1 10 times and then stop
led_vmset(LED_1, 250, 250, 10);
} else {
led_reset();
}
}
}
Actually just looked at this and it doesn't work at all like it should....
- bonefisher
- Lieutenant General
- Posts: 5413
- Joined: Thu Jan 29, 2015 10:49 am
Re: PS4 LED flash instead of rumble
alright, this should work as requested in the first post.
- Code: Select all
bool toggle;
main {
if(event_active(BUTTON_14)) {
toggle = !toggle;
if(toggle) modEnabled(6);
}
}
////////////////////////////////////////////////////////////////////////////////
bool blinking;
void modEnabled(uint8 no) {
led_reset();
if(no & 0x01) led_vmset(LED_1, 250, 250, 4);
if(no & 0x02) led_vmset(LED_2, 250, 250, 4);
if(no & 0x04) led_vmset(LED_3, 250, 250, 4);
blinking = TRUE;
}
main {
if(blinking && !led_vmget(LED_1) && !led_vmget(LED_2) && !led_vmget(LED_3)) {
led_reset();
blinking = FALSE;
}
}
////////////////////////////////////////////////////////////////////////////////
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
8 posts
• Page 1 of 1
Return to GPC2 Script Programming
Who is online
Users browsing this forum: midg3t2 and 78 guests