bah i thought it would work but apparently not,
how would i go about re-writing this.
function getonsled()
if 30 < x# < 50 and -1 < y# < 1 and 0 < z# < 50
text screen width()/2, screen height() /1.3, "Press F to Get on sled"
endif
endfunction
[EDIT]
Okay i got it to not give me an error by changing it to this
function getonsled()
if 30 < x# < 50 : if -1 < y# < 1 :if 0 < z# < 50
text screen width()/2, screen height() /2, "Press F to Get on sled"
endif
endif
endif
endfunction
but it is'nt checking all of them at the same time im guessing?
Because it isnt showing up on the screen "Press F to Get on sled".
it might be my Y-Coordinate check. Let me take that out and ill edit back
[Edit]
nope... taking the y-coordinate out makes it say "Press F to Get on sled" all the time.
If your wondering heres my whole code. ( its sloppy and it has some unused variable declarations in it.)
rem camera control
sync on
sync rate 60
maximize window
autocam off
hide mouse
rem Best display
set global collision on
rem objects
rem collision object
make object sphere 1,4
Rem make matrix
Make matrix 1,1000,1000,50,50
randomize matrix 1,5
update matrix 1
`load objects
load object "media\models\sled.x",5
position object 5,camera position x()+40,camera position y()+20,camera position z()+40
load image "media\textures\sledtexture.bmp",5
texture object 5,5
position object 1,cyx#,cyy#,cyz#+150
disable object zdepth 1
scale object 5,30,30,30
do
rotate object 1, camera angle x(),camera angle y(),camera angle z()
set object collision to boxes 1
set object collision to boxes 5
set object radius 5,5
set object radius 1,5
lock object on 1
rem input
center text 300,100,str$(x#)+","+str$(y#)+","+str$(z#)+","+str$(cya#)
// stop bobing
stage=0
rem if w
if keystate(17)=1
//resume bobing
stage=1
//change x,z values to move
x#=newxvalue(x#,cya#,1)
z#=newzvalue(z#,cya#,1)
endif
rem if s
if keystate(31)=1
stage=1
x#=newxvalue(x#,cya#,-1)
z#=newzvalue(z#,cya#,-1)
endif
rem if a
if keystate(30)=1
stage=1
x#=newxvalue(x#,wrapvalue(cya#-90.0),1)
z#=newzvalue(z#,wrapvalue(cya#-90.0),1)
endif
rem if d
if keystate(32)=1
stage=1
x#=newxvalue(x#,wrapvalue(cya#+90.0),1)
z#=newzvalue(z#,wrapvalue(cya#+90.0),1)
endif
rem Walk bounce
if stage=1
walkha#=wrapvalue(walkha#+16)
else
walkha#=curveangle(0.0,walkha#,6)
endif
walkh#=(cos(walkha#)/3)
rem Control Camera
cya#=wrapvalue(cya#+(mousemovex()/3.0))
cxa#=cxa#+(mousemovey()/3.0)
//limit camera movement
if cxa#<-60.0 then cxa#=-60.0
if cxa#>60.0 then cxa#=60.0
//get values
cx#=newxvalue(x#,cya#,sin(cxa#)*10)
cz#=newzvalue(z#,cya#,sin(cxa#)*10)
//give values to camera
position camera cx#,y#+30+walkh#+get ground height(1,x#,z#),cz#
rotate camera cxa#,cya#,0
getonsled()
//fast loop
sync
//return loop
loop
function getonsled()
if 30 < x# < 50 : if 0 < z# < 50
text screen width()/2, screen height() /2, "Press F to Get on sled"
endif
endif
endfunction
and my sled is in the attatchment.
[Edit]
Is it the random Matrix height causing it?