Page 1 of 1

Expresion expected - co zrobić?

Posted: Mon Jun 01, 2009 7:18 pm
by Pablo Abruzzi
Mam problem z tą ch*****ą uwagą. Przez nią mi się cały kod piepszy, mimo iż mam go dobrze. Nie mam pojęcia co moge z tym zrobić, pomocy!

Posted: Mon Jun 01, 2009 7:37 pm
by Radzio
Jeszcze jeden taki temat i poleci warn stulecia <very zły>

Wklejaj kod i treść błędu. Kod nie jest poprawny, skoro daje błąd.

Posted: Mon Jun 01, 2009 7:48 pm
by Pablo Abruzzi
Compiling error at New1 line 46: Expression Expected

Code: Select all

Starting
Begin
RandomizeAll;
ResetFog;
end;

every 0$1 do
begin
CreateCratesAnywhere( Rand (3,5),true);
end;

export czolg1, czolg2,czolg3,czolg4,czolg5,czolg6,czolg7,czolg8,czolg9,czolg10;

every 0$1 do
Begin
czolg1 = ComConstruct(fabR2, ru_morphling,engine_combustion,control_manual,ru_heavy_gun);
czolg2 = AddComConstruct(fabR2, ru_morphling,engine_combustion,control_manual,ru_gatling_gun);
czolg3 = AddComConstruct(fabR2, ru_heavy_tracked,engine_siberite,control_computer,ru_heavy_gun);
czolg4 = AddComConstruct(fabR2, ru_heavy_tracked,engine_siberite,control_computer,ru_heavy_gun);
czolg5 = AddComConstruct(fabR2, ru_heavy_tracked,engine_siberite,control_computer,ru_heavy_gun);
czolg6= AddComConstruct(fabR2, ru_heavy_tracked,engine_siberite,control_computer,ru_heavy_gun);
czolg7= AddComConstruct(fabR2, ru_heavy_tracked,engine_siberite,control_computer,ru_rocket);
czolg8= AddComConstruct(fabR2, ru_heavy_tracked,engine_siberite,control_computer,ru_rocket);
enable(01);
end;

on VehicleConstructed(poj,fab) do
begin
if fab=fabR2 then
    if (czolg1) then
      if (czolg2) then
        if (czolg3) then
          if (czolg4) then
            if (czolg5) then
              if (czolg6) then
                  if(czolg7) then begin czolg8=poj; Enable(99); end
                else czolg7=poj
              else czolg6=poj
            else czolg5=poj
          else czolg4=poj
        else czolg3=poj
      else czolg2=poj
    else czolg1=poj
end;

every 0$2 trigger MARKED czolg6 and czolg7 and czolg8 99 do
begin
ComAgressiveMove([czolg1, czolg2, czolg3, czolg4, czolg5, czolg6, czolg7, czolg8], 53, 30);
end;
Ja nie zauważyłem błędu w linii 46.
--------------------------------------------------------------------------------------------------------
Ps. Co miałeś na mysli pisząc ,,jeszcze jeden taki temat"??

Posted: Mon Jun 01, 2009 8:15 pm
by Anarchy
'Jeszcze jeden taki temat...' Czyli że po raz tysięczny ktoś pyta o błąd bez podania jego treści. Zresztą zaznacz, która to 46 linijka...

Posted: Mon Jun 01, 2009 8:15 pm
by Radzio
1) Jest błąd, bo masz trigger, a po nim MARKED.
Jak nie podajesz funkcji do sprawdzenia, to nie używasz składni trigger.
Ps. Co miałeś na mysli pisząc ,,jeszcze jeden taki temat"??
2) Jak ludzie piszą o błędzie w kodzie, nie podając ani jednego ani drugiego..

Posted: Mon Jun 01, 2009 10:00 pm
by Moonstrider
A nie powinno być przypadkiem średnika w ostatniej linijce z else?

Posted: Tue Jun 02, 2009 4:08 pm
by Pablo Abruzzi
Dzięki ten kod działał, ale jak chciałem zrobić produkcję w innej fabryce na podstawie tego samego kodu, wyskakuje coś takiego:
Compilling error at fabR1 line 16: Event 'VehicleConstructed' redeclared!
fabR1 to nazwa modułu

Oto ten drugi kod:

Code: Select all

export czol1, czol2,czol3,czol4,czol5,czol6,czol7,czol8;

every 0$1 do
Begin
czol1 = ComConstruct(fabR1, us_morphling,engine_combustion,control_manual,us_heavy_gun);
czol2 = AddComConstruct(fabR1, us_morphling,engine_combustion,control_manual,us_rocket_launcher);
czol3 = AddComConstruct(fabR1, us_heavy_tracked,engine_siberite,control_computer,us_heavy_gun);
czol4 = AddComConstruct(fabR1, us_heavy_tracked,engine_siberite,control_computer,us_heavy_gun);
czol5 = AddComConstruct(fabR1, us_heavy_tracked,engine_siberite,control_computer,us_heavy_gun);
czol6= AddComConstruct(fabR1, us_heavy_tracked,engine_siberite,control_computer,us_heavy_gun);
czol7= AddComConstruct(fabR1, us_heavy_tracked,engine_siberite,control_computer,us_rocket_launcher);
czol8= AddComConstruct(fabR1, us_heavy_tracked,engine_siberite,control_computer,us_rocket_launcher);
enable(01);
end;

on VehicleConstructed(poj1,fab1) do       //LINIA 16
begin 
if fab1=fabR1 then
   if (czol1) then
     if (czol2) then
       if (czol3) then
         if (czol4) then
            if (czol5) then
              if (czol6) then
                  if(czol7) then begin czol8=poj1; Enable(99); end
                else czol7=poj1
              else czol6=poj1
            else czol5=poj1
          else czol4=poj1
        else czol3=poj1
      else czol2=poj1
    else czol1=poj1
end;

every 0$2 trigger czol6 and czol7 and czol8 MARKED 99 do
begin
ComAgressiveMove([czol1, czol2, czol3, czol4, czol5, czol6, czol7, czol8], 86, 142);
end;
Proszę o korekte i pomoc.

Posted: Tue Jun 02, 2009 4:37 pm
by Moonstrider
Może psróbuj zmienić nazwy argumentów eventu.

Posted: Tue Jun 02, 2009 5:08 pm
by Pablo Abruzzi
Moonstrider wrote:Może psróbuj zmienić nazwy argumentów eventu.
Zmieniłem, ale nic nie pomogło. Czekam na dalsze propozycje.

Posted: Tue Jun 02, 2009 5:27 pm
by tex
Włożyłem ten twój kod do editora i wszystko działa!! Więc ty coś masz źle ale nie w sailu ;d Sam nie wiem ;d

Posted: Tue Jun 02, 2009 5:38 pm
by Moonstrider
Nie może być 2 takich samych eventów w kodzie :P
Zrób to w 1:

Code: Select all

On VehicleConstructed(poj,fab) do
Begin
if fab=fabR2 then
    if czolg1 then
      if czolg2 then
        if czolg3 then
          if czolg4 then
            if czolg5 then
              if czolg6 then
                  if czolg7 then begin czolg8=poj; Enable(99); end
                else czolg7=poj
              else czolg6=poj
            else czolg5=poj
          else czolg4=poj
        else czolg3=poj
      else czolg2=poj
    else czolg1=poj;
if fab=fabR1 then
   if czol1 then
     if czol2 then
       if czol3 then
         if czol4 then
            if czol5 then
              if czol6 then
                  if czol7 then begin czol8=poj; Enable(99); end
                else czol7=poj
              else czol6=poj
            else czol5=poj
          else czol4=poj
        else czol3=poj
      else czol2=poj
    else czol1=poj;
end;
PS: Te nawiasy były tam całkowicie niepotrzebne.