03-31-2005, 08:29 AM
Hello! On getting back from my vacation, I went and started working on my rpg again! All seemed well, until i got some eyes on the situation. It turns out that the map loader doesn't seem to load maps properly. I can't quite explain it properly, so i took a few screenshots: what it's supposed to look like and what it actually looks like. Note that I'm not sure if the problem is actually in my code, as it runs quite fine in my qbasic map editor and rpg.
this was captured in dosbox, 320x200...
using print screen, 640x480.
Here is my code for my map loader that i use. All variables have been dimensioned as short, as the maps were made using my qb map maker.
Thanks to anyone who can help solve my problem, and to those who try.
**EDIT** please note that there are no trees and some of the walls have been torn down in the second image because i only drew one layer: two different layers hold the trees and walls.
this was captured in dosbox, 320x200...
using print screen, 640x480.
Here is my code for my map loader that i use. All variables have been dimensioned as short, as the maps were made using my qb map maker.
Code:
SUB loadmap2 (filename$)
FOR y = 1 TO 4
numsets(y) = 0
NEXT
filenum = FREEFILE
OPEN filename$ FOR BINARY AS #filenum
GET #filenum,, mapdata.wid
GET #filenum,, mapdata.height
GET #filenum,, templength
palput = SPACE$(templength)
GET #filenum,, palput
GET #filenum,, activetilesets
FOR y = 1 TO activetilesets
GET #filenum,, til
GET #filenum,, templength
tileset(til) = SPACE$(templength)
GET #filenum,, tileset(til)
numsets(til) = 1
NEXT
REDIM maplayer(mapdata.wid, mapdata.height) AS short
REDIM mapoverlayer(mapdata.wid, mapdata.height) AS short
REDIM mapobjectlayer(mapdata.wid, mapdata.height) AS short
REDIM mapcollayer(mapdata.wid, mapdata.height) AS short
GET #filenum,, layerset(1)
GET #filenum,, layerset(2)
GET #filenum,, layerset(3)
FOR y = 0 TO mapdata.height
FOR x = 0 TO mapdata.wid
GET #filenum,, maplayer(x, y)
NEXT x, y
FOR y = 0 TO mapdata.height
FOR x = 0 TO mapdata.wid
GET #filenum,, mapoverlayer(x, y)
NEXT x, y
FOR y = 0 TO mapdata.height
FOR x = 0 TO mapdata.wid
GET #filenum,, mapcollayer(x, y)
NEXT x, y
FOR y = 0 TO mapdata.height
FOR x = 0 TO mapdata.wid
GET #filenum,, mapobjectlayer(x, y)
NEXT x, y
CLOSE #filenum
END SUB
Thanks to anyone who can help solve my problem, and to those who try.
**EDIT** please note that there are no trees and some of the walls have been torn down in the second image because i only drew one layer: two different layers hold the trees and walls.
Jumping Jahoolipers!