Cant find this syntax error

Gtuner IV general support. Operation, questions, updates, feature request.

Cant find this syntax error

Postby GameOne » Sat Dec 01, 2018 1:21 pm

Hi fellow GPC2 script writes. I just got my Titan 2 and wanted to code some simple combos, that keep repeating doing the same action until pressing one button to disable the looping combo.
After I added the second combo, Gtuner didn't want to compile the main functions anymore. It was working perfect before I add the second combo.... I am now always getting this error if I try to compile :cry:
I dont know whats wrong at this script, now.

GPC error: test1.gpc(3): syntax error, unexpected COMBORUN, expecting C 'combo_run'.


Code: Select all
#pragma METAINFO("BlackOps 4 Helper", 0, 1, "")
main {
    if (event_active(BUTTON_3) && (event_active(BUTTON_10)) combo_run(cDivinium);
    if (event_active(BUTTON_3) && (event_active(BUTTON_11)) combo_run(cMesser);
    if (event_active(BUTTON_9)) combo_stop(cDivinium);
    if (event_active(BUTTON_9)) combo_stop(cMesser);
}
 
 combo cDivinium {
  wait(2000);
  wait(2000);
  wait(1000);
  set_val(BUTTON_16,100);
  wait(200);
  set_val(BUTTON_16,0);
  wait(200);
  combo_restart(cDivinium);
  wait(10);
}
 
combo cMesser {
  wait(900);
  set_val(BUTTON_15,100);
  wait(200);
  set_val(BUTTON_15,0);
  wait(100);
  combo_restart(cMesser);
  wait(10);
}
User avatar
GameOne
Private First Class
Private First Class
 
Posts: 3
Joined: Wed Nov 28, 2018 4:42 pm

Re: Cant find this syntax error

Postby Scachi » Sat Dec 01, 2018 1:34 pm

To many ( or to less ) :
Code: Select all
if (event_active(BUTTON_3) && (event_active(BUTTON_10)) combo_run(cDivinium);

->
Code: Select all
if (event_active(BUTTON_3) && event_active(BUTTON_10)) combo_run(cDivinium);


same to do for the other line

two "event_active" are hard to trigger at the same time by hand (same millisecond)
This will only work if you are using mappings via Input Translator/XIM or code.

Give this one a try:
hold down BUTTON_3 and press 10 or 11 to start the combo you want.
Code: Select all
#pragma METAINFO("BlackOps 4 Helper", 0, 1, "")
main {
    if (get_actual(BUTTON_3) && event_active(BUTTON_10)) combo_run(cDivinium);
    if (get_actual(BUTTON_3) && event_active(BUTTON_11)) combo_run(cMesser);
    if (event_active(BUTTON_9)) combo_stop(cDivinium);
    if (event_active(BUTTON_9)) combo_stop(cMesser);
}
 
 combo cDivinium {
  wait(2000);
  wait(2000);
  wait(1000);
  set_val(BUTTON_16,100);
  wait(200);
  set_val(BUTTON_16,0);
  wait(200);
  combo_restart(cDivinium);
  wait(10);
}
 
combo cMesser {
  wait(900);
  set_val(BUTTON_15,100);
  wait(200);
  set_val(BUTTON_15,0);
  wait(100);
  combo_restart(cMesser);
  wait(10);
}
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Cant find this syntax error

Postby Sillyasskid » Sat Dec 01, 2018 1:45 pm

Image
Issue is here. delete those brackets, and it will compile,

Scachi is right about having to event_active()'s together. If your nor using a xim, or input translator, then you might want to change that code to something easier to trigger with a controller,

something like
(is_active(BUTTON_3) && event_active(BUTTON_10))
could work.
User avatar
Sillyasskid
Captain
Captain
 
Posts: 574
Joined: Sat May 14, 2016 3:07 am

Re: Cant find this syntax error

Postby GameOne » Sat Dec 01, 2018 3:09 pm

Thanks guys :joia:

The first combo cDivinium is working perfectly, also the button to abort it. No issues at running this one.
But, the second one cMesser (although its almost similar as the first combo) does crash my Titan2 after it ran and restarted the combo 2 times activating the combo, it does directly reboot and reconnect to the PROG-interface :roll: :roll:

Its nearly identical to the first combo (beside other button being allocated and the timing).
I am using the firmware that came out today (v0.98.1.70), using this GPC

Code: Select all
#pragma METAINFO("BlackOps 4 Helper", 0, 2, "")
main {
    if (get_actual(BUTTON_3) && event_active(BUTTON_10)) combo_run(cDivinium);
    if (get_actual(BUTTON_3) && event_active(BUTTON_11)) combo_run(cMesser);
    if (event_active(BUTTON_9)) combo_stop(cDivinium);
    if (event_active(BUTTON_9)) combo_stop(cMesser);
}
 
 combo cDivinium {
  wait(2000);
  wait(2000);
  wait(1000);
  set_val(BUTTON_16,100);
  wait(200);
  set_val(BUTTON_16,0);
  wait(200);
  combo_restart(cDivinium);
  wait(10);
}
 
combo cMesser {
  wait(700);
  set_val(BUTTON_15,100);
  wait(200);
  set_val(BUTTON_15,0);
  wait(100);
  combo_restart(cMesser);
  wait(10);
}
 


Don't know what the crash does trigger, on the second combo :P

EDIT: Sometimes the combo cMesser can run up to 4 times before the Titan2 does crash and reboot. Tried out Test & Debug + different memory slots.
Last edited by GameOne on Sat Dec 01, 2018 3:15 pm, edited 1 time in total.
User avatar
GameOne
Private First Class
Private First Class
 
Posts: 3
Joined: Wed Nov 28, 2018 4:42 pm

Re: Cant find this syntax error

Postby Sillyasskid » Sat Dec 01, 2018 3:12 pm

Issue was with the last wait, being 10ms.

Fixed
Code: Select all
combo cMesser {
  wait(700);
  set_val(BUTTON_15,100);
  wait(200);
  set_val(BUTTON_15,0);
  wait(100);
  combo_restart(cMesser);
  wait(0);
}


Code: Select all
combo_restart(cMesser);
 wait(10);

Should only be used with the titan one.
User avatar
Sillyasskid
Captain
Captain
 
Posts: 574
Joined: Sat May 14, 2016 3:07 am

Re: Cant find this syntax error

Postby GameOne » Sat Dec 01, 2018 3:18 pm

Sillyasskid wrote:Issue was with the last wait, being 10ms.

Fixed
Code: Select all
combo cMesser {
  wait(700);
  set_val(BUTTON_15,100);
  wait(200);
  set_val(BUTTON_15,0);
  wait(100);
  combo_restart(cMesser);
  wait(0);
}


Code: Select all
combo_restart(cMesser);
 wait(10);

Should only be used with the titan one.


Thank you so much :smile0202: :joia:
Its working :smile0517:
User avatar
GameOne
Private First Class
Private First Class
 
Posts: 3
Joined: Wed Nov 28, 2018 4:42 pm


Return to Gtuner IV Support

Who is online

Users browsing this forum: No registered users and 88 guests

cron