1

I'm using the GTuner language and the GTuner IV 1.1 compiler. My code seems to keep outputting the warning after compiling

GPC error: PressXInput.gpc(18): Declaration syntax error 'combo'

Using GTuner to compile this (Titan Two)

Any help to fix syntax declaration error, or even improvements on my code.

Tried declaring 'combo' as a bool/int etc but still same error.

bool toggle;

main {
    if (event_active (BUTTON_2)) { 
        toggle = !toggle;
        combo_stop(PressX);
    }
    if (toggle) {
        combo_run(PressX); 
    }
    combo PressX {
        set_val(BUTTON_16, 100.0); 
        wait(100);
        wait(5000); 
    }
}

Expected result should show no declaration syntax error with 'combo' after compiling.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Run911
  • 11
  • 1
  • 1
    What language is this supposed to be? It is not C++. –  May 22 '19 at 02:05
  • Unrelated: `main` needs a return type of `int` – user4581301 May 22 '19 at 02:05
  • Gtuner IV 1.1 uses C like language will change tags. maybe should of asked on official forum instead of here. also dont need to return type 'int' within GTuner, as its C like syntax. – Run911 May 22 '19 at 02:07
  • What is `combo` ? Where does code define it? – chux - Reinstate Monica May 22 '19 at 02:12
  • doesnt define it anywhere, so not really sure if I need to declare it and how. just started on it tonight. code runs but i just wanna see how it could be improved... – Run911 May 22 '19 at 02:16
  • Since this isn't C (for a large number of different reasons), the C tag should go. But frankly, if there isn't a [GTuner IV](https://www.consoletuner.com/software/gtuner-iv/) tag on Stack Overflow (and there doesn't seem to be one), it's likely the question should be deleted here and asked elsewhere. – Jonathan Leffler May 22 '19 at 02:51
  • bye @jonathan .... – Run911 May 22 '19 at 02:59
  • I'd like to help; I'd like you to be able to get help. But there's not much precedent for it on SO. Sorry. There is always a first time for everything... – Jonathan Leffler May 22 '19 at 03:00

1 Answers1

0

Combos need to be declared outside of main{}

`

bool toggle;

main {
    if (event_active (BUTTON_2)) { 
        toggle = !toggle;
        combo_stop(PressX);
    }
    if (toggle) {
        combo_run(PressX); 
    }
 
}

combo PressX {
        set_val(BUTTON_16, 100.0); 
        wait(100);
        wait(5000); 
}

`

Brian
  • 41
  • 3