Edytor
- YuriStriatov
- Site Administrator
- Posts: 1395
- Joined: Fri Feb 17, 2006 3:02 am
- Contact:
- YuriStriatov
- Site Administrator
- Posts: 1395
- Joined: Fri Feb 17, 2006 3:02 am
- Contact:
O stary sory:P pojebało mi sie. Jam moge zrobić coś takiego że gdy jednostka wejdzie mi do danego obszaru to powiedzmy coś się stanie. Puki co robiłem to tak że dawałem UnitInArea blablabla ale nic sie niedziało.
Normalnie w pascalu jest taka komenda jak IF THEN ELSE, jest jakis odpowiednik w SAILU no bo tak to nie działa. Mam też problem z dialogami. Jak to jest z tą komendą WAIT i DWAIT. Jest tak ze jak daje np. wait(200) to czeka 200 tck np. jest 300 tck i daje ta komende to te 200 idzie od początku czyl od 0 czy od 300 ??
Normalnie w pascalu jest taka komenda jak IF THEN ELSE, jest jakis odpowiednik w SAILU no bo tak to nie działa. Mam też problem z dialogami. Jak to jest z tą komendą WAIT i DWAIT. Jest tak ze jak daje np. wait(200) to czeka 200 tck np. jest 300 tck i daje ta komende to te 200 idzie od początku czyl od 0 czy od 300 ??
Original War is my life, my girl and my fuel to correct existance.
- YuriStriatov
- Site Administrator
- Posts: 1395
- Joined: Fri Feb 17, 2006 3:02 am
- Contact:
It doesn't have Uses and you don't do program name.
1.06's Editor has a Includes thing where u can add SAIL files from \SAIL\Libraries\ into a map. (The Idea being to be like the Uses thing. Tho you do not add Code to add them, you just click a button)
SAIL files included this way act like a normal maps SAIL file, all of them can use any others EXPORT'd things.
One SAIL file should have:
AFAIK there is no 'Procedures' in SAIL, you just use a Function. Functions and Varibles don't need to have there TYPE declared. I.E
Pascal:
In SAIL:
Pascal:
SAIL:
Anything thats EXPORTED needs to have EXPORT b4 there name, i.e:
Making a Varible usable in every module:
Making a Function usable in every module:
1.06's Editor has a Includes thing where u can add SAIL files from \SAIL\Libraries\ into a map. (The Idea being to be like the Uses thing. Tho you do not add Code to add them, you just click a button)
SAIL files included this way act like a normal maps SAIL file, all of them can use any others EXPORT'd things.
One SAIL file should have:
Which is the first bit of code thats executed which normaly sets up everything.starting
begin
end;
AFAIK there is no 'Procedures' in SAIL, you just use a Function. Functions and Varibles don't need to have there TYPE declared. I.E
Pascal:
Code: Select all
Function Something(AVarible : String) : String;
begin
Result := AVarible;
end;
Code: Select all
Function Something(AVarible);
begin
Result := AVarible;
end;
Code: Select all
Procedure Something(AVarible : String);
begin
end;
Code: Select all
Function Something(AVarible);
begin
end;
Making a Varible usable in every module:
Code: Select all
EXPORT AVarible;
Code: Select all
EXPORT Function Something(AVarible);
begin
end;
- Stu
OWSupport
OWSupport
dobra, ale jak zrobić żeby mi to if then else działało. robie mniej wiecej taki kod, niepodam go teraz dokładnie.
starting
begin
if unitinarea(2,2) do
centeronunit(2);
commoveunitxy([1,2],x,y);
end;
end;
jakoś tak to wygląda, dawałem jeszcze funkcje
funkcion lol;
begin
centeronunit(2);
commoveunitxy([1,2],x,y);
end;
tak jak mówie dokładnie teraz tych komend nie pamiętam, wiec kod nie będzie dokładny.
albo jak chcę zrobić więcej modółówm, jak to sie robi bo nie moge dac w dwóch starting czy wiecej, jak to sie robi??
starting
begin
if unitinarea(2,2) do
centeronunit(2);
commoveunitxy([1,2],x,y);
end;
end;
jakoś tak to wygląda, dawałem jeszcze funkcje
funkcion lol;
begin
centeronunit(2);
commoveunitxy([1,2],x,y);
end;
tak jak mówie dokładnie teraz tych komend nie pamiętam, wiec kod nie będzie dokładny.
albo jak chcę zrobić więcej modółówm, jak to sie robi bo nie moge dac w dwóch starting czy wiecej, jak to sie robi??
Original War is my life, my girl and my fuel to correct existance.
SAIL Syntax like every other language(Well all main programming languages, so far iv not found one which doesn't use English for the Syntax) uses English words. You can not use Polish words for Syntax things.
I.E
That WILL NOT work. It needs to be Function
That won't work.
I.E
Code: Select all
funkcion lol;
begin
centeronunit(2);
commoveunitxy([1,2],x,y);
end;
Code: Select all
if unitinarea(2,2) do
- Stu
OWSupport
OWSupport
On pisze wszystko po angielsku?? Ok, so then how to do this??Today i have made code like this one:
function zonk;
begin
sendsiberiterocket(x,y);
end;
function meet;
begin
centeronxy(x,y);
commoveunittoarea( or commovetoarea)([1,2],area);
end;
function side;
begin
setside(unit,1);
end;
starting
begin
wait(1000);
if unitinarea(unit,area) then meet
else zonk;
if unitinarea(unit,area) then side
else zonk;
end;
is this code ok? function meet is starting before 1000 tck, also i have troubles with dialogues(ingamein etc.)
function zonk;
begin
sendsiberiterocket(x,y);
end;
function meet;
begin
centeronxy(x,y);
commoveunittoarea( or commovetoarea)([1,2],area);
end;
function side;
begin
setside(unit,1);
end;
starting
begin
wait(1000);
if unitinarea(unit,area) then meet
else zonk;
if unitinarea(unit,area) then side
else zonk;
end;
is this code ok? function meet is starting before 1000 tck, also i have troubles with dialogues(ingamein etc.)
Original War is my life, my girl and my fuel to correct existance.
Assuming things like X,Y,Unit,Area are Global varibles. If there ment to be inputs into the functions like Zonk(5,6); then u need to do:
To Activate things after a certain time u can do:
If enabled isn't between begin and end of an Every then its disabled after its used.
I.e to have an every repeat u would do:
0$01 is the time. Anything b4 the $ is minutes and after is seconds. So 10$0 is 10 Minutes and 0$10 is 10 seconds.
Some Misc SAIL + General modding info can be found Here (Can't be bothered linking to direct help for things)
A Small tutorial on SAIL Basics can be found Here
Code: Select all
Function Zonk(x,y);
begin
sendsiberiterocket(x,y);
end;
Code: Select all
Every 0$01 do
begin
if unitinarea(unit,area) then meet
else zonk;
if unitinarea(unit,area) then side
else zonk;
end;
I.e to have an every repeat u would do:
Code: Select all
Every 0$01 do
begin
Enabled;
end;
Some Misc SAIL + General modding info can be found Here (Can't be bothered linking to direct help for things)
A Small tutorial on SAIL Basics can be found Here
- Stu
OWSupport
OWSupport
Thanx Stuck youre GREAT! So then i want to do query. blablabla in .txt file but how to do something if i tipically choose one of three option.
like this one:
what to do?(and there are x options)
-x1
-x2 (how to do something like if i choose x1 then game exits or if i choose x2 then i gained 100 crates)
also i have troubles with areas.
---
function side;
begin
setside(52,1);
end;
function zonk;
begin
sendsiberiterocket(66,48);
end;
function meeting;
begin
centeronxy(66,48);
commovetoarea(52,1);
end;
starting
begin
wait(1000);
IF IsInArea(68,1) then meeting
else ;
if isinarea(52,2) then side;
end;
i made this code and. function side dosnt work when unit 52 enters area 2;
its automatickly goes to area 1 before i get there by unit 68;
like this one:
what to do?(and there are x options)
-x1
-x2 (how to do something like if i choose x1 then game exits or if i choose x2 then i gained 100 crates)
also i have troubles with areas.
---
function side;
begin
setside(52,1);
end;
function zonk;
begin
sendsiberiterocket(66,48);
end;
function meeting;
begin
centeronxy(66,48);
commovetoarea(52,1);
end;
starting
begin
wait(1000);
IF IsInArea(68,1) then meeting
else ;
if isinarea(52,2) then side;
end;
i made this code and. function side dosnt work when unit 52 enters area 2;
its automatickly goes to area 1 before i get there by unit 68;
Original War is my life, my girl and my fuel to correct existance.
u should have it like:ditos wrote:function side;
begin
setside(52,1);
end;
function zonk;
begin
sendsiberiterocket(66,48);
end;
function meeting;
begin
centeronxy(66,48);
commovetoarea(52,1);
end;
starting
begin
wait(1000);
IF IsInArea(68,1) then meeting
else ;
if isinarea(52,2) then side;
end;
i made this code and. function side dosnt work when unit 52 enters area 2;
its automatickly goes to area 1 before i get there by unit 68;
Code: Select all
Every 00$01 do
begin
IF IsInArea(68,1) then meeting
else
enabled;
end;
Every 00$01 do
begin
if isinarea(52,2) then side
else
enabled;
end;
Code: Select all
case Query('Q1') of
1:begin
Say(Heike,'D3aH1');
// you start to attack ...
SetAttitude(you,americans,att_enemy,false);
ComAttackUnit(Heike,am1);
wait(am1reaction);
ingame_video:=false;
ingameoff;
// ... and american start to attack you. You can play again
SetAttitude(americans,you,att_enemy,false);
ComFree(am1);
ComAttackUnit(am1,Heike);
// ... but botho russians are comming
wait(0$3);
com_queue:=true;
ComAttackUnit(rusboth,am1);
ComAttackUnit(rusboth,Heike);
com_queue:=false;
Say(rus1,'D3aR1');
end;
2:begin
Say(Heike,'D3bH1');
ComMoveXY(Heike,67,18);
// you go away
wait(0$1);
ingame_video:=false;
ingameoff;
// and russians are comming
com_queue:=true;
ComAttackUnit(rusboth,am1);
ComFree(rusboth);
com_queue:=false;
Say(rus1,'D3bR1');
ComFree(am1);
end;
3:begin
// you move forward
Say(Heike,'D3cH1');
ComMoveUnit(Heike,rus1);
ingame_video:=false;
ingameoff;
// you move toward the russians
wait(0$2);
ComStop(Heike);
com_queue:=true;
// they want am1 to die
ComAttackUnit(rusboth,am1);
ComFree(rusboth);
com_queue:=false;
Say(rus1,'D3cR1');
ComFree(am1);
end;
end;
- Stu
OWSupport
OWSupport
Ok stuck, but can u give me better example of query?
And what is this --->> "// they want am1 to die"
I dont know how can it be in english so to jest komentarz czy co?
dalej nie wiem jak zrobic coś takiego ze jak wybiore jedną opcje z powiedzmy 3 które dałem do query to np. jakis kolo sie domnie przyłączy, albo zacznie sie ze mną nawalać itd.
Mogłem to napisać po angielsku ale po co łamać sobie palce na klawie.
---
Also i try to use EVERY but that command wasn`t work?
it must be
every 00$1 blablabla
or it must be
every 0$1 blablabla?
And what is this --->> "// they want am1 to die"
I dont know how can it be in english so to jest komentarz czy co?
dalej nie wiem jak zrobic coś takiego ze jak wybiore jedną opcje z powiedzmy 3 które dałem do query to np. jakis kolo sie domnie przyłączy, albo zacznie sie ze mną nawalać itd.
Mogłem to napisać po angielsku ale po co łamać sobie palce na klawie.
---
Also i try to use EVERY but that command wasn`t work?
it must be
every 00$1 blablabla
or it must be
every 0$1 blablabla?
Original War is my life, my girl and my fuel to correct existance.