Hi, I'm having a bit of a problem. I made this model (in x format) and placed it in the root folder of my game. When I compile/run, I get a runtime error: Cannot load 3D object at line 51. I don't know what could be wrong, as another x file I made works perfectly. Luka.x (the problem file) is about 7.5 MB if that's important, and I used a converter from another format to make it an x file (just in case that's important too).
I appreciate the help, and I've supplied the entire code below:
Rem Screen Settings
Sync On: Sync Rate 0
SET WINDOW SIZE 640, 480
rem Global data
global ambience# as integer
global blockobj as integer
dim objtype(10000)
LOAD SOUND "audio\cursor_wav.wav",1
LOAD MUSIC "audio\01_Title.mid",1
LOAD MUSIC "audio\02_World.mid",2
SET MUSIC VOLUME 1, 80
LOOP MUSIC 1
Load Image "Title.png",1
Load Image "con_button.png",3
Load Image "quit_button.png",4
Load Image "srt_button.png",2
Load Image "con_button_uns.png",6
Load Image "quit_button_uns.png",7
Load Image "srt_button_uns.png",5
Paste Image 1,0,0
Set Text Opaque
musvol = 80
Do
Mx=MouseX(): My=MouseY(): Mc=MouseClick()
Gosub CheckRegion
Sync
Loop
End
CheckRegion:
Rem First Button
If Mx > 225 and My > 332 And Mx < 416 And My < 373
If Mc=1
Rem Add here, whatever code you want to be executed when you click button 1
`----------- BEGIN new game code
New_Game:
cls
Repeat
if musvol > 0 then SET MUSIC VOLUME 1,musvol
Text 240,220,"Get Ready to Play";
musvol=musvol-1
sync
Until scancode()>0
STOP MUSIC 1
SET MUSIC VOLUME 2,80
LOOP MUSIC 2
LOAD OBJECT "Luka.x", 1
load object "worldthing.x",2
make matrix 1,200,200,5,5
Position Matrix 1,-100,0,-100
`This sets up the variables for the Game Timer
movespeed = 75
turnspeed = 87.5
time=timer()
Do
gameTime=timer()-time `The time elapsed between the start of the game and the current time
MSframe#=gameTime*(movespeed/1000.0)
TSframe#=gameTime*(turnspeed/1000.0)
If Upkey()=1
Move Object 1,MSframe#
endif
If Downkey()=1
Move Object 1,-MSframe#
endif
If Leftkey()=1
Dec a#,TSframe#
endif
If Rightkey()=1
Inc a#,TSframe#
endif
yrotate object 1,a#
posx#=cos(270-a#) * 30 + object position x(1)
posz#=sin(270-a#) * 30 + object position z(1)
Position Camera posx#,object position y(1)+6,posz#
Point Camera object position x(1),object position y(1)+6,object position z(1)
Point Camera object position x(1),object position y(1),object position z(1)
time=timer()
sync
Loop
end
`----Code for New Game end
Else
Paste Image 1,0,0: Rem Restore Background Screen
Paste Image 2,225,332: Rem Other Button 1 Image
Endif
Else
Paste Image 5,225,332: Rem Other Button 1 Image
Endif
Rem Second Button
If Mx > 225 and My > 382 And Mx < 416 And My < 423
If Mc=1
Rem Add here, whatever code you want to be executed when you click button 2
Center Text 320,472,"You Clicked On Button 2!"
Else
Paste Image 1,0,0: Rem Restore Background Screen
Paste Image 3,225,382: Rem Other Button 2 Image
Endif
Else
Paste Image 6,225,382: Rem Other Button 1 Image
Endif
Rem Third Button
If Mx > 225 and My > 431 And Mx < 416 And My < 472
If Mc=1
Rem Add here, whatever code you want to be executed when you click button 3
End
Else
Paste Image 1,0,0: Rem Restore Background Screen
Paste Image 4,225,431: Rem Other Button 3 Image
Endif
Else
Paste Image 7,225,431: Rem Other Button 1 Image
Endif
Return
a total noob.