basicly,it says nesting error,and ive been searching for hours to find out what it was. i cant find it. its just annoying. ill post my engine. the reason it looks familiar is im going off of the tutorials.and no flaming if you find that enough to prove me a newb(besides the fact that i pretty much am)
rem Set Up Environment
sync on
sync rate 35
autocam off
set ambient light 75
set camera range 1,16000
rem setup monster explosion
make object sphere 130,4
ghost object on 130
hide object 130
make object sphere 131,2
ghost object on 131
hide object 131
rem setup monster particles
for x =100 to 110
make object plain x+10,5,5
set object x+10,1,0,0
ghost object on x+10
hide object x+10
next x
mpn=110
rem Set Up The Camera Projection
hide mouse
rem jumping
ch=camera position y()+height
height=100
rem Load The Gun
load mesh "battlerifle.x",1
load image "txtbattlerifle.bmp",2
rem Create The Gun
make object 3,1,0
yrotate object 3,270
fix object pivot 3
scale object 3,14000,14000,14000
texture object 3,2
set object rotation zyx 3
disable object zdepth 3
rem Create The World
mapsize=10000
make matrix 1,mapsize,mapsize,20,20
load image "grass1.bmp",1
prepare matrix texture 1,1,1,1
fill matrix 1,0,1
randomize matrix 1,200
rem make slight explosion for enemy bullets when they hit the ground
for x =100 to 110
make object sphere 130,5
ghost object on 130
hide object 130
make object sphere 131,2
ghost object on 131
hide object 131
rem make slight explosin for your bullets when they hit the ground
for x =100 to 110
make object sphere 30,5
ghost object on 30
hide object 30
make object sphere 31,2
ghost object on 31
hide object 31
rem monster paritcles(muzzle flair!:))
for x =100 to 110
make object plain x+10,5,5
set object x+10,1,0,0
ghost object on x+10
hide object x+10
next x
mpn=50
rem Set Variable X & Z
x#=5000
z#=5000
rem make monster bullet
make object sphere 9,5
hide object 9
rem skysphere
sky=5001
load image "sky.dds",sky
make object sphere 55,-15000
texture object 55,sky
position object 55,mapsize/2,0,mapsize/2
rem enemy stuff
rem enemy
make object sphere 4,200
position object 4,5500,get ground height(1,5000,5000)+100,5500
rem make your bullet
make object sphere 6,0.1
make object sphere 7,0.1
make object sphere 8,0.1
hide object 7
hide object 8
hide object 6
rem spawning the two characters:sphere and camera
gosub placemonster
gosub placeplayer
rem Main Game Loop
do
rem monster controlling
if monsterbulletlife > 0 then gosub monstershootbullet
if monsterexplode > 0
gosub monsterexploderocket
else
gosub monsterai
endif
rem make shooting capabilities
if mouseclick()=1 and eplode =0
if bulletlife=0 or bulletlife<50
position object 6,x#,y#-7,z#
position object 7,x#,y#-7,z#
position object 8,x#,y#-7,z#
set object to camera orientation 6
set object to camera orientation 7
set object to camera orientation 8
bulletlife=40
show object 6
show object 7
show object 8
endif
endif
if bulletlife > 0 then gosub shootbullet
if monsterbulletlife > 0 then gosub monstershootbullet
if explode > 0 then gosub exploderocket
if monsterexplode > 0
gosub monsterexploderocket
else
gosub monsterai
endif
rem make sky spin
yrotate object 55,object angle y(55)+.1
rem Variables
oldcamangley#=cameraangley#
oldcamanglex#=cameraanglex#
cameraangley#=wrapvalue(cameraangley#+mousemovex()*0.2)
cameraanglex#=wrapvalue(cameraanglex#+mousemovey()*0.2)
stage=0
gunlag#=5.0
rem Movement Forward
if keystate(17)=1
xtest#=newxvalue(x#,cameraangley#,10)
ztest#=newzvalue(z#,cameraangley#,10)
if xtest#>0 and xtest#<10000 and ztest#>0 and ztest#<10000
x#=xtest#
z#=ztest#
gunlag#=1.1
stage=1
endif
endif
rem Movement Backward
if keystate(31)=1
xtest#=newxvalue(x#,wrapvalue(cameraangley#-180),10)
ztest#=newzvalue(z#,wrapvalue(camearangley#-180),10)
if xtest#>0 and xtest#<10000 and ztest#>0 and ztest#<10000
x#=xtest#
z#=ztest#
gunlag#=1.1
stage=1
endif
endif
rem Movement Strafe Left
if keystate(30)
xtest#=newxvalue(x#,wrapvalue(cameraangley#-90),10)
ztest#=newzvalue(z#,wrapvalue(cameraangley#-90),10)
if xtest#>0 and xtest#<10000 and ztest#>0 and ztest#<10000
x#=xtest#
z#=ztest#
gunlag#=1.1
endif
endif
rem Movement Strafe Right
if keystate(32)
xtest#=newxvalue(x#,wrapvalue(cameraangley#+90),10)
ztest#=newzvalue(z#,wrapvalue(cameraangley#+90),10)
if xtest#>0 and xtest#<10000 and ztest#>0 and ztest#<10000
x#=xtest#
z#=ztest#
gunlag#=1.1
endif
endif
rem Camera Boundaries
if cameraanglex# > 90.0 and cameraanglex# <= 180.0 then cameraanglex# = 90.0
if cameraanglex# < 270 and cameraanglex# > 180.0 then cameraanglex# = 270.0
yrotate camera curveangle(cameraangley#,oldcamangley#,24)
xrotate camera curveangle(cameraanglex#,oldcamanglex#,24)
y#= get ground height(1,x#,z#)
position camera x#,y#+100,z#
rem Gun Positioning
GunX# = newxvalue(camera position x(), wrapvalue(camera angle y()+45), 5)
GunZ# = newzvalue(camera position z(), wrapvalue(camera angle y()+45), 5)
position object 3, GunX#, Camera position y()-12, GunZ#
set object to camera orientation 3
rem initialize the scoring system
set cursor 550,20
print "enemy team score",monsterscore
set cursor 550,40
print "ally team score",playerscore
sync
loop
rem simple monster ai
MonsterAI:
Point object 4,X#,mY#,Z#
Position Object 4,mX#,mY#,mZ#
PDist=Sqrt((mX# - X#)^2 + (mY#+25 - Y#)^2 + (mZ# - Z#)^2)
if PDist<1500
if MonsterBulletLife=0 or MonsterBulletLife < 500-Pdist/10
Point object 4,X#,Y#-25,Z#
Position object 9,mX#,mY#+25,mZ#
Set object to object orientation 9,3
MonsterBulletLife =500
show object 9
Endif
endif
Return
rem shoot monster bullet
MonsterShootBullet:
Dec MonsterBulletLife
Move object 102,12
MbX#=Object position X(9)
MbY#=Object position Y(9)
MbZ#=Object position Z(9)
inc MPn
if MPn=121 then MPn=110
Scale object MPn,100,100,100
Position object MPn,MbX#,MbY#,MbZ#
point object MPn,X#,Y#,Z#
Zrotate object MPn,rnd(180)
Show object MPn
for x = 1 to 10
scale object int((Wrapvalue((MPn-9+x)*36))/36)+110,100+x*25,100+x*25,100+x*25
next x
if MbY# < Get Ground height(1,MbX#,MbZ#) then MonsterBulletLife=0
Pdist=Sqrt((X# - MbX#)^2 + (Y#+25 - MbY#)^2 + (Z# - MbZ#)^2)
if Pdist<50
GoSub PlacePlayer
MonsterBulletLife = 0
inc MonsterScore
endif
Rem guided missile
if Pdist <500+PlayerScore*100 and Pdist>250 then Point object 9,X#,Y#,Z#
if Pdist < 100 then point object 9,X#,Y#,Z#
if MonsterBulletLife = 0
Hide object 9
stop sound 9
for x=110 to 120
hide object x
next x
MonsterExplode = 20
endif
Return
rem place the monster far away from character
PlaceMonster:
mX#=X#
mZ#=Z#
mY#=Y#
While Sqrt((X# - MX#)^2 + (Y#+25 - MY#)^2 + (Z# - MZ#)^2)<1000
mX#=rnd(10000)
mZ#=rnd(10000)
mY#= get ground height(1,mX#,mZ#)
EndWhile
Position object 3,mX#,mY#,mZ#
Return
rem place character far away from monster
PlacePlayer:
X#=mX#
Z#=mZ#
Y#=mY#
While Sqrt((X# - mX#)^2 + (Y#+25 - mY#)^2 + (Z# - mZ#)^2)<1000
X#=rnd(10000)
Z#=rnd(10000)
Y#= get ground height(1,X#,Z#)
EndWhile
Position camera X#,Y#,Z#
Point camera mX#,mY#,mZ#
Return
rem explode mosnter bullet
MonsterExplodeRocket:
Position object 130,MbX#,MbY#,MbZ#
Show object 130
Position object 131,MbX#,MbY#,MbZ#
Show object 131
EScale=20*(30-MonsterExplode)
Scale object 130,EScale,EScale,EScale
Yrotate object 130,WrapValue(MonsterExplode*37)
Scale object 131,EScale/1.5,EScale/1.5,EScale/1.5
Yrotate object 131,WrapValue(359-MonsterExplode*37)
Dec MonsterExplode
If MonsterExplode = 0 then hide object 130: Hide object 131
If MonsterExplode=18
endif
Return
rem explode your bullet
ExplodeRocket:
Position object 30,bX#,bY#,bZ#
Show object 30
Position object 31,bX#,bY#,bZ#
Show object 31
EScale=20*(30-Explode)
Scale object 30,EScale,EScale,EScale
Yrotate object 30,WrapValue(Explode*37)
Scale object 31,EScale/1.5,EScale/1.5,EScale/1.5
Yrotate object 31,WrapValue(359-Explode*37)
Dec Explode
If Explode = 0 then hide object 30: Hide object 31
If Explode=18
position sound 3,bX#,bY#,bZ#
play sound 3
endif
If Explode < 15 then position sound 3,X#,Y#,Z#
Return
rem shooting bullet
ShootBullet:
Dec BulletLife
Move object 6,40
move object 7,40
move object 8,40
bX#=Object position X(2)
bY#=Object position Y(2)
bZ#=Object position Z(2)
inc Pn
if Pn=21 then Pn=10
Scale object Pn,100,100,100
Position object Pn,bX#,bY#,bZ#
point object Pn,X#,Y#,Z#
Zrotate object Pn,rnd(180)
Show object Pn
for x = 1 to 10
scale object int((Wrapvalue((Pn-9+x)*36))/36)+10,100+x*25,100+x*25,100+x*25
set cursor 10,10
next x
if bY# < Get Ground height(1,bX#,bZ#) then BulletLife=0
Position sound 2,bX#,bY#,bZ#
set cursor 10,10
if Sqrt((mX# - bX#)^2 + (mY#+25 - bY#)^2 + (mZ# - bZ#)^2) <20
Gosub PlaceMonster
inc PlayerScore
MonsterBulletLife = 1
BulletLife=0
endif
if BulletLife = 0
Hide object 6
hide object 7
hide object 8
for x=10 to 20
hide object x
next x
Explode = 20
endif
Return
HARK!