SAIL - Zapytania

Tematy zbędne, ale zbyt dobre by je usunąć znajdują się tutaj.
Locked
User avatar
Blashix
Community Veteran
Community Veteran
Posts: 375
Joined: Sun Apr 29, 2007 8:23 am
Location: Polska

SAIL - Zapytania

Post by Blashix »

Przeczytałem z poradnika z ow support ale wyskakuje mi błąd że "expressed case not found"
Zapytanie chciałem dodać po kodzie:

Code: Select all

every 0$1 trigger IsInArea(berd,Area10) do
begin
CenterOnUnits(berd);  //środkuje kamere
DialogueOn;  // otwera dialog po dojsciu do arei
Say(winston, 'dialog3')
end;
A to Zapytanie:

Code: Select all

Case Query("Q1") of
1 : begin
end;
2: begin
end;
end
Wyszło mi takie coś:

Co jest nie tak ?

Code: Select all

every 0$1 trigger IsInArea(berd,Area10) do
begin
CenterOnUnits(berd);  //środkuje kamere
DialogueOn;  // otwera dialog po dojsciu do arei
Say(winston, 'dialog3')
end;

Case Query("Q1") of <<------------ O tą linikę się pluje
1 : begin
ForcedSay(berd, 'dialog6')
on enterbuilding(b,un) do
begin
if b=eon then
case un of
berd:if not killhim then
begin 
wait(0$1);
savecharacters(berd,'B');
changemap('1','%_cont');
end;

end;
2: begin
DialogueOn;  // otwera dialog po dojsciu do arei
Say(winston, 'dialog7')
(I misja odnowa, nie wiem jaki kod trza xD)
end;
end;
--> 02.12.2008 PC <--
| AMD Athlon 64 X2 5400 Black Edition 3,4Ghz + Cooling Pentagram Freezone HP-120 AlCu Karakorum | GoodRam DDR2 2x 2GB 810Mhz CL4 + Arctic Cooling Arctic RC | Asus M3A78 PRO AMD 780G (Radeon HD 3200 & HD Audio Realtek ALC1200) | Radeon HD 4850 Gigabyte 512MB 700/2000 MHz + Zalman Cooling | Samsung SpinPoint T166 320 GB (SATA II, 16MB cache, NCQ) | LG SuperMulti DVD LightScribe | Power: Chieftec (GPS-500AB-A) 500W all in: NZXT Apollo Crafted Series Black

Mouse: A4TECH XL-750F
Keyboard: Saitek Eclipse II
Monitor: 19 LG Flatron W1952TQ-PF
User avatar
NNPlaya
Community Veteran
Community Veteran
Posts: 372
Joined: Sat Oct 14, 2006 4:52 pm
Location: Tuszyn, Polska
Contact:

Post by NNPlaya »

Bo to całe zapytanie powinieneś umieścić między znacznikami begin end. Rozumien, że chciałeś, żeby zapytanie się wyświetliło przy tym every? Jeśli tak, to kod powinien być taki:

Code: Select all

every 0$1 trigger IsInArea(berd,Area10) do
begin
CenterOnUnits(berd);  
DialogueOn; 
Say(winston, 'dialog3');

Case Query("Q1") of 
<ten kod z case query>

end;
Jeszcze jedno, on enterbuilding powinno być poza every:

Code: Select all

every cośtam
Begin
<jakiś_kod>
end;

On enterbuilding ....
I powinieneś wstawić coś takiego za to co Ty masz:

Code: Select all

 on enterbuilding(b,un) do
  begin
   if b=eon then
    case un of
    berd: begin
    wait(0$1.3);
    savecharacters(berd,'berd');
    changemap('1','%_cont');
  end;
   else
    RemoveUnit(un);
  end;
end;


[ Dodano: Nie Maj 06, 2007 8:54 pm ]
W rezultacie cały kod:

Code: Select all

every 0$1 trigger IsInArea(berd,Area10) do
begin
CenterOnUnits(berd);
Say(winston, 'dialog3');

Case Query("Q1") of
1 : begin
ForceSay(berd, 'dialog6');
ComEnterUnit(berd,eon);
end;
2: begin
Say(winston, 'dialog7');
YouLost('');
end;

end;

On Enterbuilding(b,un) do
begin
if b=eon then
case un of
berd: begin
Wait(0$1.3);
SaveCharacters(berd,'berd');
ChangeMap('1','%_cont');
end;
else
RemoveUnit(un);
end;
Sprawdź, czy działa :roll:

[ Dodano: Nie Maj 06, 2007 8:57 pm ]
Aha, DialogueOn; to nie jest zaczęcie dialogu, tylko zapauzowanie gry i w tym czasie dialog do momentu aż wykonana zostanie komenda DialogueOff; . Jak nie zamkniesz tego

Code: Select all

DialogueOn;
DialogueOff;
To gra albo się zawiesi, albo misja nie będzie działać. Czyli: nie stosuj tego DialogueOn; albo zamykaj dialog DialogueOff; 8)
User avatar
Blashix
Community Veteran
Community Veteran
Posts: 375
Joined: Sun Apr 29, 2007 8:23 am
Location: Polska

:P

Post by Blashix »

Czepia się dalej :/ ...
"Character ignored"
"expected but "" Found"

I co teraz ??
--> 02.12.2008 PC <--
| AMD Athlon 64 X2 5400 Black Edition 3,4Ghz + Cooling Pentagram Freezone HP-120 AlCu Karakorum | GoodRam DDR2 2x 2GB 810Mhz CL4 + Arctic Cooling Arctic RC | Asus M3A78 PRO AMD 780G (Radeon HD 3200 & HD Audio Realtek ALC1200) | Radeon HD 4850 Gigabyte 512MB 700/2000 MHz + Zalman Cooling | Samsung SpinPoint T166 320 GB (SATA II, 16MB cache, NCQ) | LG SuperMulti DVD LightScribe | Power: Chieftec (GPS-500AB-A) 500W all in: NZXT Apollo Crafted Series Black

Mouse: A4TECH XL-750F
Keyboard: Saitek Eclipse II
Monitor: 19 LG Flatron W1952TQ-PF
User avatar
NNPlaya
Community Veteran
Community Veteran
Posts: 372
Joined: Sat Oct 14, 2006 4:52 pm
Location: Tuszyn, Polska
Contact:

Post by NNPlaya »

Której linijki się czepia?? Może być tak jeżeli zamiast nawiasów " " wpisałeś takie: ' ' albo odwrotnie.
User avatar
Blashix
Community Veteran
Community Veteran
Posts: 375
Joined: Sun Apr 29, 2007 8:23 am
Location: Polska

:/

Post by Blashix »

Pluje się dokładnie na tą:

Code: Select all

Case Query("Q1") of 
--> 02.12.2008 PC <--
| AMD Athlon 64 X2 5400 Black Edition 3,4Ghz + Cooling Pentagram Freezone HP-120 AlCu Karakorum | GoodRam DDR2 2x 2GB 810Mhz CL4 + Arctic Cooling Arctic RC | Asus M3A78 PRO AMD 780G (Radeon HD 3200 & HD Audio Realtek ALC1200) | Radeon HD 4850 Gigabyte 512MB 700/2000 MHz + Zalman Cooling | Samsung SpinPoint T166 320 GB (SATA II, 16MB cache, NCQ) | LG SuperMulti DVD LightScribe | Power: Chieftec (GPS-500AB-A) 500W all in: NZXT Apollo Crafted Series Black

Mouse: A4TECH XL-750F
Keyboard: Saitek Eclipse II
Monitor: 19 LG Flatron W1952TQ-PF
Radzio
Site Administrator
Site Administrator
Poland
Posts: 2898
Joined: Fri Jul 28, 2006 10:58 am
Location: Bialystok, Poland

Re: SAIL - Zapytania

Post by Radzio »

Wymien caly kod na ten i zastosuj sie do komentarzy.

Code: Select all

every 0$1 trigger IsInArea(berd,Area10) do
begin
CenterOnUnits(berd);
DialogueOn;
Say(winston,'dialog3');
Case Query('Q1') of
1: begin
Say(berd,'dialog6');
DialogueOff;
end;
2: begin
Say(winston,'dialog7');
YouLost('');
end;
end;

on enterbuilding(b,un) do
begin
if b=eon then
if un=berd then
begin
wait(0$1);
savecharacters(berd,'B');
changemap(1,'%_cont'); // przy takim przejsciu uzycie zapisu postaci jest bezsensowne - ten temat byl juz poruszany na forum
end;
end;
User avatar
NNPlaya
Community Veteran
Community Veteran
Posts: 372
Joined: Sat Oct 14, 2006 4:52 pm
Location: Tuszyn, Polska
Contact:

Post by NNPlaya »

Nie będzie chyba trzeba całego kodu zmieniać, wystarczy, że wpiszesz zamiast
Case Query("Q1") of

Case Query('Q1') of

czyli zmienisz nawiasy z podwójnych na pojedyncze.
Radzio
Site Administrator
Site Administrator
Poland
Posts: 2898
Joined: Fri Jul 28, 2006 10:58 am
Location: Bialystok, Poland

Post by Radzio »

Ja edytowalem to na jego kodzie nie na twoim xD. Nawet na niego nie patrzylem.
User avatar
NNPlaya
Community Veteran
Community Veteran
Posts: 372
Joined: Sat Oct 14, 2006 4:52 pm
Location: Tuszyn, Polska
Contact:

Post by NNPlaya »

W każdym razie oba kody powinny działać
User avatar
Blashix
Community Veteran
Community Veteran
Posts: 375
Joined: Sun Apr 29, 2007 8:23 am
Location: Polska

:P

Post by Blashix »

No już poszło ale zaczeło znowu na tej linice:

Code: Select all

on enterbuilding(b,un) do 
Więc zmieniłem co nie co:

Code: Select all

on enterbuilding(b,un) do
begin
if b=eon then
if un=berd then
begin
wait(0$1);
savecharacters(berd,'B');
changemap(1,'%_cont'); // przy takim przejsciu uzycie zapisu postaci jest bezsensowne - ten temat byl juz poruszany na forum
end;
end;
Na takie cuś:

Code: Select all

on enterbuilding(b,un) do
begin
if b=eon then
if un=berd then
wait(0$1);
changemap(1,'%_cont');
end;
I teraz działa :)
EDIT: Zmieniłem i dalej działa :)
Last edited by Blashix on Tue May 08, 2007 4:12 pm, edited 1 time in total.
--> 02.12.2008 PC <--
| AMD Athlon 64 X2 5400 Black Edition 3,4Ghz + Cooling Pentagram Freezone HP-120 AlCu Karakorum | GoodRam DDR2 2x 2GB 810Mhz CL4 + Arctic Cooling Arctic RC | Asus M3A78 PRO AMD 780G (Radeon HD 3200 & HD Audio Realtek ALC1200) | Radeon HD 4850 Gigabyte 512MB 700/2000 MHz + Zalman Cooling | Samsung SpinPoint T166 320 GB (SATA II, 16MB cache, NCQ) | LG SuperMulti DVD LightScribe | Power: Chieftec (GPS-500AB-A) 500W all in: NZXT Apollo Crafted Series Black

Mouse: A4TECH XL-750F
Keyboard: Saitek Eclipse II
Monitor: 19 LG Flatron W1952TQ-PF
Radzio
Site Administrator
Site Administrator
Poland
Posts: 2898
Joined: Fri Jul 28, 2006 10:58 am
Location: Bialystok, Poland

Post by Radzio »

Teraz to nie ma sensu, bo kod zmieni mape, jesli ktokolwiek wejdzie do EONa, a zaczeka jeszcze 1 sek, jesli to bedzie berd.
User avatar
NNPlaya
Community Veteran
Community Veteran
Posts: 372
Joined: Sat Oct 14, 2006 4:52 pm
Location: Tuszyn, Polska
Contact:

Post by NNPlaya »

Powinieneś zamknąć to w begin end

Code: Select all

on enterbuilding(b,un) do
begin
if b=eon then
if un=berd then
Begin
wait(0$1);
changemap(1,'%_cont');
end;
end;
Locked