Hi, it's me again.
I'm making an RPG game based in the desert. So far I'm trying to create the enviorment for the game. There's an error in the code that has to do with object numbers. I believe it has to do with the hut code.
Rem Setup sync
Sync On
Sync Rate 30
Draw to front
Backdrop on
Set camera range 1,3000
Autocam off
Hide mouse
Fog on
Fog distance 3000
Fog color RGB(128,128,128)
Color Backdrop RGB(128,128,128)
Rem make matrix
Make matrix 1,15000,15000,50,50
Rem texture matrix
Load image "media/Sand.bmp",1
Prepare matrix texture 1,1,1,1
Fill matrix 1,0,1
`random matrix
randomize matrix 1,300
rem Make Gun
Make object cylinder 1,2
Make object cylinder 100,2
XRotate Object 100,90
XRotate Object 1,90
Fix object pivot 1
Fix object pivot 100
Scale Object 100,100,100,500
Scale object 1,100,100,500
position object 100,-1,-7,15
position object 1,1,-7,15
Lock object on 1
Lock object on 100
rem create decorative objects
b=rnd(15000)
d=rnd(15000)
r=rnd(15000)
`++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rem Hut Code
load object "media/hut.x",h
scale object h,220,220,220
t=200
For x = 1 to 9
For z = 1 to 3
Make object cube t,100+x+z
hide limb t,0
Scale object t,100+x+z,100+x+z,100+x+z
y = get ground height(1,b,r)
position object t,b,d,r
glue object to limb t,t,0
make object collision box t,0,0,0,100+x+z,100+x+z,100+x+z,0
next z
next x
`++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rem Load Scorpian
Load object "media/ScorpIdle.x",231
Append Object "media/ScorpWalk.x",231,21
Yrotate object 231,180
Fix Object Pivot 231
Loop Object 231
mX# = 5000
mZ# = 5000
mY# = Get Ground Height(1,5000,5000)
X# = 5500
Y# = Get Ground Height(1,5500,5500)
Z# = 5500
`Gosub PlaceMonster
`Gosub PlacePlayer
sync
`_____________________________________________
`|MAIN LOOP! |
`---------------------------------------------
Do
oldcAY# = cAY#
oldcAX# = cAX#
oldX#=X#
oldY#=Y#
oldZ#=Z#
cAY# = WrapValue(cAY#+MousemoveX()*0.2)
cAX# = WrapValue(cAX#+MousemoveY()*0.2)
caZ# = Camera angle Z()
Rem Control input for camera
If Upkey()=1
XTest# = Newxvalue(X#,cAY#,7)
ZTest# = Newzvalue(Z#,cAY#,7)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
If Downkey()=1
XTest# = Newxvalue(X#,Wrapvalue(cAY#-180),7)
ZTest# = Newzvalue(Z#,Wrapvalue(cAY#-180),7)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
If Leftkey()=1
XTest# = Newxvalue(X#,Wrapvalue(cAY#-90),7)
ZTest# = Newzvalue(Z#,Wrapvalue(cAY#-90),7)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
If Rightkey()=1
XTest# = Newxvalue(X#,Wrapvalue(cAY#+90),7)
ZTest# = Newzvalue(Z#,Wrapvalue(cAY#+90),7)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
Rem Rotate camera
cTestX#=WrapValue(cAX#-180)
if cTestX# > 225 then cAX#=45
if cTestX# < 135 then cAX#=315
YRotate camera CurveAngle(cAY#,oldcAY#,24)
XRotate camera CurveAngle(cAX#,oldcAX#,24)
Y# = Get ground height(1,X#,Z#)+35
sync
Rem Position Camera
Position Camera X#,Y#,Z#
Rem Position Listener
Position Listener X#,Y#,Z#
Rotate Listener 0,cAY#,0
loop
If anyone can help me figure the error out, that would be great.
http://en.wikipedia.org/wiki/Main_Page