In a game I am working on I used the following function to set up separate 'windows' for each of the two players:
function MakeWindows()
set camera view 0,0,0,(screen width()/2),screen height()
make camera 1
set camera range 1,1,5000
SET CAMERA VIEW 1, (screen width()/2)+1, 0, screen width(), screen height()
set camera to object orientation 1,player(2).obj_num
x# = object position x(player(2).obj_num)
y# = object position y(player(2).obj_num)
z# = object position z(player(2).obj_num)
position camera 1,x#, y#, z# : move camera 1,-15
set current camera 0
endfunction
This function is called once before your main loop.
During the main loop, I do something like this for each of the players:
p1x# = object position x(player(1).obj_num)
p1y# = object position y(player(1).obj_num)
p1z# = object position z(player(1).obj_num)
position object 3,p1x#,p1y#,p1z#
set object to object orientation 3,player(1).obj_num
move object 3,-15
point object 3,p1x#,p1y#,p1z#
angle# = object angle y(3)
set camera to follow 0, p1x#, p1y#, p1z#, angle#, dist#, high#, 1, 0
The floating variables, dist# and high#, are made as globals and are set earlier in the code to: dist# = 6.0 : high# = 3.5. This works with what I am working on, but you will likely need to adjust it for your game.
You wouldn't normally need the extra object in there like I have done, but this code is using Dark Physics, and is necessary. You should get the idea.
LB