This isn't a question, just posting a fixed version of a map reader I was working on about a week ago. The problem I had that I didn't realize I had was removal of CR and LF ASCII Characters from the map format files.
Function Walls(width, height, layer)
Pos = 0
x2 = 0
For x = 1 to width * height
ByRB = Read Byte From File ("Map_t-1.txt", Pos)
`Remove Carriage Return Characters That are Generated when you press Enter Key while making file.
If ByRB = 13
Inc Pos, 2
ByRB = Read Byte From File ("Map_t-1.txt", Pos)
EndIf
If x2 > width - 1
x2 = 0
inc y, 1
EndIF
Text (x2 * 32) + 16, (y * 32) + 16, STR$(VAL(CHR$(ByRB)))
Map_Walls(x2, y) = Val(CHR$(ByRB))
display$ = display$ + STR$(pos) + " "
Inc Pos, 1:Inc x2, 1
Next x
Text 100, 200, display$
EndFunction
This is the main code, It reads bytes from a file, checks if they are CR or LF Characters, if not then they are saved to an array and displayed. If they are, we read until we find a character that isn't, thus "weeding" them out.
00000
01111
01000
01111
00000
Sample Map, you can really use anything for those numbers (Alphabetic, or Numeric characters). Save that as Map_t-1.txt (Or a custom name, just remember to change the filename in the main program). Then run the program and see what it does
This is useful for setting up solid and walkable tiles for RPGs, layers, event tiles, whatever else you can think of. Hope this helps some of the people wondering how to make a basic (Very BASIC) Map Reader.
Cheers!
If you have X-ray vision, can you see through your own eyelids?