what im trying to do is have a default model (walk.x) and when control key is pressed it loads spikejab.x then once animation has finished playing it goes back to the default. the problem is when it goes back to the default model the up and downkeys dont respond. (the angle will be wierd when u press control as i havent sorted the angles out yet)
any advice will be legendary
rem pre program set up
cls
sync on
sync rate 40
hide mouse
obj=1
rem backdrop
backdrop on
color backdrop rgb(0,0,0)
rem Load your object
load object "walk.x",1
position object 1,100,0,100
yrotate object 1,180
set object speed 1,20
fix object pivot 1
load object "falgetup.x",25
position object 25,X#,Y,Z#
hide object 25
yrotate object 25,180
fix object pivot 25
load object "spikejab.x",26
position object 26,X#,Y#,Z#
hide object 26
yrotate object 26,180
fix object pivot 26
rem some other guy
`load object "falgetup.x",2
`position object 2,250,0,250
rem walls
rem left wall
make object plain 100,500,75
yrotate object 100,90
position object 100,0,37,250
`load image "evil01.bmp",3
`texture object 100,3
rem right wall
make object plain 101,500,75
yrotate object 101,90
position object 101,500,37,250
`load image "evil01.bmp",3
`texture object 101,3
rem north wall
make object plain 102,502,75
position object 102,250,37,500
`load image "evil01.bmp",3
`texture object 102,3
rem south wall
make object plain 103,500,75
position object 103,250,37,0
`load image "evil01.bmp",3
`texture object 103,3
Rem make matrix
Make matrix 1,500,500,20,20
Load image "grass15.bmp",1
Prepare matrix texture 1,1,1,1
Fill matrix 1,0,1
rem buildings
`load object "factory.3ds",4
`position object 4,400,0,409
`load object "radar.3ds",5
`position object 5,400,50,409
`scale object 5,20,20,20
`yrotate object 5,150
`play object 5
Rem Main loop
do
aY# = Object angle Y(1)
if controlkey()=1
dec obj,1
if obj<0 then obj=0
if obj=0
position object 26,X#,Y#,Z#
hide object 1
show object 26
set object speed 26,50
play object 26
wait 1000
endif
inc obj,1
if obj>1 then obj=1
if obj=1
hide object 26
show object 1
position object 1,X#,Y#,Z#
endif
endif
if obj=1
if Upkey()=1 then move object 1,+3
if Downkey()=1 then move object 1,-3
If Leftkey()=1
Yrotate object 1,Wrapvalue(aY#-10)
Endif
If Rightkey()=1
Yrotate object 1,Wrapvalue(aY#+10)
Endif
endif
rem collision agaisnt normal objects
If Object collision(1,0)>0
Position object 1,X#,0,Z#
Endif
rem get player object position and store in X# and Z#
X# = Object position x(1)
Z# = Object position z(1)
`X26# = object position x(26)
`Z26# = object position z(26)
Rem get new camera position and store in cZ# and cX#
cZ# = Newzvalue(Z#,aY#-180,100)
cX# = Newxvalue(X#,aY#-180,100)
`cZ26# = Newzvalue(Z26#,aY26#-180,100)
`cX26# = Newxvalue(X26#,aY26#-180,100)
`if obj1=1
Position Camera cX#,75,cZ#
Point camera X#,50,Z#
`endif
`if obj26=1
`Position Camera cX26#,75,cZ26#
`Point camera X26#,50,Z26#
`endif
Rem Refresh Screen
Sync
loop
Daedalus