Hey guys,
I still haven't gotten the maps to work but no worries. I've changed everything over to a different system which, in the long run, is going to work out WAY better.
To anybody else that has had a similar problem as I, here is my "loadlevel" code-
REM This is were we would load our texture for the objects, the textures can be used for several objects, meshes can not, so we will make those as we need them
REM Open level file to read
open to read 1,"level22.txt"
REM Start the level reading and creating process, using a for .. next loop - The amount of times this loops is dertimined by the NUMBER_OF_OBJECTS variable, read from our level file
LineCount=0
n=1
Repeat
REM Read contents of level file, so we can determin what type of object it is, where it is positioned and how it is rotated
Inc LineCount
read string 1,T$ : OBJECT_X_POSITION = val(T$)
Inc LineCount
read string 1,T$ : OBJECT_Z_POSITION = val(T$)
Inc LineCount
read string 1,T$ : OBJECT_TYPE = val(T$)
read string 1,T$ : OBJECT_ROTATION = val(T$)
REM Check what type of object it is by checking variable OBJECT_TYPE
REM Check if the object is a cube object
if OBJECT_TYPE = 1
REM Make a cube and assign it to the current object number - defined by our loop variable - n
make object box n+1000,100,100,100
REM Texture the current object with the corresponding texture(Remmed out for this example)
texture object n+1000,1
REM Position the object with the OBJECT_X_POSITION and OBJECT_Z_POSITION data - Read from our level file - An extra Y value can be added by changing the file structure a bit
position object n+1000,OBJECT_X_POSITION,0,OBJECT_Z_POSITION
sc_setupObject n+1000,0,2
REM Rotate the object correctly using the OBJECT_ROTATION data - Read from our level file
`yrotate object n,OBJECT_ROTATION
endif
REM Check if the object is a sphere object, OBJECT_TYPE would have a value of 2 if it is, and a value of one if it is a cube object
if OBJECT_TYPE = 2
make object cube n+1000,1
texture object n+1000,1
position object n+1000,OBJECT_X_POSITION,0,OBJECT_Z_POSITION
yrotate object n+1000,OBJECT_ROTATION
endif
REMSTART
You can have as many object types as you want
just make sure you add them to the level writing code as well as the level reading code
No changing of the level structure is required
REMEND
REM Move onto the next object
Until File End(1)=1
Close File 1
endfunction
It's based off of Satchmo's example, so here to get more info about how it works (scroll down a little bit)-
http://forum.thegamecreators.com/?m=forum_view&t=145741&b=10. NOTE : While I based it off his example, I had to change it quite a bit to get it to work for me (i.e. replaced FOR NEXT with REPEAT UNTIL). I would suggest that you use my version instead, just because I couldn't get his to work.
PS : I like this forum's smileys