I have MilkShape 3D 1.7.7a and exported it using the DirectX 8.0 exporter. The model has animation.
When I get my game all up and running, I see the door exactly where it should be, but only one of the sides is loaded and it doesn't animate.
My collision sucks too. o.0
(W to move forward, mouse to look)
sync on : sync rate 0 : hide mouse
set display mode 1024,768,32
set text font "Impact" : set text size 28
sync : center text 512,350,"Loading.." : sync
global Building=1
load object "DoorTestCourse1.x",Building
set object collision to polygons Building
global Door=2 : global DoorAnim=0
load object "MechDoor1.x",Door
set object collision on Door
global Plr=1
global Plrx#=0.0
global Plry#=0.0
global Plrz#=-5.0
global Plrxa#=0.0
global Plrya#=0.0
global PlrFlack=timer()
Plry#=object size y(Building)/2
make camera Plr
set current camera Plr
do
ControlPlayerCamera()
ControlPlayerFlack(3,20)
PerformCollision()
UpdateScreen()
if object playing(Door)=0 then play object Door
loop
function ControlPlayerCamera()
if keystate(17)=1
Plrx#=newxvalue(Plrx#,Plrya#,0.2)
Plrz#=newzvalue(Plrz#,Plrya#,0.2)
endif
if spacekey()=1 and timer()-PlrFlack >= 750
Flack=GetFreeFlack(3)
make object cube Flack,0.1
set object to camera orientation Flack
endif
Plrxa#=wrapvalue(Plrxa#+(mousemovey()*0.2))
Plrya#=wrapvalue(Plrya#+(mousemovex()*0.2))
endfunction
function ControlPlayerFlack(St,En)
for Flack=St to En
if object exist(Flack)=1
if object collision(Flack,0)=Door
play object Door
delete object Flack
exitfunction
endif
move object Flack,0.3
endif
next Flack
endfunction
function PerformCollision()
vx#=newxvalue(Plrx#,Plrya#,0.3)
vz#=newzvalue(Plrz#,Plrya#,0.3)
collision#=intersect object(Building,Plrx#,Plry#,Plrz#,vx#,Plry#,vz#)
if collision# <> 0
Plrx#=newxvalue(Plrx#,wrapvalue(360-Plrya#),0.2)
Plrz#=newzvalue(Plrz#,wrapvalue(360-Plrya#),0.2)
endif
endfunction
function GetFreeFlack(St)
Obj=St
repeat
inc Obj
until object exist(Obj)=0
endfunction Obj
function UpdateScreen()
position camera Plr,Plrx#,Plry#,Plrz#
rotate camera Plr,Plrxa#,Plrya#,0
sync
endfunction
I suspect the MS3D X exporter is doing something funky, but I don't know how to fix it. 0no