SAIL - pomoc/help [CZ/EN]

Vše ohledně SAILu a tvorby modifikací do OW.
User avatar
Gravitr
Throwback Developer
Czech Republic
Posts: 238
Joined: Fri Jul 27, 2012 12:00 pm
Location: CZ Prague
Contact:

SAIL - pomoc/help [CZ/EN]

Post by Gravitr »

[CZ]

Zdravím

Potřeboval bych udělat v SAILu jednu věc, ale nemůžu přijít, jak na to;

Potřebuju jakoby napsat "Když strana 1 útočí na stranu 2, potom...*". Ani pomocí tutoriálů se mi to nedaří postavit, chtěl jsem zkusit "On Command(attack) do", ale nevěděl jsem, jak dál, protože na OWN tenhle command neni rozepsanej dopodrobna (ComAttackUnit). Takže se vás ptám tady, jestli někdo neví, jak na to?

* Př. když máte s nějakou stranou (UI) neutrál a začnete jí attackovat, tak aby se změnila diplomacie.

Díky

G.

[EN]

Hello

I need to do in SAIL one thing, bud I dont know how;

I need "If side 1 attacking on side 2, then...*". I tried "On Command(attack) do", but I dont know how continue, because this command is not on OWN described in detail (ComAttackUnit). So I asking you here, if you dont know, how on it?

* For example when you have some side with UI and you have with this side neutral diplomacy, and when you attack on the side, the diplomacy change to "enemy".

^bad english
Thanks

G.
[MOD] Arabian History - 9 missions
Show post with download

[MOD] Vsevolod Mission - 4 pro missions
Show post with download

[MP-MOD] Throwback - over 35 new missions
Official site (+download)
User avatar
Gothuk
Site Administrator
Site Administrator
Poland
Posts: 985
Joined: Tue Sep 04, 2007 6:10 pm
Location: Poland, Warsaw
Contact:

Re: SAIL - pomoc/help [CZ/EN]

Post by Gothuk »

Hello Gravitr!

You can use Contact event (http://original-war.net/sailbase.php?di ... ents&id=12)

Example:

Code: Select all

on Contact(side1, side2) do
begin
   if side1 = <my_side> and side2 = <enemy_side> then
   begin
      // code goes here...
   end;
end;
Where <my_side> is id of your side, and <enemy_side> id of your enemy side.
User avatar
Gravitr
Throwback Developer
Czech Republic
Posts: 238
Joined: Fri Jul 27, 2012 12:00 pm
Location: CZ Prague
Contact:

Re: SAIL - pomoc/help [CZ/EN]

Post by Gravitr »

Thank for quick reply.

I got error message:

Code: Select all

Compiling error at Main line 200: Expression expected

I tried to write "then" after bracket, but no change.
[MOD] Arabian History - 9 missions
Show post with download

[MOD] Vsevolod Mission - 4 pro missions
Show post with download

[MP-MOD] Throwback - over 35 new missions
Official site (+download)
User avatar
Gothuk
Site Administrator
Site Administrator
Poland
Posts: 985
Joined: Tue Sep 04, 2007 6:10 pm
Location: Poland, Warsaw
Contact:

Re: SAIL - pomoc/help [CZ/EN]

Post by Gothuk »

Ahh, right. After if should be then and no brackets inside.
Too much C-like languages ;).

So line with the if condition should be:

Code: Select all

if side1 = <my_side> and side2 = <enemy_side> then
User avatar
Gravitr
Throwback Developer
Czech Republic
Posts: 238
Joined: Fri Jul 27, 2012 12:00 pm
Location: CZ Prague
Contact:

Re: SAIL - pomoc/help [CZ/EN]

Post by Gravitr »

Now it's working. Thanks :P
[MOD] Arabian History - 9 missions
Show post with download

[MOD] Vsevolod Mission - 4 pro missions
Show post with download

[MP-MOD] Throwback - over 35 new missions
Official site (+download)
User avatar
Gravitr
Throwback Developer
Czech Republic
Posts: 238
Joined: Fri Jul 27, 2012 12:00 pm
Location: CZ Prague
Contact:

Re: SAIL - pomoc/help [CZ/EN]

Post by Gravitr »

Hm, i got fail at this event.


This work

Code: Select all

if side1 = 1 and side2 = 2 then
This does not work

Code: Select all

if side1 = 2 and side2 = 1 then
I tried to write this, but no change (attacking/player side is arabian nation)

Code: Select all

if GetNation(side1) = nation_arabian and GetNation(side2) = nation_american then
Any ideas?
[MOD] Arabian History - 9 missions
Show post with download

[MOD] Vsevolod Mission - 4 pro missions
Show post with download

[MP-MOD] Throwback - over 35 new missions
Official site (+download)
User avatar
Gothuk
Site Administrator
Site Administrator
Poland
Posts: 985
Joined: Tue Sep 04, 2007 6:10 pm
Location: Poland, Warsaw
Contact:

Re: SAIL - pomoc/help [CZ/EN]

Post by Gothuk »

http://original-war.net/sailbase.php?di ... ents&id=12
detects contact (first attack, or after more then 1000 ticks); always side1<side2
What do you want to do?
User avatar
Gravitr
Throwback Developer
Czech Republic
Posts: 238
Joined: Fri Jul 27, 2012 12:00 pm
Location: CZ Prague
Contact:

Re: SAIL - pomoc/help [CZ/EN]

Post by Gravitr »

Side 2 (arabians yellow) attacking on side 1 (americans blue)

but I dont know how to write it, when side1 must be < than side2
[MOD] Arabian History - 9 missions
Show post with download

[MOD] Vsevolod Mission - 4 pro missions
Show post with download

[MP-MOD] Throwback - over 35 new missions
Official site (+download)
User avatar
Gothuk
Site Administrator
Site Administrator
Poland
Posts: 985
Joined: Tue Sep 04, 2007 6:10 pm
Location: Poland, Warsaw
Contact:

Re: SAIL - pomoc/help [CZ/EN]

Post by Gothuk »

You wrote:
Gravitr wrote:This work

Code: Select all

if side1 = 1 and side2 = 2 then
So what's the problem?
That should detect both: when side 2 attacking side 1, and also side 1 attacking side 2.
User avatar
Gravitr
Throwback Developer
Czech Republic
Posts: 238
Joined: Fri Jul 27, 2012 12:00 pm
Location: CZ Prague
Contact:

Re: SAIL - pomoc/help [CZ/EN]

Post by Gravitr »

Ah, I didn't know that it works both sides :wink: Thanks :)
[MOD] Arabian History - 9 missions
Show post with download

[MOD] Vsevolod Mission - 4 pro missions
Show post with download

[MP-MOD] Throwback - over 35 new missions
Official site (+download)
User avatar
Gravitr
Throwback Developer
Czech Republic
Posts: 238
Joined: Fri Jul 27, 2012 12:00 pm
Location: CZ Prague
Contact:

Re: SAIL - pomoc/help [CZ/EN]

Post by Gravitr »

I've got bug

I have area, which is for materalization (falling) crates. I wrote in sail just "CreateCrates in area".

Code: Select all

every 0$30 marked 102 do
begin
  Wait(rand(2$50,4$30));
  CreateCratesArea(crates, 5, true);
  enable;
end;

But now i get the bug; the crates are falling into top together, where is no area. And to area didnt fall any crate.

Something like this
Spoiler:
Image
Is here way how to fix it? It doing me only at 1 map.
[MOD] Arabian History - 9 missions
Show post with download

[MOD] Vsevolod Mission - 4 pro missions
Show post with download

[MP-MOD] Throwback - over 35 new missions
Official site (+download)
User avatar
Gothuk
Site Administrator
Site Administrator
Poland
Posts: 985
Joined: Tue Sep 04, 2007 6:10 pm
Location: Poland, Warsaw
Contact:

Re: SAIL - pomoc/help [CZ/EN]

Post by Gothuk »

Are you sure, that you typed a good variable name? Maybe you forgot to set correct identificator into area?

Edit.
Solved. The problem was with the bad parameters order. The first should be crates amount and second area.
User avatar
Gravitr
Throwback Developer
Czech Republic
Posts: 238
Joined: Fri Jul 27, 2012 12:00 pm
Location: CZ Prague
Contact:

Re: SAIL - pomoc/help [CZ/EN]

Post by Gravitr »

Hi, i need (tech_) constant of siberite implosion (mobile bomb), but i cant find it in identify.
Image
[MOD] Arabian History - 9 missions
Show post with download

[MOD] Vsevolod Mission - 4 pro missions
Show post with download

[MP-MOD] Throwback - over 35 new missions
Official site (+download)
User avatar
Gothuk
Site Administrator
Site Administrator
Poland
Posts: 985
Joined: Tue Sep 04, 2007 6:10 pm
Location: Poland, Warsaw
Contact:

Re: SAIL - pomoc/help [CZ/EN]

Post by Gothuk »

http://original-war.net/sailbase.php?di ... roups#i_24

That should be one from
tech_Sib1 = 54
tech_Sib2 = 55
tech_Sib3 = 56
tech_SibContam = 26
tech_SibDet = 20
tech_SibEng = 22
tech_SibFiss = 25
tech_SibLoc = 19
tech_SibPow = 21
The first 3 are upgrades, Det - Detection, Eng - Engine, Pow - Power.
So this is sth from SibContam, SibFiss or SibLoc.
User avatar
Gravitr
Throwback Developer
Czech Republic
Posts: 238
Joined: Fri Jul 27, 2012 12:00 pm
Location: CZ Prague
Contact:

Re: SAIL - pomoc/help [CZ/EN]

Post by Gravitr »

I tried all technologies, which could be possible this tech. I also tried to write this tech in a lot of shapes. No result.

This technology probably missing in OWAR and it have no constant.
[MOD] Arabian History - 9 missions
Show post with download

[MOD] Vsevolod Mission - 4 pro missions
Show post with download

[MP-MOD] Throwback - over 35 new missions
Official site (+download)
Post Reply