HI Pro noob. Here's an example that shows you how to load your level, and you can decide where to start just changing values x,y,z in line eight of this piece of code. I attached the complete example in order you can try your own level. You can see in upper left, the values of x,y,z so just move where you would like you player(camera) to start, and copy and change this values for your new values ...that's all .
hide mouse:autocam off:sync on
set ambient light 50
color backdrop rgb(8,8,8)
`starting position
`============================================================================
x#=-565 :y#=96 :z#=-579 :gira#=45 :avance=2 :vol=120 :suavizado=5:jugad=1
`============================================================================
set camera range 1,25000
set ambient light 50
`******** player object **************
make object cylinder jugad,100
position object jugad,x#,y#,z#
`******** Our level.x ************
load object "iglesia.x",778
scale object 778,800,800,800
set object collision to polygons 778
do
set cursor 0,0
print "x ",x#
print "y ",y#
print "z ",z#
gosub control
sync
loop
control:
oldx#=x#
oldz#=z#
y#=object position y(1)
`camera control
gira#=wrapvalue(gira#+mousemovex()*0.7):cam#=wrapvalue(cam#+mousemovey()*0.7)
rotate camera cam#,gira#,0
`camera limits
if cam#<=290 and cam#>180 then cam#=290
if cam#>=70 and cam#<180 then cam#=70
`********* player movements *************
if upkey()=1 THEN x#=NEWXVALUE(x#,gira#,avance):z#=NEWZVALUE(z#,gira#,avance)
if downkey()=1 THEN x#=NEWXVALUE(x#,gira#,0-avance):z#=NEWZVALUE(z#,gira#,-avance)
`slide left
if leftkey()=1 THEN x#=NEWXVALUE(x#,gira#-90,avance):z#=NEWZVALUE(z#,gira#-90,avance)
`slide right
if rightkey()=1 THEN x#=NEWXVALUE(x#,gira#-90,0-avance):z#=NEWZVALUE(z#,gira#-90,0-avance)
`collision with objects from number 777 to 790 if object exist
for i= 777 to 790
if object exist (i)
`y coord for gravity
if INTERSECT OBJECT(i,x#,y#,z#,x#,y#-vol,z#)>0 then y#=y#+(vol-INTERSECT OBJECT(i,x#,y#,z#,x#,y#-vol,z#))/suavizado
`if we don't step on any object, we fall down by gravity
if INTERSECT OBJECT(i,x#,y#,z#,x#,y#-90,z#)=0 then gravedad#=3
endif
next i
rem updating camera and player position
position object jugad,x#+30,y#-gravedad#,z#
position camera x#,y#-gravedad#+40,z#
`Sliding collision
`-----------------------------------
if object collision(jugad,0)>0:gosub zzol
if object collision(jugad,0)=0:z#=oldz#
endif
endif
if object collision(jugad,0)>0:gosub xxol
if object collision(jugad,0)=0:x#=oldx#
endif
endif
if object collision(jugad,0)>0
x#=oldx#:z#=oldz#
endif
return
`------------------------------------
xxol:
POSITION OBJECT jugad,oldx#+30,y#-gravedad#,z#
return
zzol:
POSITION OBJECT jugad,x#+30,y#-gravedad#,oldz#
return
Cheers
I'm not a grumpy grandpa
