Hi!
Maybe this should be in newcomers chat, but doh

.
I wrote a simply code, that displays textured matrix, and a tower. Additionaly i wanted to control my camera freely, and make some cut-scenes. So, i made code for writer, which simply writes my every move to a file, and a reader, which reads it. The problem is that when i try to read the code, and then move my camera by the readen coords, it won't move.
That's the whole code:
make matrix 1,200,200,100,100
Load Image "grass.jpg",1
set matrix wireframe off 1
Load Object "stower.x",1
rotate object 1,0,65,0
make camera 1
scale object 1,700,700,700
position object 1,10,0,40
position camera 1,7.62015342712,9.15191555023,39.1794281006
point camera 1,object position X(1),object position Y(1)+0.5,object position Z(1)
prepare matrix texture 1,1,1,1
randomize matrix 1,2
For X=0 to 99
height = Rnd(30)
If height > -1 and height < 6 Then height = 6
set matrix height 1,X,0,height
next X
For X=0 to 99
height = Rnd(30)
If height > -1 and height < 6 Then height = 6
set matrix height 1,X,1,height
next X
For X=0 to 99
height = Rnd(30)
If height > -1 and height < 6 Then height = 6
set matrix height 1,X,30,height
next X
For X=0 to 99
height = Rnd(30)
If height > -1 and height < 6 Then height = 6
set matrix height 1,X,29,height
next X
For Z=0 to 99
height = Rnd(30)
If height > -1 and height < 6 Then height = 6
set matrix height 1,0,Z,height
next Z
For Z=0 to 99
height = Rnd(30)
If height > -1 and height < 6 Then height = 6
set matrix height 1,1,Z,height
next Z
For Z=0 to 99
height = Rnd(30)
If height > -1 and height < 6 Then height = 6
set matrix height 1,99,Z,height
next Z
control camera using arrowkeys 1,0.02,0.2
update matrix 1
Open to Read 1,"camera_move.txt":gosub cam_mov
Open To Write 1,"camera_move.txt"
Do
control camera using arrowkeys 1,0.002,0.04
If InKey$()="w" Then position camera 1,camera position X(1),camera position Y(1)+0.001,camera position z(1)
If InKey$()="s" Then position camera 1,camera position X(1),camera position Y(1)-0.001,camera position z(1)
If Inkey$()="e" Then text 0,0,str$(Camera Position X(1))+" "+str$(Camera Position Y(1))+" "+str$(Camera Position Z(1))
rem Saving camera utility :P
If UpKey()=1 or DownKey()=1 or LeftKey()=1 or RightKey()=1
Write Float 1,camera position X(1) `---Writing coords---
Write Float 1,camera position Y(1)
Write Float 1,camera position Z(1)
Write Float 1,camera angle X(1)
Write Float 1,camera angle Y(1)
Write Float 1,camera angle Z(1)
endif
Loop
cam_mov:
Do `---Reading coords, and trying to move the camera.---
Read Float 1,X#
position camera X#,camera position Y(1),camera position Z(1)
Read Float 1,Y#
position camera camera position Y(1),Y#,camera position Z(1)
Read Float 1,Z#
position camera camera position Y(1),camera position Y(1),Z#
Read Float 1,aX#
rotate camera aX#,camera angle Y(1),camera angle Z(1)
Read Float 1,aY#
rotate camera camera angle X(1),aY#,camera angle Z(1)
Read Float 1,aZ#
rotate camera camera angle X(1),camera angle Y(1),aZ#
sleep 10
Loop
return
I can use
goSub cam_mov to
read my coords, and move camera, and when it's not there, then it will register my movements.
Cheers!
~Kamac