Any ideas why this AR script doesn't work on T2 + XIM4?

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

Any ideas why this AR script doesn't work on T2 + XIM4?

Postby pablosscripts » Tue Oct 04, 2016 11:51 pm

It worked fine on T1 + XIM4:

Code: Select all


bool ONLY_WITH_SCOPE = TRUE;
bool AntiRecoilON = TRUE;

#define ANTI_RECOIL_1                  1
#define ANTI_RECOIL_2                  2
#define ANTI_RECOIL_3                  3
#define ANTI_RECOIL_4                  4
#define ANTI_RECOIL_5                  5
int anti_tmp;
int anti_recoil;
int anti_recoil_left;
int anti_recoil_right;


if(get_val(SECONDARY)) {
        if(event_active(RAPID_FIRE)) {
            SetAntiRecoilMode(ANTI_RECOIL_1);
        } else if(event_active(PING)) {
            SetAntiRecoilMode(ANTI_RECOIL_2);
        } else if(event_active(CAMERA)) {
            SetAntiRecoilMode(ANTI_RECOIL_3);
        } else if(event_active(DRONE)) {
            SetAntiRecoilMode(ANTI_RECOIL_4);
        } else if(event_active(VAULT)) {
            SetAntiRecoilMode(ANTI_RECOIL_5);
        }
    }
    if(!ONLY_WITH_SCOPE || get_val(SHOOT)) { combo_run(AntiRecoil); }
    if((int) get_val(10) < -20) { combo_stop(AntiRecoil); }
    if((int) get_val(9) < -20) { combo_stop(AntiRecoil); }
    if((int) get_val(10) > 20) { combo_stop(AntiRecoil); }
    if((int) get_val(9) > 20) { combo_stop(AntiRecoil); }


void SetAntiRecoilMode(int m) {
    if(m == ANTI_RECOIL_1) {
        anti_recoil = 30;
        anti_recoil_left = 0;
        anti_recoil_right = 0;
    } else if(m == ANTI_RECOIL_2) {
        anti_recoil = 40;
        anti_recoil_left = 0;
        anti_recoil_right = 0;
    } else if(m == ANTI_RECOIL_3) {
        anti_recoil = 45;
        anti_recoil_left = 0;
        anti_recoil_right = 0;
    } else if(m == ANTI_RECOIL_4) {
        anti_recoil = 50;
        anti_recoil_left = 0;
        anti_recoil_right = 0;
    } else if(m == ANTI_RECOIL_5) {
        anti_recoil = 55;
        anti_recoil_left = 0;
        anti_recoil_right = 0;
    }
}
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR

My R6 script: https://youtu.be/x-9NtxyySVM
User avatar
pablosscripts
Brigadier General
Brigadier General
 
Posts: 1976
Joined: Tue Nov 24, 2015 6:27 am

Re: Any ideas why this AR script doesn't work on T2 + XIM4?

Postby Scachi » Wed Oct 05, 2016 1:28 am

get_val(10) <-- shouldn't they be something like --> get_val(BUTTON_10) ?

run this little script, move the d-pad and watch the values of BUTTON_20 & 21 :innocent_smile_1:
Code: Select all
main {
  if((int)get_val(10) < -20) { set_val(BUTTON_20,1); }
  if((int)get_val(9) < -20) { set_val(BUTTON_21,1); }
  if((int)get_val(10) > 20) { set_val(BUTTON_20,2); }
  if((int)get_val(9) > 20) { set_val(BUTTON_21,1); }
}
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Any ideas why this AR script doesn't work on T2 + XIM4?

Postby pablosscripts » Wed Oct 05, 2016 2:15 am

Scachi wrote:get_val(10) <-- shouldn't they be something like --> get_val(BUTTON_10) ?

run this little script, move the d-pad and watch the values of BUTTON_20 & 21 :innocent_smile_1:
Code: Select all
main {
  if((int)get_val(10) < -20) { set_val(BUTTON_20,1); }
  if((int)get_val(9) < -20) { set_val(BUTTON_21,1); }
  if((int)get_val(10) > 20) { set_val(BUTTON_20,2); }
  if((int)get_val(9) > 20) { set_val(BUTTON_21,1); }
}



Oh crap...the numbered indexes (e.g. 10) are no longer supported by T2...right? Boy this could be the source of the problem. I'll be sure to test this when I get home from work!
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR

My R6 script: https://youtu.be/x-9NtxyySVM
User avatar
pablosscripts
Brigadier General
Brigadier General
 
Posts: 1976
Joined: Tue Nov 24, 2015 6:27 am

Re: Any ideas why this AR script doesn't work on T2 + XIM4?

Postby jayjack » Wed Oct 05, 2016 2:37 am

Oh wow, great.
Hope this fixes it
:joia:
User avatar
jayjack
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 284
Joined: Tue Jul 26, 2016 2:41 pm

Re: Any ideas why this AR script doesn't work on T2 + XIM4?

Postby pablosscripts » Wed Oct 05, 2016 2:59 am

jayjack wrote:Oh wow, great.
Hope this fixes it
:joia:


Are you at home? If so I can give you the updated script to test. Otherwise I will test it myself in about 5 hours before sending it to you.
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR

My R6 script: https://youtu.be/x-9NtxyySVM
User avatar
pablosscripts
Brigadier General
Brigadier General
 
Posts: 1976
Joined: Tue Nov 24, 2015 6:27 am

Re: Any ideas why this AR script doesn't work on T2 + XIM4?

Postby lokirevamped » Wed Oct 05, 2016 1:29 pm

If I wanted to give this script a go, what tips can someone give me to test out? I am new to the AR scripts. i would love to test them out. Can you make changes to the values in real time with a combo button press? Thanks in advance.
User avatar
lokirevamped
Lieutenant
Lieutenant
 
Posts: 422
Joined: Tue Jul 29, 2014 8:00 pm

Re: Any ideas why this AR script doesn't work on T2 + XIM4?

Postby pablosscripts » Wed Oct 05, 2016 2:24 pm

Yeah generally you change them with a modifier key, e.g. Reload + dpad button.

But this AR script doesn't seem to work for us unfortunately:(
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR

My R6 script: https://youtu.be/x-9NtxyySVM
User avatar
pablosscripts
Brigadier General
Brigadier General
 
Posts: 1976
Joined: Tue Nov 24, 2015 6:27 am

Re: Any ideas why this AR script doesn't work on T2 + XIM4?

Postby lokirevamped » Wed Oct 05, 2016 6:02 pm

pablogroup wrote:Yeah generally you change them with a modifier key, e.g. Reload + dpad button.

But this AR script doesn't seem to work for us unfortunately:(


Thank You. I will keep my eye on this thread, can't wait to try this one out.
User avatar
lokirevamped
Lieutenant
Lieutenant
 
Posts: 422
Joined: Tue Jul 29, 2014 8:00 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: alanmcgregor and 61 guests