i got a major problem with my code that i can't seem to find. It all seems to be alright but when i try and compile it i get this error.
Quote: "#100012: Could not close nest at line 396"
i know that 396 is the last line and when i moved some code blocks around it still says the last line. i don't know if its the project or not coz i started a new one and it still gives the same error.
please help coz i'm really baffled
[Edit]
i've posted the code too. forgot to tell u
[Edit AGAIN]
damn edit heres the code the easier way
Rem Project: Tyran3D
Rem Created: 02/08/2004 19:03:54
Rem ***** Main Source File *****
Set Display Mode 1024,768,32
Sync on
sync rate 60
backdrop off
hide mouse
center text screen width()/2,screen height()/2,"Loading...Please Wait"
sync
REM Load All Required Graphics For Title
Title_1=1:Load Bitmap "DLS.bmp",Title_1
Title_2=2:Load Bitmap "title.bmp",Title_2
REM Load Required Images For Game
Training_Button=1:Load Image "Training_Button.bmp",Training_Button
Play_Button=2:Load Image "Play_Button.bmp",Play_Button
Option_Button=3:Load Image "Option_Button.bmp",Option_Button
Quit_Button=4:Load Image "Quit_Button.bmp",Quit_Button
Star_Field=5:Load image "StarBG.bmp",Star_Field
player_skin1=6:Load image "ship1.bmp",player_skin1
REM Load Sounds
Game_Tune=1:Load Music "gametune.mp3",Game_Tune
REM Load Intro Sequence
Copy Bitmap Title_1,0,0,1024,768,0,0,0,screen width(),screen height()
sync
sleep 2000
delete bitmap Title_1
_title_screen:
Copy Bitmap Title_2,0,0,1024,768,0,0,0,screen width(),screen height()
Paste Image Training_Button,800,500,1
Paste Image Play_Button,780,550,1
Paste Image Option_Button,760,600,1
Paste Image Quit_Button,740,650,1
REM Set all text settings
set text font "times new roman"
set text size 20
center text 100,700,"Beta Test Game"
show mouse
sync
Do
Button(Training_Button,800,500,1)
Button(Play_Button,780,550,1)
Button(Option_Button,760,600,1)
Button(Quit_Button,740,650,1)
sync
Loop
Function Button(image,ButtonX,ButtonY,mouse_button)
REM Do this if image 1 is clicked (Training Button)
If mouseclick() = mouse_button and image = 1
if mousex() >= ButtonX and mousex() <= ButtonX+150
if mousey() >= ButtonY and mousey() <= ButtonY+31
` We got here because the button was pressed
endif
endif
endif
REM Do this if image 2 is clicked (Play Button)
If mouseclick() = mouse_button and image = 2
if mousex() >= ButtonX and mousex() <= ButtonX+150
if mousey() >= ButtonY and mousey() <= ButtonY+31
gosub _Play_Game
endif
endif
endif
REM Do this if image 3 is clicked (Options Button)
If mouseclick() = mouse_button and image = 3
if mousex() >= ButtonX and mousex() <= ButtonX+150
if mousey() >= ButtonY and mousey() <= ButtonY+31
gosub _Option_Screen
endif
endif
endif
REM Do this if image 4 is clicked (Quit Button)
If mouseclick() = mouse_button and image = 4
if mousex() >= ButtonX and mousex() <= ButtonX+150
if mousey() >= ButtonY and mousey() <= ButtonY+31
gosub _End_Credits
endif
endif
endif
endfunction
_Option_Screen:
cls
Copy Bitmap 2,0,0,1024,768,0,0,0,screen width(),screen height()
set text size 40
set text to bolditalic
center text 320,270,"CONTROLS:"
set text size 20
set text to normal
text 220,320, "Space Bar : Fires All Guns"
text 220,350, "Control: Fires Main Gun"
text 220,380, "Left key : Move Ship Left"
text 220,410, "Right key : Move Ship Right"
Paste Image 4,140,650,1
sync
Do
If mouseclick() = 1
if mousex() >= 140 and mousex() <= 140+150
if mousey() >= 650 and mousey() <= 650+31
cls
gosub _title_screen
endif
endif
endif
sync
Loop
_Play_Game:
center text screen width()/2,screen height()/2,"Loading Level...Please Wait"
sync
REM Load Plyer Ship
Player_Ship1=1
Load Object "Ship1.x",Player_Ship1
Rotate Object Player_Ship1, 90, 180, 0
Scale Object Player_Ship1, 15, 15, 15
set ambient light 75
gosub _Make_Bullets
gosub _Make_Enemies
REM Hide Objects till Needed
Hide Object Player_Ship1
cls
hide mouse
backdrop on
autocam off
set camera range 1,10000
make object sphere 10,9000
texture object 10,Star_Field
set object cull 10,0
wave_number = 1
dim m1_waves(5)
for a = 1 to 5
m1_waves(a) = 0
next a
REM Player Ships' Setting
p_object_x# = 0
p_object_y# = -135
P_object_z# = 0
Position Object Player_Ship1,p_object_x#,p_object_y#,p_object_z#
REM Show all objects
Show Object Player_Ship1
`Play music Game_Tune
sync
Do
fps$="DBPro Fps: "+str$(screen fps())
text screen width()-20-text width(fps$),screen height()-40,fps$
REM Position Sky Sphere
position object 10, object position x(10),object position y(10),object position z(10)
xrotate object 10,object angle x(10) + 0.1
REM Control mission 1
Select wave_number
Case 1
gosub _Player_Movements
If spacekey() = 1 and bullets_fired < 50
gosub _Fire_Bullet
endif
gosub _Move_Bullets
Endcase
Case 2
If spacekey() = 1 and bullets_fired < 50
gosub _Fire_Bullet
endif
gosub _Player_Movements
Endcase
Case 3
If spacekey() = 1 and bullets_fired < 50
gosub _Fire_Bullet
endif
gosub _Player_Movements
EndCase
Endselect
If returnkey()=1
stop music 1
delete object player_ship1
delete object 10
backdrop off
show mouse
if object exist(20) then delete object 20
if object exist(21) then delete object 21
if object exist(22) then delete object 22
if object exist(23) then delete object 23
if object exist(24) then delete object 24
goto _title_screen
endif
sync
Loop
_Player_Movements:
REM control players movement
If leftkey() = 1
move object left Player_Ship1,1.5
Endif
If rightkey() = 1
move object right Player_Ship1,1.5
Endif
If upkey()=1
move object Player_Ship1,-1.5
Endif
If downkey()=1
move object Player_Ship1,1.5
Endif
return
_Make_Bullets:
bnum=50
bullets_fired=0
for a = 0 to bnum
load object "shot.x",a+500
Rotate Object a+500, 90, 180, 0
scale object a+500,5, 5, 5
hide object a+500
next a
return
_Fire_Bullet:
bullets_fired = bullets_fired + 1
position object bullets_fired + 500,object position x(Player_Ship1),object position y(Player_Ship1)+25,object position z(Player_Ship1)
return
_Move_Bullets:
for i = 1 to bullets_fired
if object visible(i+500) = 0 then show object i+500
move object i+500, -5
next i
If object position y(bullets_fired + 500)=180
bullets_fired = 1
endif
return
_Make_Enemies:
rem Set variables
w1=5
w2=6
w3=10
w4=4
rem Initalise Arrays
dim wave1(w1)
dim wave2(w2)
dim wave3(w3)
dim wave4(w4)
Rem load objects and assign object numbers to the arrays
Rem Wave1
for a = 1 to w1
load object "enemy1.x", a + 1000
wave1(a) = a + 1000
next a
Rem Wave2
for a = 1 to w2
load object "enemy1.x", a + 1010
wave2(a) = a + 1010
next a
Rem Wave3
for a = 1 to w3
load object "enemy1.x", a + 1020
wave3(a) = a + 1020
next a
Rem Wave4
for a = 1 to w4
load object "enemy1.x", a + 1030
wave4(a) = a + 1030
next a
return
REM Position waves just off screen when needed
REM position of Wave1 and formation
_position_wave1:
for a = 1 to w1
select a
case 1:endcase
case 2:endcase
case 3:endcase
case 4:endcase
case 4:endcase
endselect
return
REM position of Wave2 and formation
_position_wave2:
for a = 1 to w2
select a
case 1:endcase
case 2:endcase
case 3:endcase
case 4:endcase
case 5:endcase
case 6:endcase
endselect
return
REM position of Wave3 and formation
_position_wave3:
for a = 1 to w3
select a
case 1:endcase
case 2:endcase
case 3:endcase
case 4:endcase
case 5:endcase
case 6:endcase
case 7:endcase
case 8:endcase
case 9:endcase
case 10:endcase
endselect
return
REM position of Wave4 and formation
_position_wave4:
for a = 1 to w4
select a
case 1:endcase
case 2:endcase
case 3:endcase
case 4:endcase
endselect
return
_Move_Wave1:
return
_Move_Wave2:
return
_Move_Wave3:
return
_Move_Wave4:
return
_End_Credits:
cls
backdrop on
color backdrop rgb(0,0,0)
txt_pos = 780
play music 1
Repeat
dec txt_pos
Set text to bold
Set text size 60
center text screen width()/2,txt_pos-20,"Credits"
Set text to normal
Set text size 20
center text screen width()/2,txt_pos+45,"This game was created using Dark Basic Pro : www.darkbasic.com"
center text screen width()/2,txt_pos+85,"Game Models designed and created by Dark Lord Software"
center text screen width()/2,txt_pos+125,"Ingame music created by Dark Lord Software"
center text screen width()/2,txt_pos+165,"All graphics designed by Dark Lord Software"
center text screen width()/2,txt_pos+205,"A special thanks goes out to the Dark Basic Forum forum for the help with the game code"
center text screen width()/2,txt_pos+245,"Also a GREAT BIG thanks to these for the extra help given. They are as follows:"
center text screen width()/2,txt_pos+265,"zircher"
center text screen width()/2,txt_pos+285,"SandraD"
center text screen width()/2,txt_pos+305,"IanM (Mod)"
center text screen width()/2,txt_pos+365,"If you find any bugs in the game or have any feed back"
center text screen width()/2,txt_pos+385,"please feel free to E-Mail me at roystonmasey@hotmail.com"
sync
Until txt_pos = -405 or scancode > 0
end
(just upgraded) system specs: AMD XP 3000+, 512Mb DDR333, nvidia ge-force FX 5600 128MB, 1x8Gb & 1x40Gb HHD, 52x CD drive, DVD+RW 4x, Sound Blaster 128.... all in a Nokia 8310 case :0D