Post 11 Jan 2018, 18:09 by JulianSnow2
The map / script I was using is from this map: A Secret Zone LLL V 3.8_53A52C71
The script says this:
// Toxic's scripts
// DECLARATION:
type aBuildings = record
Schools: array of Integer;
Markets: array of Integer;
end;
type aPLAYER = record
Buildings: aBuildings;
TowersCount: Byte;
end;
var PLAYER: array of aPLAYER;
const TOWERSLIMIT = 5;
// SCHOOLHOUSE
procedure Recruits(var aPlayer: Integer);
var i: Integer;
begin
for i := 0 to Length(PLAYER[aPlayer].Buildings.Schools)-1 do
if States.HouseRepair(PLAYER[aPlayer].Buildings.Schools) and (States.HouseResourceAmount(PLAYER[aPlayer].Buildings.Schools, 7) > 0) and (States.HouseSchoolQueue(PLAYER[aPlayer].Buildings.Schools, 0) = - 1) then
Actions.HouseSchoolQueueAdd(PLAYER[aPlayer].Buildings.Schools, 13, 1);
end;
procedure AddHouse(aHouse: Integer; var Houses: array of Integer);
begin
SetLength(Houses, Length(Houses)+1);
Houses[High(Houses)] := aHouse;
end;
procedure RemoveHouse(aHouse: Integer; var Houses: array of Integer);
var i: Integer;
begin
for i := 0 to Length(Houses)-1 do if (Houses = aHouse) then break;
Houses := Houses[High(Houses)];
SetLength(Houses, Length(Houses)-1);
end;
// CARAVAN
There is more after this, but the caravan script doesn't interest me much. The script I had used in my try with the basic map "Abrak" was this:
type aBuildings = record
Schools: array of Integer;
end;
type aPLAYER = record
Buildings: aBuildings;
end;
var PLAYER: array of aPLAYER;
// SCHOOLHOUSE
procedure Recruits(var aPlayer: Integer);
var i: Integer;
begin
for i := 0 to Length(PLAYER[aPlayer].Buildings.Schools)-1 do
if States.HouseRepair(PLAYER[aPlayer].Buildings.Schools) and (States.HouseResourceAmount(PLAYER[aPlayer].Buildings.Schools, 7) > 0) and (States.HouseSchoolQueue(PLAYER[aPlayer].Buildings.Schools, 0) = - 1) then
Actions.HouseSchoolQueueAdd(PLAYER[aPlayer].Buildings.Schools[i], 13, 1);
end;
procedure AddHouse(aHouse: Integer; var Houses: array of Integer);
begin
SetLength(Houses, Length(Houses)+1);
Houses[High(Houses)] := aHouse;
end;
procedure RemoveHouse(aHouse: Integer; var Houses: array of Integer);
var i: Integer;
begin
for i := 0 to Length(Houses)-1 do if (Houses[i] = aHouse) then break;
Houses[i] := Houses[High(Houses)];
SetLength(Houses, Length(Houses)-1);
end;
Did delete some of the lines, since I don't think there should be a specific tower limit.
How is it that the script does not work on the Abrak map but does on the "secret zone" map ?
You do not have the required permissions to view the files attached to this post.