Valithor
2012-04-03 00:12:57
Hey Guys… I was wondering if anyone with more scripting knowledge could help me understand why my script isn't dropping. It's based off of two of YoHoJo's dropping methods. The idea is to use a random of the 4 FishPatterns provided by the DropSetup so that it would provide randomization in the dropping procedure.
Any ideas on a fix? or other dropping methods?
[Resolved] Needed to add DropSetup to my Dropping procedure. Thanks for the help that was given.
Any ideas on a fix? or other dropping methods?
procedure DropSetup;
begin
SetArrayLength(FishPattern, 4);
FishPattern[0]:= [1, 5, 9, 13, 17, 21, 25, 2, 6, 10, 14, 18, 22, 26, 3, 7, 11, 15, 19, 23, 27, 4, 8, 12, 16, 20, 24, 28];
FishPattern[1]:= [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28];
FishPattern[2]:= [1, 2, 3, 4, 8, 7, 6, 5, 9, 10, 11, 12, 16, 15, 14, 13, 17, 18, 19, 20, 24, 23, 22, 21, 25, 26, 27, 28];
FishPattern[3]:= [1, 5, 9, 13, 17, 21, 25, 26, 22, 18, 14, 10, 6, 2, 3, 7, 11, 15, 19, 23, 27, 28, 24, 20, 16, 12, 8, 4];
end;
procedure Dropping;
var
MyFish_DTM, x, y, I, R: integer;
SlotBox:TBox;
begin
MyFish_DTM:= DTMFromString('myS0oPer1337dtmStr1ng');
R:= Random(4);
for I:= 0 to 27 do
begin //using the following Writeln for Debugging purposes
Writeln('Using FishPattern[' + IntToStr(R) + ']');
SlotBox:= InvBox(FishPattern[R][I]); // Getting an "Error: Out Of Range" here
if FindDTM(MyFish_DTM, x, y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) then
begin
DropItem(FishPattern[R][I]);
Writeln('Dropping InvBox[' + IntToStr(I) + ']');
end;
end;
FreeDTM(MyFish_DTM);
end; [Resolved] Needed to add DropSetup to my Dropping procedure. Thanks for the help that was given.