Errors for no reason

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

Errors for no reason

Postby CommanderPro97 » Sat Jan 13, 2018 4:47 pm

I added a new line in three scripts and I got errors. When i deleted the new line the errors still showed up. The script was completely fine (no errors at all) before adding the new line in.

[url]Error's:[/url]
GPC error: Killing Floor 2 [PS4].gpc(42): Declaration syntax error 'combo'
GPC error: WW2.gpc(42): Declaration syntax error 'combo'
GPC error: WW2.gpc(89): Declaration syntax error '('
GPC error: Uncharted 4.gpc(78): Declaration syntax error '('

Code: Select all
 
#pragma METAINFO("<Killing Floor 2 (PS4)>", 1, 0, "")
 
uint8 statusIn,  protocolIn,  deviceIn;
uint8 statusOut, protocolOut, deviceOut;
 
main {
// -------------------------------------------------------------------------- //
// |         Crossover (XB1 Controller and Elite Controller on PS4)         | //
// -------------------------------------------------------------------------- //
    statusIn  = port_status(PORT_USB_A, &protocolIn,  &deviceIn);
    statusOut = port_status(PORT_USB_C, &protocolOut, &deviceOut);
 
    if(protocolIn == PROTOCOL_XB1 || protocolIn == PROTOCOL_XB1_WRC && protocolOut == PROTOCOL_PS4) {
        set_val(BUTTON_18, 0.0);set_val(BUTTON_2, 0.0);set_val(BUTTON_19, 0.0);
     //Xbox Elite paddle buttons
    if (get_actual(BUTTON_18)) {
        set_val(BUTTON_18, 0.0);
    }
    if (get_actual(BUTTON_19)) {
        set_val(BUTTON_19, 0.0);
    }
    if (get_actual(BUTTON_20)) {
        set_val(BUTTON_20, 0.0);
    }
    if (get_actual(BUTTON_21)) {
        set_val(BUTTON_21, 100.0);
    }
    if(is_active(BUTTON_2)) {
        set_val(BUTTON_18, 100.0); //added this script in
    }
}
// -------------------------------------------------------------------------- //
 
#ifndef auto_run
#define auto_run
main {
    if(get_prev(BUTTON_9) == 0.0 && get_prev(STICK_2_Y) < -99.0
       && time_active(STICK_2_Y) > 200) {
        combo_run(run);
    }
}
combo run {
    set_val(BUTTON_9, 100.0);
    wait(60);
    set_val(BUTTON_9, 0.0);
    wait(60);
    set_val(BUTTON_9, 0.0);
}
#endif
 
// Stop - Detection (P1=PS Circle)
    main {
    if(is_active(BUTTON_18) && time_active(BUTTON_18) <= 50000) {
        set_val(BUTTON_15, 0.0);
    }
}
 
//P1=R1
main {
    if(is_active(BUTTON_18)) {
        set_val(BUTTON_4, 100.0);
    }
}
 
// Stop - Detection (P3=PS Cross)
    main {
    if(is_active(BUTTON_20) && time_active(BUTTON_20) <= 50000) {
        set_val(BUTTON_16, 0.0);
    }
}
 
//P3=L1
main {
    if(check_active(BUTTON_20, 210)) {
        set_val(BUTTON_7, 100.0);
        set_val(BUTTON_6, 0.0);
    }
}
 
// Stop - Detection (P4=PS Square)
    main {
    if(is_active(BUTTON_21) && time_active(BUTTON_21) <= 50000) {
        set_val(BUTTON_17, 0.0);
    }
}       
 


Code: Select all
 
#pragma METAINFO("<WW2>", 1, 0, "")
 
uint8 statusIn,  protocolIn,  deviceIn;
uint8 statusOut, protocolOut, deviceOut;
 
main {
// -------------------------------------------------------------------------- //
// |         Crossover (XB1 Controller and Elite Controller on PS4)         | //
// -------------------------------------------------------------------------- //
    statusIn  = port_status(PORT_USB_A, &protocolIn,  &deviceIn);
    statusOut = port_status(PORT_USB_C, &protocolOut, &deviceOut);
 
    if(protocolIn == PROTOCOL_XB1 || protocolIn == PROTOCOL_XB1_WRC && protocolOut == PROTOCOL_PS4) {
        set_val(BUTTON_18, 0.0);set_val(BUTTON_2, 0.0);set_val(BUTTON_19, 0.0);
     //Xbox Elite paddle buttons
    if (get_actual(BUTTON_18)) {
        set_val(BUTTON_18, 0.0);
    }
    if (get_actual(BUTTON_19)) {
        set_val(BUTTON_19, 0.0);
    }
    if (get_actual(BUTTON_20)) {
        set_val(BUTTON_20, 0.0);
    }
    if (get_actual(BUTTON_21)) {
        set_val(BUTTON_21, 100.0);
    }
    if(is_active(BUTTON_2)) {
        set_val(BUTTON_18, 100.0); //added this script in
    }
}
//____________________________________________________________________________//
 
#ifndef auto_run
#define auto_run
main {
    if(get_prev(BUTTON_9) == 0.0 && get_prev(STICK_2_Y) < -99.0
       && time_active(STICK_2_Y) > 200) {
        combo_run(run);
    }
}
combo run
{
    set_val(BUTTON_9, 100.0);
    wait(60);
    set_val(BUTTON_9, 0.0);
    wait(60);
    set_val(BUTTON_9, 0.0);
}
#endif
 
// Stop - Detection (P1=PS Circle)
main {
    if(is_active(BUTTON_18) && time_active(BUTTON_18) <= 50000) {
        set_val(BUTTON_15, 0.0);
    }
}
 
// Stop - Detection (P3=PS Cross)
main {
    if(is_active(BUTTON_20) && time_active(BUTTON_20) <= 50000) {
        set_val(BUTTON_16, 0.0);
    }
}
 
//P3=Sniper Breath
main {
    if(is_active(BUTTON_20)) {
        set_val(BUTTON_8, 100.0);
        set_val(BUTTON_9, 100.0);
    }
}
 
// Stop - Detection (P4=PS Square)
main {
    if(is_active(BUTTON_21) && time_active(BUTTON_21) <= 50000) {
        set_val(BUTTON_17, 0.0);
    }
}
 
main {
    // Turbo
    if(is_active(BUTTON_18)) {
        rpm = 1000;
        AUTO_RAPID(BUTTON_5, BUTTON_5);
    }
}
 
void AUTO_RAPID(uint8 APPLY, uint8 EXECUTE) {
    uint32 sps = rpm/ 60;
    uint32 rate = 1000/ sps;
    uint32 hold = rate/ 2;
    uint32 ta = time_active(APPLY);
    set_val(EXECUTE, 100.0);
    while(ta > rate) {
    ta -= rate;}
    if(ta > hold) {
    set_val(EXECUTE, 0.0);}
}
 


Code: Select all
 
#pragma METAINFO("<Uncharted 4>", 1, 0, "")
 
uint8 statusIn,  protocolIn,  deviceIn;
uint8 statusOut, protocolOut, deviceOut;
 
main {
// -------------------------------------------------------------------------- //
// |         Crossover (XB1 Controller and Elite Controller on PS4)         | //
// -------------------------------------------------------------------------- //
    statusIn  = port_status(PORT_USB_A, &protocolIn,  &deviceIn);
    statusOut = port_status(PORT_USB_C, &protocolOut, &deviceOut);
 
    if(protocolIn == PROTOCOL_XB1 || protocolIn == PROTOCOL_XB1_WRC && protocolOut == PROTOCOL_PS4) {
        set_val(BUTTON_18, 0.0);set_val(BUTTON_2, 0.0);set_val(BUTTON_19, 0.0);
     //Xbox Elite paddle buttons
    if (get_actual(BUTTON_18)) {
        set_val(BUTTON_18, 0.0);
    }
    if (get_actual(BUTTON_19)) {
        set_val(BUTTON_19, 0.0);
    }
    if (get_actual(BUTTON_20)) {
        set_val(BUTTON_20, 0.0);
    }
    if (get_actual(BUTTON_21)) {
        set_val(BUTTON_21, 100.0);
    }
    if(is_active(BUTTON_2)) {
        set_val(BUTTON_18, 100.0); //added this script in
    }
}
// -------------------------------------------------------------------------- //
 
// Stop - Detection (P1=PS Circle)
    main {
    if(is_active(BUTTON_18) && time_active(BUTTON_18) <= 50000) {
        set_val(BUTTON_15, 0.0);
    }
}
 
// Stop - Detection (P3=PS Cross)
    main {
    if(is_active(BUTTON_20) && time_active(BUTTON_20) <= 50000) {
        set_val(BUTTON_16, 0.0);
    }
}
 
// Stop - Detection (P4=PS Square)
    main {
    if(is_active(BUTTON_21) && time_active(BUTTON_21) <= 50000) {
        set_val(BUTTON_17, 0.0);
    }
}
 
//Auto Mark
main {
    if(is_active(BUTTON_5)) {
        set_val(BUTTON_9, 100.0);
    }
}
 
main {
    if (get_actual(BUTTON_18)) {
        set_val(BUTTON_18, 0.0);
    }
}
 
int rpm;
 
main {
    // Turbo
    if(is_active(BUTTON_18)) {
        rpm = 1000;
        AUTO_RAPID(BUTTON_5, BUTTON_5);
    }
}
 
void AUTO_RAPID(uint8 APPLY, uint8 EXECUTE) {
    uint32 sps = rpm/ 60;
    uint32 rate = 1000/ sps;
    uint32 hold = rate/ 2;
    uint32 ta = time_active(APPLY);
    set_val(EXECUTE, 100.0);
    while(ta > rate) {
    ta -= rate;}
    if(ta > hold) {
    set_val(EXECUTE, 0.0);}
}
 


Here's the turbo script with no error's
Code: Select all
 
#pragma METAINFO("<author_name>", 1, 0, "")
 
main {
    if (get_actual(BUTTON_18)) {
        set_val(BUTTON_18, 0.0);
    }
}
 
int rpm;
 
main {
    // Turbo
    if(is_active(BUTTON_18)) {
        rpm = 1000;
        AUTO_RAPID(BUTTON_5, BUTTON_5);
    }
}
 
void AUTO_RAPID(uint8 APPLY, uint8 EXECUTE) {
    uint32 sps = rpm/ 60;
    uint32 rate = 1000/ sps;
    uint32 hold = rate/ 2;
    uint32 ta = time_active(APPLY);
    set_val(EXECUTE, 100.0);
    while(ta > rate) {
    ta -= rate;}
    if(ta > hold) {
    set_val(EXECUTE, 0.0);}
}
 


Don't know what's going on.
User avatar
CommanderPro97
First Sergeant
First Sergeant
 
Posts: 51
Joined: Sun Aug 13, 2017 3:10 am

Re: Errors for no reason

Postby bonefisher » Sat Jan 13, 2018 7:07 pm

This is the first one to try!

Code: Select all
 
#include <auto_run.gph>
 
uint8 statusIn,  protocolIn,  deviceIn;
uint8 statusOut, protocolOut, deviceOut;
 
main {
// -------------------------------------------------------------------------- //
// |         Crossover (XB1 Controller and Elite Controller on PS4)         | //
// -------------------------------------------------------------------------- //
    statusIn  = port_status(PORT_USB_A, &protocolIn,  &deviceIn);
    statusOut = port_status(PORT_USB_C, &protocolOut, &deviceOut);
 
    if(protocolIn == PROTOCOL_XB1 || protocolIn == PROTOCOL_XB1_WRC && protocolOut == PROTOCOL_PS4) {
        set_val(BUTTON_18, 0.0);set_val(BUTTON_2, 0.0);set_val(BUTTON_19, 0.0);
     //Xbox Elite paddle buttons
    if (get_actual(BUTTON_18)) {
        set_val(BUTTON_18, 0.0);
    }
    if (get_actual(BUTTON_19)) {
        set_val(BUTTON_19, 0.0);
    }
    if (get_actual(BUTTON_20)) {
        set_val(BUTTON_20, 0.0);
    }
    if (get_actual(BUTTON_21)) {
        set_val(BUTTON_21, 100.0);
    }
    if(is_active(BUTTON_2)) {
        set_val(BUTTON_18, 100.0); //added this script in
    }
}
// -------------------------------------------------------------------------- //
 
// Stop - Detection (P1=PS Circle)
    if(is_active(BUTTON_18) && time_active(BUTTON_18) <= 50000) {
        set_val(BUTTON_15, 0.0);
    }
 
//P1=R1
    if(is_active(BUTTON_18)) {
        set_val(BUTTON_4, 100.0);
    }
 
// Stop - Detection (P3=PS Cross)
    if(is_active(BUTTON_20) && time_active(BUTTON_20) <= 50000) {
        set_val(BUTTON_16, 0.0);
    }
 
//P3=L1
    if(check_active(BUTTON_20, 210)) {
        set_val(BUTTON_7, 100.0);
        set_val(BUTTON_6, 0.0);
    }
 
// Stop - Detection (P4=PS Square)
    if(is_active(BUTTON_21) && time_active(BUTTON_21) <= 50000) {
        set_val(BUTTON_17, 0.0);
    }
}
 
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: Errors for no reason

Postby bonefisher » Sat Jan 13, 2018 7:08 pm

make sure the auto_run file is saved with this in same folder.
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: Errors for no reason

Postby Sillyasskid » Sun Jan 14, 2018 1:10 pm

Place a }
On the line above #ifndef auto_run
User avatar
Sillyasskid
Captain
Captain
 
Posts: 574
Joined: Sat May 14, 2016 3:07 am

Re: Errors for no reason

Postby CommanderPro97 » Tue Feb 06, 2018 6:52 pm

Thanks it worked :innocent_smile_1:
User avatar
CommanderPro97
First Sergeant
First Sergeant
 
Posts: 51
Joined: Sun Aug 13, 2017 3:10 am


Return to GPC2 Script Programming

Who is online

Users browsing this forum: midg3t2 and 153 guests