If try'd everyting but the code doesn't work at all. It says at the loop command: object does not exist. Witch stupid object in the world is it. Please help me. Here's the code:
rem desert
rem Berry Bakker
rem FishSoft
rem set sync
sync rate 60
autocam off
hide mouse
sync on
rem create player collision object and hide
make object box 100,100,400,100
set object collision on 100
set object collision to boxes 100
hide object 100
rem create wall
make object sphere 2000,1000
rem create gun
make object cylinder 1,100
set object collision off 1
rem set object to always draw on top
disable object zdepth 1
rem reset gun axis
set object rotation zyx 1
set object 1,1,1,1,1,1,0,1
rem begin main loop
do
rem store original values
oldx# = newx#
oldz# = newz#
rem perform sliding collision
if collision>0
noCollision=0
rem slide perpendicular to the camera angle
newx# = newxvalue(newx#,wrapvalue(a#+90),2*distance)
newz# = newzvalue(newz#,wrapvalue(a#+90),2*distance)
position object 100,newx#,-100,newz#
rem test collision again to see if we went in the wrong direction
if object collision(100,2000)>0
rem reset position back to the original and slide in other direction
newx#=oldx#
newz#=oldz#
newx# = newxvalue(newx#,wrapvalue(a#-90),2*distance)
newz# = newzvalue(newz#,wrapvalue(a#-90),2*distance)
endif
else
rem if no collision for a while, camera follows player collision object
if noCollision>4
colx#=newx#
colz#=newz#
endif
rem smooth the camera movement
x#=curvevalue(colx#,x#,5.0)
z#=curvevalue(colz#,z#,5.0)
rem uncomment these to see how it looks without smoothing
` x#=newx#
` z#=newz#
rem "smoothly" position camera and gun
position camera x#,0,z#
position object 1,x#,0,z#
position object 2,x#,0,z#
endif
rem reset the collision flags
collision=0
inc noCollision
rem rotate camera with mouse
cya#=wrapvalue(cya#+(mousemovex()))
cxa#=cxa#+(mousemovey()/2.0)
rem limit vertical angle
if cxa#45.0 then cxa#=45.0
rem perform rotation smoothing
crx#=curveangle(cxa#,crx#,1.0)
cry#=curveangle(cya#,cry#,4.0)
rotate camera crx#,cry#,0
rem Get movement input for standard WASD movement
rem W
if KEYSTATE(17)=1
rem check for key combinations and set angle accordingly
rem A
if KEYSTATE(30)=1
a# = wrapvalue(camera angle y()-45)
else
rem D
if KEYSTATE(32)=1
a# = wrapvalue(camera angle y()+45)
else
a# = camera angle y()
endif
endif
newx# = newxvalue(newx#,a#,distance)
newz# = newzvalue(newz#,a#,distance)
else
rem S
if KEYSTATE(31)=1
rem check for key combinations and set angle accordingly
rem A
if KEYSTATE(30)=1
a# = wrapvalue(camera angle y()-135)
else
rem D
if KEYSTATE(32)=1
a# = wrapvalue(camera angle y()+135)
else
a# = wrapvalue(camera angle y()+180)
endif
endif
newx# = newxvalue(newx#,a#,distance)
newz# = newzvalue(newz#,a#,distance)
else
rem A
if KEYSTATE(30)=1
rem check for key combinations and set angle accordingly
rem W
if KEYSTATE(17)=1
a# = wrapvalue(camera angle y()-45)
else
rem S
if KEYSTATE(31)=1
a# = wrapvalue(camera angle y()-135)
else
a# = wrapvalue(camera angle y()-90)
endif
endif
newx# = newxvalue(newx#,a#,distance)
newz# = newzvalue(newz#,a#,distance)
else
rem D
if KEYSTATE(32)=1
rem check for key combinations and set angle accordingly
rem W
if KEYSTATE(17)=1
a# = wrapvalue(camera angle y()+45)
else
rem S
if KEYSTATE(31)=1
a# = wrapvalue(camera angle y()+135)
else
a# = wrapvalue(camera angle y()+90)
endif
endif
newx# = newxvalue(newx#,a#,distance)
newz# = newzvalue(newz#,a#,distance)
endif
endif
endif
endif
rem perform movement on player collision object
position object 100,newx#,-100,newz#
rem move gun and hand with camera
set object to camera orientation 1
rem test for initial collision
if object collision(100,2000)
collision=2000
rem reset position variables back
newx# = oldx#
newz# = oldz#
rem position player collision object back to original position
position object 100,newx#,-100,newz#
rem store current cam and gun position
colx#=newx#
colz#=newz#
endif
sync
rem end main loop
loop
Nee ik ben niet Frans,
ik ben stapelgek op Nederlands.
Van Duits word ik gek, dat is alles wat ik zeg.