Not sure what's caused this, been following the simple dodging tutorial to get back into dbp after ages of not touching it. Can't remeber any of it.
Got the model from turbosqid and it loads fine in a simple:
sync on
sync rate 0
load object "lamborghini.x",1
do
yrotate object 1,wrapvalue(object angle y(1)+0.1)
sync
loop
However in:
REM Project: Cars
REM Created: 12/03/2010 19:19:15
REM
REM ***** Main Source File *****
REM
Set Window Off
Set Display Mode 1024, 768, 32
Sync On
Sync Rate 60
Hide Mouse
Autocam Off
Set Global Shadows On
Set Shadow Light 0, 100, 100, 100, 1000
Set Normalization on
Rem Dims
Dim __ObjTaken(0) as boolean ` Global array
Dim __ImgTaken(0) as boolean ` Global array
Dim Cars(4)
`Dim CarTex(5)
Rem Other vars
Land = FreeObject()
Cars(1) = FreeObject()
Cars(2) = FreeObject()
Cars(3) = FreeObject()
`Player = FreeObject()
CarTex1 = FreeImg()
CarTex2 = FreeImg()
CarTex3 = FreeImg()
CarTex4 = FreeImg()
CarTex5 = FreeImg()
CarTex6 = FreeImg()
CarTexx=0
Rem Build Land
Make object box Land, 75, 5, 400
Color object Land, RGB(180,150,90)
Position Object Land, 0, 0, 0
rem make player
Load Object "Media\Models\Lamborghini.x", Cars(3), 1
`Load Image "Media\Models\Textures\LamboTexture.jpeg", CarTex1, 1
Position Object Cars(3), 0, 10, 90
Scale Object Cars(3), 500, 500, 500
Rotate Object Cars(3), 0, 180, 0
Rem make cars
Load Image "Media\Models\Textures\rio silver.bmp", CarTex2, 1
Load Image "Media\Models\Textures\rio red.bmp", CarTex3, 1
Load Image "Media\Models\Textures\rio white.bmp", CarTex4, 1
Load Image "Media\Models\Textures\rio yellow.bmp", CarTex5, 1
Load Image "Media\Models\Textures\rio blue.bmp", CarTex6, 1
Load Object "Media\Models\kia rio.DBO", Cars(1)
Rotate Object Cars(1), 0, 90, 90
CarTexx = CarTex+rnd(5)
if CarTexx=>2 and CarTexx=<7
Texture object Cars(1), CarTexx
Endif
Scale Object Cars(1), 200, 200, 200
Clone object Cars(2), Cars(1)
Position Object Cars(2), 0, 5, 0
Rem
Do
Position Mouse screen Width()/2, Screen Height()/2
Position Camera 0, 30, 145
Point Camera 0, 10, 95
If LeftKey()=1 and object position x(Cars(3))=<34.5
Move object Left Cars(3), .9
endif
If RightKey()=1 and object position x(Cars(3))=>-34.5
Move object Right Cars(3), .9
endif
Move object left Cars(1), 1.8
If Object Position Z(Cars(1))>145
CarTexx = CarTex+rnd(5)
if CarTexx=>CarTex2 and CarTexx=<CarTex6
Texture object Cars(1), CarTexx
Position Object Cars(1), Rnd(37.5), 3, -90
Endif
Endif
Move object left Cars(2), 1.6
If Object Position Z(Cars(2))>145
CarTexx = CarTex+rnd(5)
if CarTexx=>2 and CarTexx=<7
Texture object Cars(2), CarTexx
Position Object Cars(2), Rnd(37.5)*-1, 3, -90
Endif
Endif
Sync
Loop
function FreeObject()
array insert at bottom __ObjTaken()
count = array count( __ObjTaken() )
if object exist(count) = 0 and __ObjTaken(count) = 0
__ObjTaken(count) = 1
exitfunction count
endif
endfunction 0
function FreeImg()
array insert at bottom __ImgTaken()
count2 = array count( __ImgTaken() )
if image exist(count2) = 0 and __ImgTaken(count2) = 0
__ImgTaken(count2) = 1
exitfunction count2
endif
endfunction 0
It just loads as a black model, I've tried the texture object command e.t.c and got nothing so far. I've attahced the model + texture.
Edit: Fixed now, loaded in as a DBO and it worked instantly, but if anyone knows what was causing it that'd be appreciated.
Coding.....again, back to the basics xD