Error Question

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

Re: Error Question

Postby Mysticpurple90 » Sat Sep 10, 2016 5:05 am

I have the headers there as a reference for now because we all are still fairly new to the scripting for the t2 but i'd like it if there are still the universal button code like 4=xb360_RT/ps3_R2 like on the T2 and if it is are they same or are they different
User avatar
Mysticpurple90
Command Sergeant Major
Command Sergeant Major
 
Posts: 175
Joined: Mon Mar 28, 2016 5:48 am

Re: Error Question

Postby bonefisher » Sat Sep 10, 2016 9:38 am

Mysticpurple90 wrote:I have the headers there as a reference for now because we all are still fairly new to the scripting for the t2 but i'd like it if there are still the universal button code like 4=xb360_RT/ps3_R2 like on the T2 and if it is are they same or are they different

I posted the header file on the first page of this post and yes it is different. It is in PS4 on the file with the BUTTON_NUMBERS which he is not going to the simple NUMBER. I myself like it to be just the number and if J2Kbr is fixing to change some things maybe we should request to go back to just the numbers.
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: Error Question

Postby J2Kbr » Sat Sep 10, 2016 10:51 am

Use the index number is still possible. However, it is not recommended as it makes the code really hard to read. Instead use the generic designators, such BUTTON_?, STICKER_?, ACC_?, etc ... as bonefisher posted above, or use the include files to make reference to the console specific designators
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: Error Question

Postby Mysticpurple90 » Sun Sep 11, 2016 6:16 am

so ive gone through and changed up some things but im still getting an error that im not sure what it mean

GPC error: T2 BO2.gpc(38): syntax error, unexpected T, expecting P_E ';'.


line 37-42
Code: Select all

main {   
    if((event_actived(ADS) && get_val(D_PAD_UP)) || (event_actived(D_PAD_UP) && get_val(ADS))){           // Turns ON/OFF RapidFire
        RapidFire_ONoff = !RapidFire_ONoff;
        if(RapidFire_ONoff) {combo_run(RumbleNotifier);
            XYYjitter_ONoff = FALSE; Hybridjitter_ONoff = FALSE; FSRapidFire_ONoff; silentshot_ONoff = FALSE;
         }
   }
User avatar
Mysticpurple90
Command Sergeant Major
Command Sergeant Major
 
Posts: 175
Joined: Mon Mar 28, 2016 5:48 am

Re: Error Question

Postby J2Kbr » Sun Sep 11, 2016 8:14 am

In the line 38, the compiler was expecting a ')', but found a ';'

Please check if any of the defines in line 28 (eg ADS, D_PAD_UP) have a ';' at the end of the line, if yes remove.
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: Error Question

Postby Mysticpurple90 » Sun Sep 11, 2016 9:42 am

so i did that but now a new error happened
GPC error: T2 BO2.gpc(129): syntax error, unexpected ASSIGN '='.


line 126-131
Code: Select all
   
    set_val(reload, 100);
    wait(7);
    set_val(shoot, 100);
    set_val(LY, -99);
    set_val(reload, 0);
    wait(6);
User avatar
Mysticpurple90
Command Sergeant Major
Command Sergeant Major
 
Posts: 175
Joined: Mon Mar 28, 2016 5:48 am

Re: Error Question

Postby The_Rabid_Taco » Sun Sep 11, 2016 1:30 pm

Try changing set_val(LY, -99) to set_val(LY, -99.0) or set_val(LY, -99f). That may take care of the issue, or at least I believe it should.
User avatar
The_Rabid_Taco
Major
Major
 
Posts: 1066
Joined: Wed Mar 16, 2016 6:04 pm
Location: Pensacola, FL

Re: Error Question

Postby Mysticpurple90 » Sun Sep 11, 2016 2:13 pm

Sadly it did not Im going to set aside trying to convert this script for now and work on converting my bo3 script so we can get some more feed back on different games
User avatar
Mysticpurple90
Command Sergeant Major
Command Sergeant Major
 
Posts: 175
Joined: Mon Mar 28, 2016 5:48 am

Re: Error Question

Postby bonefisher » Sun Sep 11, 2016 2:17 pm

On the wait times try putting 7.0 and 6.0 also and maybe a f at the end.
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: Error Question

Postby J2Kbr » Sun Sep 11, 2016 2:25 pm

set_val is the only IO function that accepts fix32 and int as values. If an int is provided, it internally converts to fix32. I did this to make easy use int values to set the outputs without use type cast, or be forced to use 32bits variables where it is not needed.

But back to the error (129) ... Here again it seems the error is on the define LY, which has a symbol '=' ... The new GPC language the defines follows the same format as C, so no equal symbol is needed.
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

PreviousNext

Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 155 guests