Swego czasu zacząłem robić moda do gry, w celu czysto rozrywkowym,potem dałem sobie z nim spokój na jakiś czas i teraz zrobilem wielki powrót ;p, ale po paru godzinach męczenie się z kodem wiem, że sam sobie nie poradzę.
Oto moje problemy:
1. Zapis Bazy i wczytanie jej w następnej(znalazłem kod ale nie wiem jak go umieścić)
Zapis
Code: Select all
//[...jakiś wcześniejszy kod]
every 0$10 do
var gorky, tmp, t, filter,un;
begin
gorky:=[];
filter:=FilterAllUnits([[f_side,3],[f_type,unit_building]]);
for un in filter do
begin
if GetBType(un) in [b_lab, b_lab_half, b_lab_full] then
gorky:=gorky^[[GetBType(un),GetX(un),GetY(un),GetDir(un),GetBLevel(un),GetNation(un),GetLabKind(un,1),GetLabKind(un,2)]]
else
if GetBType(un) in [b_bunker,b_turret] then
gorky:=gorky^[[getbtype(un),getx(un),gety(un),getdir(un),getblevel(un),getnation(un),getbweapon(un)]]
else
gorky:=gorky^[[GetBType(un),GetX(un),GetY(un),GetDir(un),GetBLevel(un),GetNation(un)]]
end;
SaveVariable(gorky,'gorky');
end;
//[...jakiś późniejszy kod]
Code: Select all
var zakladna,tmp,tmp1,x,y,r;
starting
begin
if testvariable('gorky') then zakladna=loadvariable('gorky',[])
else msg('neny kair');
uc_nation=nation_russian;
uc_side=2;
x=0;y=0;
for tmp in zakladna do
case tmp[1] of
b_lab,b_lab_half,b_lab_full:begin
bc_type=tmp[1];
bc_level=tmp[5];
bc_kind1=tmp[6];
bc_kind2=tmp[7];
tmp1=createandplacebuildingxyd(tmp[2],tmp[3],tmp[4]);
x=x+tmp[2];y=y+tmp[3];
setLives(tmp1,1000);
end;
b_bunker,b_turret:begin
bc_type=tmp[1];
bc_level=tmp[5];
tmp1=createandplacebuildingxyd(tmp[2],tmp[3],tmp[4]);
if tmp1 then placeweaponturret(tmp1,tmp[6]);
x=x+tmp[2];y=y+tmp[3];
end;
b_oil_mine,b_oil_power,b_solar_power,b_siberite_power,b_siberite_mine:begin
bc_type=tmp[1];
bc_level=tmp[5];
tmp1=createandplacebuildingxyd(tmp[2],tmp[3],tmp[4]);
x=x+tmp[2];y=y+tmp[3];
end;
end;
//[...jakiś późniejszy kod]
Code: Select all
every 0$01 trigger IsDead(JMM) do
Begin
ChangeMissionObjectives('C7');
if IsDead(JMM) then AddMedal('med2', 1) else AddMedal('med2', -1);
end;
Code: Select all
# C5
Add Secondary zabij
- Zabij J. Morpheusa-Matoła.
#
# C7
Out zabij
#
Code: Select all
//[...jakiś wcześniejszy kod]
every 0$1 trigger filterunitsinarea(A6,[[f_alive],[f_side,3],[f_type,unit_human]]) do
Begin
...//kod końca misji który wydaje się puki co działac
end;
Code: Select all
//[...jakiś wcześniejszy kod]
every 0$1 trigger depot1 do
begin
sibu:=GetResourceType(GetBase(depot1), mat_siberit);///mam var sibu; na początku
if sibu>30 then
ChangeMissionObjectives('C3');
AddMedal('med3',1)
end;
//[...jakiś późniejszy kod]
Z góry dzięki ;]