Been playing around with a simple game, however, I notice that it only generates a random sequence once in awhile". I have not been able to pin point that exactly.
Of late it seems when I do a compile, then the random changes.
So my question is:
Is there anything that I could be doing that would negate the random effect?
...snippit...
Randomize;
map := thisMap(Player.Qx,Player.Qy); // <- creates a txt file holding the map i.e.: 6x3.txt for quad 6,3
if Not FileExists('maps\' + map) then begin
for i := 1 to maxInns do begin
if (IQx[i] = Player.Qx) and
(IQy[i] = Player.Qy) then begin
repeat
x := Random(10)+1;
y := Random(10)+1;
until isEmptySpot(x,y,True);
Sector[x,y] := InnTileId;
break;
end;
end;
for i := 1 to maxInns do begin
if (CQx[i] = Player.Qx) and
(CQy[i] = Player.Qy) then begin
repeat
x := Random(10)+1;
y := Random(10)+1;
until isEmptySpot(x,y,True);
Sector[x,y] := CastleTileId;
break;
end;
end;
for y := 1 to 10 do begin
for x := 1 to 10 do begin
if Sector[x,y] = 0 then begin
i := Random(10);
case i of
6..10: Sector[x,y] := 0;
2..5: Sector[x,y] := 1;
else Sector[x,y] := 2;
end;
end;
end;
end;
this just makes a simple 10x10 ascii forest (if you will) where players wander about. problem is when they exceed this section (sector) the quadrant changes - but it doesnt create a "random" map, just uses the same pattern.
in a nut shell (for those that want to know) this is a very very smple text game converted from an old 80's game called monster combat. I am rewriting it from scratch with some new features, one of them that remembers the map layout from quadrant to quadrant, and even saves the sector layout as well, so it eliminates the random forest when you come back (not to mention the inns and castles that wander about as well).
But.. I digress, random will not give me a new layout after the first one, but sometimes it does. And I cannot definitively repeat that "sometimes".