After I had added a few subroutines and other code, when I try to compile it started saying can not close nest at line....
and it dosen't matter if I delete the functions it just starts saying the same about the sub routines, little help, I have no ideas on this one, THANKS GENTS
Rem Project: sea 2
Rem Created: 9/9/2006 5:43:38 PM
Rem ***** Main Source File *****
Set Display Mode 1024,768,32
LOAD IMAGE "Images/spec.bmp", 1
REM SKY OBJECT
Load Object "sky/sky.x", 10
objectScale(10, 10)
Set Object Light 10, 0
Set Object Fog 10, 0
Set Object Texture 10, 2, 0
Position Object 10, 0, 0, 0
REM WATER
Load Image "water/waves.bmp", 1
Load Image "water/waves.dds", 2
Load Image "water/refract.bmp", 3
Load Object "plain.x", 100, 2
objectScale(100, 10)
xRotate Object 100, 90
Position Object 100, 0, 0, 0
Set Object Diffuse 100, Rgb(128,128,128)
Set Object Emissive 100, Rgb(128,128,128)
Set Object Specular 100, Rgb(128,128,128)
Set Object Ambience 100, Rgb(128,128,128)
Set Blend Mapping On 100, 1, 2, 3, 24
Set Blend Mapping On 100, 2, 1, 3, 4
Set Blend Mapping On 100, 3, 3, 3, 26
Set Blend Mapping On 100, 4, 2, 11, 24
Set Blend Mapping On 100, 5, 1, 11, 7
Scale Object Texture 100, 0, 5, 5
Scale Object Texture 100, 1, 50, 50
Ghost Object On 100, 4
LOAD OBJECT "Media/hull.X",1
POSITION OBJECT 1,500,3,500
LOAD OBJECT "Media/dgun_base.X",2
make mesh from object 1, 2
add limb 1, 1, 1
offset limb 1, 1, 0, .47, 16.959662
link limb 1, 0, 1
LOAD OBJECT "Media/dgun.X",3
make mesh from object 2, 3
add limb 1, 2, 2
offset limb 1,2,0,.74031, 0
link limb 1, 1, 2
LOAD OBJECT "Media/prop.x",4
make mesh from object 3,4
add limb 1,3,3
offset limb 1,3, 2.19856,-10.307131,-83.868813
link limb 1,0,3
add limb 1,4,3
offset limb 1,4,-2.47,-10.307131,-83.868813
link limb 1,0,4
LOAD OBJECT "Media/rudder.x",5
make mesh from object 4,5
add limb 1,5,4
offset limb 1,5,-2,-9.5,-88.99
link limb 1,0,5
add limb 1,6,4
offset limb 1,6,2,-9.5,-88.99
link limb 1,0,6
LOAD OBJECT "Media/port_dplane.x",6
make mesh from object 5,6
add limb 1,7,5
offset limb 1,7, -6.4476135,-10.094486,69.78912
link limb 1,0,7
LOAD OBJECT "Media/star_dplane.x",7
make mesh from object 6,7
add limb 1,8,6
offset limb 1,8, 6.8476135,-10.094486,69.78912
link limb 1,0,8
LOAD OBJECT "Media/20mm_base.x",8
make mesh from object 7,8
add limb 1,9,7
offset limb 1,9,0,8,-9.128900
link limb 1,0,9
LOAD OBJECT "Media/20mm_gun.x",9
make mesh from object 8,9
add limb 1,10,8
offset limb 1,10,0,9.307491,-9.128906
link limb 1,0,10
DELETE OBJECT 2
DELETE OBJECT 3
DELETE OBJECT 4
DELETE OBJECT 5
DELETE OBJECT 6
DELETE OBJECT 7
DELETE OBJECT 8
DELETE OBJECT 9
MAKE PARTICLES 1, 1, 1000,1.5
MAKE PARTICLES 2,1, 1000, 1.5
SET PARTICLE LIFE 1, 100
SET PARTICLE LIFE 2, 100
SET PARTICLE SPEED 1, .02
SET PARTICLE SPEED 2, .02
SET PARTICLE GRAVITY 1, 3
SET PARTICLE GRAVITY 2, 3
MAKE CAMERA 1000
SET CAMERA RANGE 1000, .1, 10000
SET CAMERA FOV 1000, 55
forw=0
surface=1
spd#=0
leftrudder=0
rightrudder=0
t=timer()
DO
hpx#=OBJECT POSITION X(1)
hpy#=OBJECT POSITION Y(1)
hpz#=OBJECT POSITION Z(1)
hullangy#=object angle y (1)
rudder1#=limb angle y (1,5)
rudder2#=limb angle y (1,6)
rudder3#=limb angle y (1,5)
rudder4#=limb angle y (1,6)
if rudder3#<0 then rightrudder=1 else rightrudder=0
if rudder1#>0 then leftrudder=1 else leftrudder=0
if surface>0 then GOSUB _wavemove
rem POSITION PARTICLE EMISSIONS 1, OBJECT POSITION X(1)+3, OBJECT POSITION y(1)-8, OBJECT POSITION z(1)-89
rem POSITION PARTICLE EMISSIONS 2, OBJECT POSITION X(1)-3, OBJECT POSITION y(1)-8, OBJECT POSITION x(1)-89
rem if mouseclick()=2
`camangx#=wrapvalue(camangx#+mousemovey()/5.0)
`camangy#=wrapvalue(camangy#+mousemovex()/5.0)
`rotate camera camangx#,camangy#,camera angle z(0)
rem remturn camera left 1000,mousemovex()*-1
rem pitch camera up 1000,mousemovey()*-1
rem else
rem a=mousemovex()
rem a=mousemovey()
rem endif
if LEFTKEY()>0 then gosub _leftrudder
if RIGHTKEY()>0 then gosub _rightrudder
if INKEY$()="0" then forw=0
if INKEY$()="1" then forw=1
if INKEY$()="2" then forw=2
if INKEY$()="3" then forw=3
if INKEY$()="4" then forw=4
if INKEY$()="5" then forw=5
if forw=0 then GOSUB _allstop
if forw=1 then GOSUB _ahead14
if forw=2 then GOSUB _ahead12
if forw=3 then GOSUB _ahead34
if forw=4 then GOSUB _aheadfull
if forw=5 then GOSUB _aheadflank
if leftrudder>0 then gosub _leftturn
if rightrudder>0 then gosub _rightturn
POSITION CAMERA 1000,hpx#-150,hpy#+50,hpz#-150
POINT CAMERA 1000, hpx#, hpy#, hpz#
rem POSITION OBJECT 100,CAMERA POSITION X(1000),CAMERA POSITION Y(1000),CAMERA POSITION Z(1000)
POSITION OBJECT 10,CAMERA POSITION X(1000),CAMERA POSITION Y(1000),CAMERA POSITION Z(1000)
REM MAKE CLOCKWISE ANGULAR WAKES(optionally just make them stra?ght for a better look)
ang# = WrapValue(ang# + 0.1)
Scroll Object Texture 100, 0, -Sin(ang#)*0.0001, Cos(ang#)*0.0001
Scroll Object Texture 100, 1, 0.0001, 0.0
SYNC
LOOP
_wavemove:
hullwmy#=OBJECT POSITION Y(1)
if hullwmy#<5 and hullwmy#>1
MOVE OBJECT UP 1, .04
PITCH OBJECT UP 1,.04
if hullwmy#>1 and hullwmy#<5 then
MOVE OBJECT DOWN 1,.035
PITCH OBJECT DOWN 1,.04
return
_leftturn:
if spd#>0 then hullangy#=hullangy#-.01
if spd#>2 then hullangy#=hullangy#-.03
YROTATE OBJECT 1, hullangy#
RETURN
_rightturn:
if spd#>0 then hullangy#=hullangy#+.01
if spd#>2 then hullangy#=hullangy#+.03
YROTATE OBJECT 1, hullangy#
RETURN
_leftrudder:
if rudder1#<15 then rudder1#=rudder1#+3
if rudder2#<15 then rudder2#=rudder2#+3
ROTATE LIMB 1,5,0,rudder1#,0
ROTATE LIMB 1,6,0,rudder2#,0
RETURN
_rightrudder:
if rudder3#>-15 then rudder3#=rudder3#-3
if rudder4#>-15 then rudder4#=rudder4#-3
ROTATE LIMB 1,5,0,rudder3#,0
ROTATE LIMB 1,6,0,rudder4#,0
RETURN
_allstop:
if spd#>0 then spd#=spd#-.0001
move object 1, spd#
RETURN
_ahead14:
set cursor 50,50
print "ahead 1/4"
if spd#<.4 then spd#=spd#+.0001
if spd#>.4 then spd#=spd#-.0002
MOVE OBJECT 1, spd#
prop1=LIMB ANGLE Z(1, 3)
prop2=LIMB ANGLE Z(1, 4)
prop1=prop1+50
prop2=prop2-50
ROTATE LIMB 1, 3, 0, 0, prop1
ROTATE LIMB 1, 4, 0, 0, prop2
SHOW PARTICLES 1
SHOW PARTICLES 2
POSITION PARTICLES 1,OBJECT POSITION X(1)+2,OBJECT POSITION y(1)-10,OBJECT POSITION z(1)-84
POSITION PARTICLES 2,OBJECT POSITION X(1)-2,OBJECT POSITION y(1)-10,OBJECT POSITION z(1)-84
RETURN
_ahead12:
set cursor 50,50
print "ahead 1/2"
if spd#<.425 then spd#=spd#+.0001
if spd#>.425 then spd#=spd#-.0002
MOVE OBJECT 1, spd#
prop1=LIMB ANGLE Z(1, 3)
prop2=LIMB ANGLE Z(1, 4)
prop1=prop1+60
prop2=prop2-60
ROTATE LIMB 1, 3, 0, 0, prop1
ROTATE LIMB 1, 4, 0, 0, prop2
SHOW PARTICLES 1
SHOW PARTICLES 2
POSITION PARTICLES 1,OBJECT POSITION X(1)+2,OBJECT POSITION y(1)-10,OBJECT POSITION z(1)-84
POSITION PARTICLES 2,OBJECT POSITION X(1)-2,OBJECT POSITION y(1)-10,OBJECT POSITION z(1)-84
RETURN
_ahead34:
set cursor 50,50
print "ahead 1/4"
if spd#<.475 then spd#=spd#+.0001
if spd#>.475 then spd#=spd#-.0002
MOVE OBJECT 1, spd#
prop1=LIMB ANGLE Z(1, 3)
prop2=LIMB ANGLE Z(1, 4)
prop1=prop1+70
prop2=prop2-70
ROTATE LIMB 1, 3, 0, 0, prop1
ROTATE LIMB 1, 4, 0, 0, prop2
SHOW PARTICLES 1
SHOW PARTICLES 2
POSITION PARTICLES 1,OBJECT POSITION X(1)+2,OBJECT POSITION y(1)-10,OBJECT POSITION z(1)-84
POSITION PARTICLES 2,OBJECT POSITION X(1)-2,OBJECT POSITION y(1)-10,OBJECT POSITION z(1)-84
RETURN
_aheadfull:
set cursor 50,50
print "ahead full"
if spd#<.525 then spd#=spd#+.0001
if spd#>.525 then spd#=spd#-.0002
MOVE OBJECT 1, spd#
prop1=LIMB ANGLE Z(1, 3)
prop2=LIMB ANGLE Z(1, 4)
prop1=prop1+75
prop2=prop2-75
ROTATE LIMB 1, 3, 0, 0, prop1
ROTATE LIMB 1, 4, 0, 0, prop2
SHOW PARTICLES 1
SHOW PARTICLES 2
POSITION PARTICLES 1,OBJECT POSITION X(1)+2,OBJECT POSITION y(1)-10,OBJECT POSITION z(1)-84
POSITION PARTICLES 2,OBJECT POSITION X(1)-2,OBJECT POSITION y(1)-10,OBJECT POSITION z(1)-84
RETURN
_aheadflank:
set cursor 50,50
print "ahead flank"
if spd#<.550 then spd#=spd#+.0001
if spd#>.550 then spd#=spd#-.0002
MOVE OBJECT 1, spd#
prop1=LIMB ANGLE Z(1, 3)
prop2=LIMB ANGLE Z(1, 4)
prop1=prop1+80
prop2=prop2-80
ROTATE LIMB 1, 3, 0, 0, prop1
ROTATE LIMB 1, 4, 0, 0, prop2
SHOW PARTICLES 1
SHOW PARTICLES 2
POSITION PARTICLES 1,OBJECT POSITION X(1)+2,OBJECT POSITION y(1)-10,OBJECT POSITION z(1)-84
POSITION PARTICLES 2,OBJECT POSITION X(1)-2,OBJECT POSITION y(1)-10,OBJECT POSITION z(1)-84
RETURN
_hideparticles:
hide particles 1
hide particles 2
starttimer1=0
RETURN
Function objectScale(obj as Integer, Size As Float)
scale# = Size / Object Size X(obj) * 100000
Scale Object obj, scale#, scale#, scale#
EndFunction
function Distance(Object1,Object2)
dist#=sqrt((object position x(Object1)-object position x(Object2))^2+(object position y(Object1)-object position y(Object2))^2+(object position z(Object1)-object position z(Object2))^2)
endfunction dist#
function AngleY(Object1,Object2)
angy#=atanfull(object position x(Object2)-object position x(Object1),object position z(Object2)-object position z(Object1))
endfunction angy#