12-27-2003, 12:26 AM
Hey all,
Im working on a rpg, but the map loading wont work I dunno if its because my code reads the map in one long line, but I am hoping you can help. here is the loading of the map:
Then before this I have the obvious stuff ect:
the map looks like this(im not going to write it all out:
Now when I run the program I get a subscript out of range error on this line:
Any help??
Mofu
Im working on a rpg, but the map loading wont work I dunno if its because my code reads the map in one long line, but I am hoping you can help. here is the loading of the map:
Code:
SUB loadmap (map$)
DIM fh AS INTEGER
fh = FREEFILE
OPEN map$ FOR INPUT AS #fh
INPUT #fh, MaxX, MaxY
FOR j = 0 TO MaxY
FOR i = 0 TO MaxX
INPUT #fh, map(i, j)
NEXT
NEXT
CLOSE #fh
END SUB
Then before this I have the obvious stuff ect:
Code:
DIFINT A-Z
DIM SHARED map(50, 50)
the map looks like this(im not going to write it all out:
Code:
49,49
1,1,1,1,1...
1,1,1,1,1...
1,1,1,1,1...
.....
Now when I run the program I get a subscript out of range error on this line:
Code:
tilenum = map(X + xtile, Y + ytile)
Any help??
Mofu