Edit: Need Help With Compile

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

Edit: Need Help With Compile

Postby CommanderPro97 » Thu Aug 31, 2017 7:47 pm

Some how fix it, but

GPC: Second-pass started.
GPC success: GPC Compile succeeded with 0 warning(s).

Where is it? I"m lost.

GPC Script:
Code: Select all
 
#pragma METAINFO("<author_name>", 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_2, 0.0);
     //Ignore Xbox Elite paddle buttons since they pass in the buttons programmed in the xbox accessory app.
    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, 0.0);
    }
    // Hold view button for swipe. Then use right stick for swipe direction.
        set_val(POINT_1_Y, 0.0);
        set_val(POINT_1_X, 0.0);
    if(is_active(BUTTON_2)) {
        set_val(BUTTON_19, 100.0);
        set_val(POINT_1_Y, get_val(STICK_1_Y));
        set_val(STICK_1_Y, get_actual(BUTTON_20));
        set_val(POINT_1_X, get_val(STICK_1_X));
        set_val(STICK_1_X, get_actual(BUTTON_21));
    // Hold view button and click right stick click for touch click.   
        set_val(BUTTON_6, 0.0);
    if(get_actual(BUTTON_6)) {
        set_val(BUTTON_18, 100.0);
    }
    }
    }
// ========================================================================== //
}
 
main {
    // While BUTTON_19 is held-down
    if(get_val(BUTTON_5)) {
        // Burst
        combo_run (Burst);
    }
}
 
 
combo Burst{
    set_val(BUTTON_5, 100.0);
    wait(35);
    set_val(BUTTON_5, 0);
    wait(35);
    set_val(BUTTON_5, 100.0);
    wait(35);
    set_val(BUTTON_5, 0);
    wait(35);
    set_val(BUTTON_5, 100.0);
    wait(35);
    set_val(BUTTON_5, 0);
    wait(35);
    set_val(BUTTON_5, 100.0);
    wait(35);
}


the burst is for 4-burst for shooters.
Last edited by CommanderPro97 on Sat Sep 02, 2017 7:11 am, edited 3 times in total.
User avatar
CommanderPro97
First Sergeant
First Sergeant
 
Posts: 51
Joined: Sun Aug 13, 2017 3:10 am

Re: Need Help With Compile

Postby antithesis » Thu Aug 31, 2017 10:50 pm

You need to tell the script which combo to run and your syntax is screwy - there's no need for the second main wrapper around your combo call.

It should be -

Code: Select all
 
    if(get_val(BUTTON_5)) {
        // Burst Fire
        combo_run (Burst Fire);
    }
 


Note that you've named your combo Bust Fire, I'm assuming that's an error.
Official Australian retailer for Titan One, Titan Two and XIM APEX at Mod Squad
User avatar
antithesis
Colonel
Colonel
 
Posts: 1912
Joined: Sat May 28, 2016 10:45 pm

Re: Need Help With Compile

Postby J2Kbr » Fri Sep 01, 2017 1:06 pm

That is correct antithesis, combo names cannot have spaces, an underline "_" could be used instead.
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Need Help With Compile

Postby CommanderPro97 » Sat Sep 02, 2017 7:16 am

antithesis wrote:You need to tell the script which combo to run and your syntax is screwy - there's no need for the second main wrapper around your combo call.

It should be -

Code: Select all
 
    if(get_val(BUTTON_5)) {
        // Burst Fire
        combo_run (Burst Fire);
    }
 


Note that you've named your combo Bust Fire, I'm assuming that's an error.

"Nope just trying to create a 4-burst for shooters i look at some titan one coding a that's what they put for there's ".

Code: Select all
 
main {
    // While BUTTON_19 is held-down
    if(get_val(BUTTON_5)) {
        // Burst
        combo_run (Burst);
    }
}

I get an error if i don't put it like this, don't know why?
User avatar
CommanderPro97
First Sergeant
First Sergeant
 
Posts: 51
Joined: Sun Aug 13, 2017 3:10 am

Re: Edit: Need Help With Compile

Postby J2Kbr » Mon Sep 04, 2017 4:07 pm

Change this part to:
Code: Select all
main {
    // While BUTTON_19 is held-down
    if(event_active(BUTTON_5)) {
        // Burst
        combo_run (Burst);
    }
    set_val(BUTTON_5, 0.0);
}

It will fire 4 times and stop for each time R2 is pressed.
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 94 guests

cron