This code at least displays your map and the schlump on it.
set display mode 1280,1024,32
sync on
sync rate 50
autocam off
`set dir ".."
global curobj=100
type maptype
col as byte
block as integer
id as integer
state as byte
marker$ as string
endtype
global map_x : map_x = 100
global map_y : map_y = 40
global p1x#,p1y#, plf#, pli#, oplx#, oply#, plxs#, plys#, pdir#, retx#, rety# as float
global pdir, retx, rety
dim char_col(2,2)
dim map(map_x,map_y) as maptype
load image "Media\Backdrops\desert mountains.png",10
texture backdrop 10
make object cube 31,5.0 : hide object 31
global map_tran$=" *"
gosub set_testmap
gosub build_map
set camera range 20.0,1000.0
`---------
load object "media\characters\schlump.x",5 : loop object 5
position object 5,p1x#,p1y#,0.0
`-------
do
if abs(camy#-ply#)>20.0
if camy#>ply# then dec camy#,0.5 : if camy#<ply# then camy#=ply#
if camy#<ply# then inc camy#,0.5 : if camy#>ply# then camy#=ply#
endif
if camy#<64 then camy#=64
if camy#>400 then camy#=400
position light 0,16.5*5.0,camy#+200.0,-153.0
x# = object position x(5)
y# = object position y(5)
z# = object position z(5)
position camera x#,y# + 20,z# - 150.0
point camera x#,y#,z#
`control camera using arrowkeys 0,5.0,2.0
sync
loop
`-------
`---------------------------------------------
set_testmap:
`
` 0000000000111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999
map_set(00," ")
map_set(01," ")
map_set(02," ")
map_set(03," ")
map_set(04," ")
map_set(05,"****************** ")
map_set(06," ")
map_set(07," ")
map_set(08,"************************************************* ")
map_set(09," ")
map_set(10,"***************************** *************************************** ")
map_set(11," ")
map_set(12," ")
map_set(13,"************************ ")
map_set(14," ")
map_set(15," ")
map_set(16," ")
map_set(17,"*************************************************** ")
map_set(18," ")
map_set(19," ")
map_set(20," ")
map_set(21," ")
map_set(22," ")
map_set(23," ")
map_set(24,"***************************************************************************** ")
map_set(25," ")
map_set(26," ")
map_set(27," ")
map_set(28," ")
map_set(29," ")
map_set(30," ")
map_set(31," ")
map_set(32," ")
map_set(33," ")
map_set(34," ")
map_set(35," ")
map_set(36," ")
map_set(37," ")
map_set(38," ")
map_set(39," S ")
map_set(40,"****************************************************************************************************")
return
`---------------------------------------------
build_map:
for y=0 to map_y
for x=0 to map_x
curobj=((y*(map_x+1))+x)+1000
if object exist (curobj)=1 then delete object curobj
xx#=(x*5.0)+2.5
yy#=(y*5.0)+2.5
zz#=0.0
if map(x,y).block = 1 `brick
map(x,y).id=curobj
clone object curobj,31
scale object curobj,100,100,200-rnd(50)
r=rnd(255) : g=rnd(255) :b=rnd(255)
color object curobj,rgb(r,g,b)
set object emissive curobj,rgb(r/2,g/2,b/2)
position object curobj,xx#,yy#,zz#
endif
next x
next y
return
`-----------------------------------
function map_set(y,marker$)
y = map_y - y
for p = 1 to map_x + 1
pm$ = mid$(marker$,p)
x = p - 1
if pm$="S"
p1x# = (x * 5.0)
p1y# = (y * 5.0)
endif
if pm$ = "*" then map(x,y).block = 1
`for n=1 to len(map_trans$)`
`if mid$(map_tran$,n)=pm$ then map(x,y).block=n-1
`next n
map(x,y).marker$=pm$
next p
endfunction
`'-----------
function map_block(x#,y#)
x=int(x#/5.0)
y=int(y#/5.0)
if x<0 then x=0
if x>map_x then x=map_x
if y<0 then y=0
if y>map_y then y=map_y
retx=x
rety=y
col=map(x,y).block
endfunction col
I had to change the set display mode to one that would work on my desktop. I made a few edits. For example, TEXTURE BACKDROP is available to easily put the backdrop image in the background. You should be able to go through the code and compare it to your existing code to see the changes that were made.
EDIT:
Almost forgot, if you want to look around at the map, REM out the position camera and point camera commands in the main loop and UN-REM the CONTROL CAMERA USING ARROWKEYS command. Then use the arrow keys to look around.