Goto https://www.stucuk.netGoto https://www.atlanticaonlinewiki.comGoto https://www.game-requirements.com


Menu


It is currently Fri Apr 19, 2019 4:04 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Sail codes
PostPosted: Tue May 01, 2018 11:32 am 
Offline
Soldier level 0
Soldier level 0

Joined: Sun May 01, 2016 1:36 pm
Posts: 14
Hi, i'm working on a mod and i have a question.. in mission 04 in my campaign the player must build up a base.. the mission ends when a research is completed.. then.. in mission 05 the mission starts in the same map as in mission 04, so .. what i really want to know.. is how should i put in sail to load the buildings in mission 05 that the player had build them in mission 04.



Thank you ! :D


Top
 Profile  
 
 Post subject: Re: Sail codes
PostPosted: Tue May 01, 2018 1:37 pm 
Offline
OW Support Owner
OW Support Owner
User avatar

Joined: Wed Dec 28, 2005 11:13 pm
Posts: 5008
Location: UK, Scotland
If you look at the sail for AM04 in the saveitall function it filters the players base and stores the positon, type, direction, etc in a variable and saves that variable.

Code:
tmz=filterunitsinarea(ambase,[[f_or,[f_side,amer],[f_side,amer2]],[f_nation,nation_american],[f_btype,b_factory]]);
  tmz=tmz^filterunitsinarea(ambase,[[f_or,[f_side,amer],[f_side,amer2]],[f_nation,nation_american],[f_type,unit_building],f_not,[f_btype,b_factory]]);
  tmzo=[];
  for bz in tmz do
    case getbtype(bz) of
      b_lab_basic,b_lab_weapon:begin end;  //shouldn't occur
      b_lab,b_lab_half,b_lab_full:tmzo=tmzo^[[getx(bz),gety(bz),getdir(bz),getbtype(bz),getblevel(bz),getnation(bz),getlabkind(bz,1),getlabkind(bz,2)]];
      b_bunker,b_turret:tmzo=tmzo^[[getx(bz),gety(bz),getdir(bz),getbtype(bz),getblevel(bz),getnation(bz),getbweapon(bz)]];
      else tmzo=tmzo^[[getx(bz),gety(bz),getdir(bz),getbtype(bz),getblevel(bz),getnation(bz)]];
    end;
  savevariable(tmzo,'Gamma2');


In AM05's load function it creates the buildings

Code:
Gamma2:=LoadVariable('Gamma2',[]);
    blds:=[];
    for i in Gamma2 do begin
      if not InArea(i[1], i[2], prostor) then begin
        bc_type:=i[4];
        bc_level:=i[5];
        uc_nation:=i[6];
        case bc_type of
             b_lab,b_lab_half,b_lab_full: begin
                                             bc_kind1:=i[7];
                                             bc_kind2:=i[8];
                                          end;
        end;
        tmp:=CreateAndPlaceBuildingXYD(i[1], i[2], i[3]);
        if GetBType(tmp)=b_bunker or GetBType(tmp)=b_turret then
          PlaceWeaponTurret(tmp, i[7]);
        if GetBType(tmp)=b_depot or GetBType(tmp)=b_warehouse then
          SetBName(tmp,'gamma');
        blds:=blds^tmp;
      end;
    end;

_________________
Image
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Top
 Profile  
 
 Post subject: Re: Sail codes
PostPosted: Tue May 01, 2018 4:47 pm 
Offline
Soldier level 0
Soldier level 0

Joined: Sun May 01, 2016 1:36 pm
Posts: 14
I've done that already.. it compiles with no error.. I've entered in the campaign and start playn to test it.. I built the buildings and when the next mission started.. there were no buildings at all.. i dunno.. i'm not that good with the sail commands.. so i don't figure what i'm doing wrong.. i just copied the function from the original campaign and changed a few things to correspond with my mod..but still doesn't work..


Top
 Profile  
 
 Post subject: Re: Sail codes
PostPosted: Wed May 02, 2018 3:42 pm 
Offline
Moderator
Moderator
User avatar

Joined: Wed Jun 11, 2014 6:14 pm
Posts: 17
Location: CZ Prague
Did you try to play your mod in game and not in the editor's gamemode?


Top
 Profile  
 
 Post subject: Re: Sail codes
PostPosted: Wed May 02, 2018 6:04 pm 
Offline
Soldier level 0
Soldier level 0

Joined: Sun May 01, 2016 1:36 pm
Posts: 14
Yes, I did.. I think i'm not writing the code in sail correctly.


Top
 Profile  
 
 Post subject: Re: Sail codes
PostPosted: Wed May 02, 2018 6:25 pm 
Offline
OW Support Owner
OW Support Owner
User avatar

Joined: Wed Dec 28, 2005 11:13 pm
Posts: 5008
Location: UK, Scotland
The code would need to be modified for your map. It won't work just by copying and pasting

_________________
Image
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Top
 Profile  
 
 Post subject: Re: Sail codes
PostPosted: Thu May 03, 2018 3:16 pm 
Offline
Moderator
Moderator
User avatar

Joined: Wed Jun 11, 2014 6:14 pm
Posts: 17
Location: CZ Prague
@Visinescu SAIL -> Compile gives you any errors?

Post your code.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Original War is an RTS / RPG game by Altar Games
Original War Support is not part of Altar Games but is maintaining Original War for Altar Games

Privacy Policy