Vibration script request - plz halp

GPC2 script programming for Titan Two. Code examples, questions, requests.

Vibration script request - plz halp

Postby XimDragon » Sat Nov 20, 2021 11:53 pm

:cry:

Hello gentlemen.

I'd like to request a script for my titan two.

I want the script to press a button (XB1_LB) when I'm shot in call of duty, based on vibration.

It's possible to program a button press to be expecuted if vibration occurs, correct? It would also be nice if the vibration didn't actually happen in the physical world, it's only needed to facilitate the programming of a reaction - LB would bring up an exo shield in advanced warfare, but it could also be used with another button in games like BO4 for auto-stim, or for any evasive/defensive maneuvers in other games, so THIS WOULD HELP OUT A LOT OF PEOPLE I THINK.

Much thanks in advance if you can figure it out.

Sincerely, Dragon
User avatar
XimDragon
Corporal
Corporal
 
Posts: 5
Joined: Sat Nov 20, 2021 11:47 pm

Re: Vibration script request - plz halp

Postby Mad » Sun Nov 21, 2021 2:47 am

The vibration value when being shot is not unique so it'll trigger constantly.
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: Vibration script request - plz halp

Postby XimDragon » Sun Nov 21, 2021 10:15 am

Mad wrote:The vibration value when being shot is not unique so it'll trigger constantly.


I understand that, I'd just like someone to create the script for me (and I think it would help others as well) as I'm a lamer at programming even the simplest things :ashamed:

So I'd just like for a button (XB1-LB, but I can replace the button in the script if needed, that much I can do) to be pressed when the non-unique event of vibration from getting shot is occuring.

The idea is, you get shot, an action gets taken automatically to mitigate the damage you'd take. It doesn't have to be based on the vibration's strength, nor is it a problem if it interfere's with other codes of vibration feedbacks, should someone be using those in other lines of the script.

Am I missing something? Please elaborate.

Edit: I get that it might be sub-optimal to some if it triggers constantly, but it can still be useful... if I'm getting shot I might want the evasive action to be prioritised over any other action, like returning fire. I'd just love this script please :smile0517:

Edit2: The way I see it, the basic script examples on consoletuner only refer to vibrating (rumble) when your controller initiates it as feedback to your own trigger press (they make anti recoil using this), or when you tell the controller to vibrate with a script commend. But what I'm looking for here is for the vibration occuring from events in the game (getting shot) being detected and reacted to by the titan two, like so: "if" [controller vibrates] then [execute button press]. Again, more than fine if it's constantly getting triggered, I just hope this is possible?
User avatar
XimDragon
Corporal
Corporal
 
Posts: 5
Joined: Sat Nov 20, 2021 11:47 pm

Re: Vibration script request - plz halp

Postby Mad » Sun Nov 21, 2021 10:37 am

Code: Select all
#define FFB1 ffb_get_actual(FFB_1, NULL)
#define FFB2 ffb_get_actual(FFB_2, NULL)
 
main { if(FFB1 || FFB2) combo_run(PressLB); }
 
combo PressLB {
    set_val(BUTTON_7, 100);
    wait(60); wait(60);
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: Vibration script request - plz halp

Postby XimDragon » Sun Nov 21, 2021 2:56 pm

All right, I've tried it out!

Seems to work, so thanks, but I see the problem now! Even exo jumping and most importantly, shooting creates rumble. So my shield gets up during jumps or shots that I'm doing, which is undesirable.

So my question is, is there no way to distinguish rumble from getting shot from rumble that I initiate by shooting? Could they possibly not have different strength levels?

Even if not, would it not be possible to add code that looks for an "RT" (shooting) or "A" (jump) command, and disable the script while they are being used? Although I guess this would be a lot of work...
User avatar
XimDragon
Corporal
Corporal
 
Posts: 5
Joined: Sat Nov 20, 2021 11:47 pm

Re: Vibration script request - plz halp

Postby Mad » Sun Nov 21, 2021 9:46 pm

Code: Select all
#define FFB1 ffb_get_actual(FFB_1, NULL)
#define FFB2 ffb_get_actual(FFB_2, NULL)
 
main {
    if(check_release(BUTTON_16, 800) && is_release(BUTTON_5)) {
        if(FFB1 || FFB2) combo_run(PressLB);
    }
}
 
combo PressLB {
    set_val(BUTTON_7, 100);
    wait(60); wait(60);
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: Vibration script request - plz halp

Postby XimDragon » Mon Nov 22, 2021 6:25 pm

Oh snap, santa came early this year! I'll try it out soon.
User avatar
XimDragon
Corporal
Corporal
 
Posts: 5
Joined: Sat Nov 20, 2021 11:47 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 66 guests