I was working on hitting the ground to fast error and when i attempted to run it it said there was a nesting error.
All my loops are capped and my ifs are ended.
What did I do wrong.
rem screen settings
sync on
hide mouse
set camera range 1,95000
rem load and capture matrix graphics
load bitmap "_skydive.bmp",1
get image 1,0,0,254,129
delete bitmap 1
rem create test character
make object sphere 1,100
rem load target object
load object "target.x",20
scale object 20,20000,1000,20000
position object 20,0,5,0
rem make the matrix
make matrix 1,10000,10000,25,25
rem make airplane(s) 4
load object "airpl004.x",5
scale object 5,7000,7000,7000
position object 5,4000,250,4000
rem prepare matrix with a texture cut into a 2x2 texture grid
prepare matrix texture 1,1,4,4
rem make sub matrixes so you can't see off to the side
make matrix 2,10000,10000,25,25
position matrix 2,-10000,0,0
prepare matrix texture 2,1,4,4
fill matrix 2,0.0,1
make matrix 3,10000,10000,25,25
position matrix 3,10000,0,0
prepare matrix texture 3,1,4,4
fill matrix 3,0.0,1
make matrix 4,10000,10000,25,25
position matrix 4,0,0,10000
prepare matrix texture 4,1,4,4
fill matrix 4,0.0,1
make matrix 5,10000,10000,25,25
position matrix 5,0,0,-10000
prepare matrix texture 5,1,4,4
fill matrix 5,0.0,1
make matrix 6,10000,10000,25,25
position matrix 6,-10000,0,-10000
prepare matrix texture 6,1,4,4
fill matrix 6,0.0,1
make matrix 7,10000,10000,25,25
position matrix 7,10000,0,-10000
prepare matrix texture 7,1,4,4
fill matrix 7,0.0,1
make matrix 8,10000,10000,25,25
position matrix 8,-10000,0,10000
prepare matrix texture 8,1,4,4
fill matrix 8,0.0,1
make matrix 9,10000,10000,25,25
position matrix 9,10000,0,10000
prepare matrix texture 9,1,4,4
fill matrix 9,0.0,1
rem fill matrix with first texture tile
fill matrix 1,0.0,1
rem make drop zone
for a = 0 to 24
set matrix tile 1,13,a,3
set matrix height 1,13,a,0
next a
for a = 0 to 24
set matrix tile 1,12,a,3
set matrix height 1,12,a,0
next a
for a = 0 to 24
set matrix tile 1,14,a,3
set matrix height 1,14,a,0
next a
set matrix tile 1,10,10,3
set matrix height 1,10,10,0
set matrix tile 1,11,10,3
set matrix height 1,11,10,0
set matrix tile 1,10,9,3
set matrix height 1,10,3,0
set matrix tile 1,11,9,3
set matrix height 1,11,9,0
for a = 6 to 14
set matrix tile 1,9,a,3
set matrix height 1,9,a,0
next a
for a = 6 to 14
set matrix tile 1,8,a,3
set matrix height 1,8,a,0
next a
for a = 6 to 14
set matrix tile 1,7,a,3
set matrix height 1,7,a,0
next a
for a = 6 to 14
set matrix tile 1,6,a,3
set matrix height 1,6,a,0
next a
update matrix 1
rem set start varibles
x#=500
z#=500
y#=0
dive = 0
rem start main loop
do
rem ////////////////////////////////////////////////////////////////////////
rem test dive fusion
rem if spacekey()=1 then dive = 1
rem ///////////////////////////////////////////////////////////////////////
rem set up plane collision
if object collision(1,5)>0 then dive = 1
rem control camera with arrow keys
if upkey()=1 then x#=newxvalue(x#,a#,15) : z#=newzvalue(z#,a#,15)
if leftkey()=1 then a#=wrapvalue(a#-10.0)
if rightkey()=1 then a#=wrapvalue(a#+10.0)
if downkey()=1 then x#=newxvalue(x#,a#,-15) : z#=newzvalue(z#,a#,-15)
if shiftkey()=1 then goto test
rem stop player from going off world
if z#<-10000 then z# = z# + 20
if z#>20000 then z# = z# - 20
if x#<-10000 then x# = x# + 20
if x#>20000 then x# = x# - 20
rem update character
if dive = 0
y#=get ground height(1,x#,z#)+50.0
endif
if dive = 1 then goto dive
position object 1,x#,y#,z#
yrotate object 1,a#
rem position camera to the back of the character
cx#=newxvalue(x#,wrapvalue(a#+180),300)
cz#=newzvalue(z#,wrapvalue(a#+180),300)
cy#=get ground height(1,cx#,cz#)+200.0
position camera cx#,cy#,cz#
rem point camera at object
point camera x#,y#,z#
rem synchronize
sync
rem end main loop
loop
rem start to skydive
dive:
rem animate plain varibles
px = 4000
py = 250
pz = 4000
sp = 4
rem rid test character till needed
hide object 1
rem animate plain
repeat
rem go onto the runway
if dct = 0
px = px + sp
endif
rem switch to next step if in right position and no sticking to the step :)
if dct = 0 & px = 5300 then dct = 1
rem turn the plane around to the side SMOOTHLY(so much for the attempt)
if dct = 1
sp = 8
rotate object 5,0,360,0
wait 100
rotate object 5,0,350,0
wait 100
rotate object 5,0,340,0
wait 100
rotate object 5,0,330,0
wait 100
rotate object 5,0,320,0
wait 100
rotate object 5,0,310,0
wait 100
rotate object 5,0,300,0
wait 100
rotate object 5,0,290,0
wait 100
rotate object 5,0,280,0
wait 100
rotate object 5,0,270,0
wait 100
dct = 2
endif
rem make it go down the lesser side of the track to make the turn around
if dct = 2
sp = 8
pz = pz + sp
endif
position object 5,px,py,pz
rem switch motion varible at the end of matrix 1
if dct = 2 & pz >=9300 then dct = 3
rem make it turn around again
if dct = 3
sp = 20
rotate object 5,0,260,0
wait 100
rotate object 5,0,250,0
wait 100
rotate object 5,0,240,0
wait 100
rotate object 5,0,230,0
wait 100
rotate object 5,0,220,0
wait 100
rotate object 5,0,210,0
wait 100
rotate object 5,0,200,0
wait 100
rotate object 5,0,190,0
wait 100
rotate object 5,0,180,0
wait 100
rotate object 5,0,170,0
wait 100
rotate object 5,0,160,0
wait 100
rotate object 5,0,150,0
wait 100
rotate object 5,0,140,0
wait 100
rotate object 5,0,130,0
wait 100
rotate object 5,0,120,0
wait 100
rotate object 5,0,110,0
wait 100
rotate object 5,0,100,0
wait 100
rotate object 5,0,090,0
wait 100
dct = 5
sp = -5
endif
rem Final stretch on the land till jump WooHoo!
if dct = 5
sp = sp - 1
pz = pz + sp
py = py + 7
endif
position object 5,px,py,pz
rem position camera above the plane
if dct <5
cx#=newxvalue(px,wrapvalue(a#+300),300)
cz#=newzvalue(pz,wrapvalue(a#+300),300)
cy#=get ground height(1,px,pz)+2000.0
position camera cx#,cy#,cz#
endif
rem position camera on the plane
if dct =5
cx#=newxvalue(px,wrapvalue(a#-300),-2000)
cz#=newzvalue(pz,wrapvalue(a#+300),300)
cy#=get ground height(1,px,pz)+2000.0
position camera cx#,cy#,cz#
endif
rem make the switch to plane height animation
if pz =<-20000
dct = 6
endif
rem point camera at the plane
point camera px,py,pz
rem synchronise camera
sync
rem end if matches below
until dct = 6
rem hide airplane
hide object 5
rem show character
show object 1
rem set anchor point
test:
rem make start varibles
x#=350
y#=210
yen = 3
z#=-300
rem load plane
load object "planeinside.x",10
rem point camera at plane door
point camera 0,y#,0
rem rotate camera to proper position
rotate camera 0,180,0
rem scale object to the appropate size
scale object 10,200,150,200
rem start sub loop
do
rem control camera with arrow keys
if upkey()=1
dive = 1
goto jump
endif
rem update character
if y# <60000
y#=y#+240
yen = yen + 4
endif
if y# >60000
y#=y#+60
yen = yen + 1
endif
position object 1,x#,y#,z#
position object 10,0,y#-30,0
yrotate object 1,a#
rem print altitude
ink rgb(255,255,255),rgb(255,255,255)
text 385,122,"" + str$(yen) + "0"
rem if altitude right print go
if yen => 1200
ink rgb(0,255,0),rgb(0,255,0)
text 250,60,"Go"
endif
rem position camera to the back of the character
cx#=270
cz#=200
cy#=y#
position camera cx#,cy#,cz#
rem synchronize
sync
rem end sub loop
loop
rem set anchor point
jump:
rem set dive varibles
x#=500
z#=500
rem y#=90000 will be equivalent to 15000 feet
fsp# = 30
fpd# = 0.1
dive = 1
rem start sub loop
do
rem control dive with arrow keys
if dive = 1
if downkey()=1 then z#=newxvalue(z#,a#,-15) : z#=newzvalue(z#,a#,-15)
if upkey()=1 then z#=newxvalue(z#,a#,15) : z#=newzvalue(z#,a#,15)
if leftkey()=1 then x#=newxvalue(x#,a#,-15) : x#=newzvalue(x#,a#,-15)
if rightkey()=1 then x#=newxvalue(x#,a#,15) : x#=newzvalue(x#,a#,15)
endif
rem control character position with arrow keys
if dive = 0
if upkey()=1 then x#=newxvalue(x#,a#,15) : z#=newzvalue(z#,a#,15)
if leftkey()=1 then a#=wrapvalue(a#-10.0)
if rightkey()=1 then a#=wrapvalue(a#+10.0)
endif
rem add parachute part for test
if spacekey()=1 & para = 0
para = 1
fpd# = 0.05
endif
if para = 1 & fsp >=20 then fsp# = fsp# - fpd#
rem add flare
if dive = 1
if inkey$() = "f" then goto flare
endif
rem stop player from going off world
if z#<-10000 then z# = z# + 50
if z#>20000 then z# = z# - 50
if x#<-10000 then x# = x# + 50
if x#>20000 then x# = x# - 50
rem stop fall if ontop of matrix & check to see if they die :)
compy# = get ground height(1,x#,z#)
if y# <= compy#
rem if corp = 0 then goto BB
rem slowly slow them down
if para = 1 & fsp# > 19 then fsp# = fsp# - 0.05
rem update characters position
if dive = 0
y#=get ground height(1,x#,z#)+50.0
endif
if dive = 1
y#=y#-fsp#
if para = 0 & fsp <= 100
fsp# = fsp# + 0.1
endif
endif
position object 1,x#,y#,z#
yrotate object 1,a#
rem position camera onside
if cy# >=2000
cx#=x#
cz#=z#
cy#=y#+200.0
position camera cx#,cy#,cz#
endif
rem position camera above charater if not falling
if cy# <=2000
cx#=newxvalue(x#,wrapvalue(a#+180),300)
cz#=newzvalue(z#,wrapvalue(a#+180),300)
cy#=get ground height(1,cx#,cz#)+200.0
position camera cx#,cy#,cz#
endif
rem point camera at object
point camera x#,y#,z#
rem make varibles show for tesing reasons
ink rgb(255,255,255),rgb(255,255,255)
set cursor 0,0
print x#
set cursor 0,20
print y#
set cursor 0,40
print z#
set cursor 0,60
print fsp#
rem synchronize
sync
rem end main loop
loop
rem flare animation
flare:
rem start flare sub loop
do
rem set a life death varibel
if fsp <=20
corp = 1
endif
rem add camera movement
cx#=newxvalue(x#,wrapvalue(a#+180),300)
cz#=newzvalue(z#,wrapvalue(a#+180),300)
cy#=y#+200.0
position camera cx#,cy#,cz#
rem point camera at flaring person
point camera x#,y#,z#
rem stop fall if ontop of matrix
compy# = get ground height(1,x#,z#) + 30
if y# <= compy#
dive = 0
goto jump
endif
rem make character go foward
x#=newxvalue(x#,a#,10) : z#=newzvalue(z#,a#,10)
rem update characters position
y#=y#-fsp#/4
position object 1,x#,y#,z#
yrotate object 1,a#
rem steer character
if leftkey()=1 then a#=wrapvalue(a#-10.0)
if rightkey()=1 then a#=wrapvalue(a#+10.0)
rem synchronize
sync
rem end flare sub loop
loop
rem end part
BB:
rem the your dead HAHAHAHA!!! animation
load animation "failed2.avi",1
play animation 1,0,0,600,600