What am I doing wrong here syntax error

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

What am I doing wrong here syntax error

Postby DUCKMO3W » Mon Mar 19, 2018 5:20 am

I'm getting a declaration syntax error 'combo' i can't figure out why... I'm sure it's simple I'm just trying to figure out how turn
Combos on and off if I put like 3 combo scripts in one script I want to be able to toggle them each on and off with different
Button Commands but I can't get 1 to turn on and off or compile it at the moment...

#define RT BUTTON_5
#define LT BUTTON_8
#define B BUTTON_15
Int DropshotOn = FALSE;

Main {
If(get_val(BUTTON_8)&& event_press(BUTTON_15)) {
DropshorOn = !DropshotOn;
{
If(DropshotOn&& get_val(BUTTON_5)) {
Combo_run(Dropshot);
}

Combo Dropshot {
Set_val(BUTTON_15, 100);
}
}
User avatar
DUCKMO3W
Sergeant First Class
Sergeant First Class
 
Posts: 22
Joined: Sat Jan 10, 2015 9:29 pm

Re: What am I doing wrong here syntax error

Postby DUCKMO3W » Mon Mar 19, 2018 8:17 am

I figured out the "int DropshotOn thing I got the on/off part working. but I still don't know how to make separate on/off switches where let's say I have a script with 4 different combos and I want to use like LT + dpadup for number 1
LT +dpaddown for number 2 and LT+dpadright for number 3 and LT +dpadleft for the last one what's the function code look like
For that sort of thing???
User avatar
DUCKMO3W
Sergeant First Class
Sergeant First Class
 
Posts: 22
Joined: Sat Jan 10, 2015 9:29 pm

Re: What am I doing wrong here syntax error

Postby bonefisher » Mon Mar 19, 2018 8:24 am

Code: Select all
 
#define RT BUTTON_5
#define LT BUTTON_8
#define B  BUTTON_15
bool DropshotOn;
 
main {
if(get_val(LT) && event_active(B)) {
DropshotOn = !DropshotOn;
}
if(DropshotOn && get_val(RT)) {
combo_run(Dropshot);
}
}
 
combo Dropshot {
set_val(BUTTON_15, 100);
}
 
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: What am I doing wrong here syntax error

Postby DUCKMO3W » Mon Mar 19, 2018 8:36 am

And if I put somthing like that above each individual combo in a multi combo script with different key combinations they won't just toggle the whole script on/off? just the specific combo the command is set for?
User avatar
DUCKMO3W
Sergeant First Class
Sergeant First Class
 
Posts: 22
Joined: Sat Jan 10, 2015 9:29 pm

Re: What am I doing wrong here syntax error

Postby bonefisher » Mon Mar 19, 2018 8:40 am

Code: Select all
 
#define RT      BUTTON_5
#define LT      BUTTON_8
#define B       BUTTON_15
#define D_UP    BUTTON_10
#define D_DOWN  BUTTON_11
#define D_LEFT  BUTTON_12
#define D_RIGHT BUTTON_13
 
bool DropshotOn;
bool number_1;
bool number_2;
bool number_3;
bool number_4;
 
main {
if(get_val(LT) && event_active(B)) {
DropshotOn = !DropshotOn;
}
if(DropshotOn && get_val(RT)) {
combo_run(Dropshot);
}
if(get_val(LT) && event_active(D_UP)) {
number_1 = !number_1;
}
if(number_1) {
// place how to activate combo
}
if(get_val(LT) && event_active(D_DOWN)) {
number_2 = !number_2;
}
if(number_2) {
// place how to activate combo
}
if(get_val(LT) && event_active(D_LEFT)) {
number_3 = !number_3;
}
if(number_3) {
// place how to activate combo
}
if(get_val(LT) && event_active(D_RIGHT)) {
number_4 = !number_4;
}
if(number_4) {
// place how to activate combo
}
}
 
combo Dropshot {
set_val(BUTTON_15, 100);
}
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: What am I doing wrong here syntax error

Postby bonefisher » Mon Mar 19, 2018 8:45 am

DUCKMO3W wrote:And if I put somthing like that above each individual combo in a multi combo script with different key combinations they won't just toggle the whole script on/off? just the specific combo the command is set for?

Only toggles that specific mod.... you can make a whole script on/off with same method just put everything in the brackets..... :smile0517:
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: What am I doing wrong here syntax error

Postby DUCKMO3W » Mon Mar 19, 2018 8:55 am

Thanks man :smile0203:
User avatar
DUCKMO3W
Sergeant First Class
Sergeant First Class
 
Posts: 22
Joined: Sat Jan 10, 2015 9:29 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 115 guests