Jump to content

setCamera?


Xeno

Recommended Posts

function setCameraOnPlayerJoin() 
     -- slowly fade the camera in to make the screen visible 
     fadeCamera(source, true, 5) 
     -- set the player's camera to a fixed position, looking at a fixed point 
    
  
  
 setTimer ( fadeCamera, 5000, 1, source, true, 0.5 ) 
  
  
  
 setCameraMatrix(source, 1000.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) 
  
 setTimer ( fadeCamera, 5000, 1, source, true, 0.5 ) 
  
  
  
end 
addEventHandler("onPlayerJoin", getRootElement(), setCameraOnPlayerJoin) 
  

How would I make it switch after a while? a setTimer?

Thanks

Link to comment
  
function setCameraOnPlayerJoin() 
     -- slowly fade the camera in to make the screen visible 
     fadeCamera(source, true, 5) 
     -- set the player's camera to a fixed position, looking at a fixed point 
    
  
  
 setTimer ( (fadeCamera, source, 1), 5000, 1, 0.5 ) 
  
  
  
 setCameraMatrix(source, 1000.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) 
  
  setTimer ( (fadeCamera, source, 1), 5000, 1, 0.5 ) 
  
  
  
end 
addEventHandler("onPlayerJoin", getRootElement(), setCameraOnPlayerJoin) 
  
  

I've left two errors in, where you made a big mistake. Find them via debug in game :).

Link to comment
  
function setCameraOnPlayerJoin() 
     -- slowly fade the camera in to make the screen visible 
     fadeCamera(source, true, 5) 
     -- set the player's camera to a fixed position, looking at a fixed point 
    
  
  
 setTimer ( fadeCamera, source, 1, 5000, 1, 0.5 ) 
  
  
  
 setCameraMatrix(source, 1000.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) 
  
  setTimer ( fadeCamera, source, 1, 5000, 1, 0.5 ) 
  
  
  
end 
addEventHandler("onPlayerJoin", getRootElement(), setCameraOnPlayerJoin) 
  
  

I've left two errors in, where you made a big mistake. Find them via debug in game :).

Link to comment
  
function setCameraOnPlayerJoin() 
     -- slowly fade the camera in to make the screen visible 
     fadeCamera(source, true, 5) 
     -- set the player's camera to a fixed position, looking at a fixed point 
    
  
  
 setTimer ( fadeCamera, source, 1, 5000, 1, 0.5 ) 
  
  
  
 setCameraMatrix(source, 1000.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) 
  
  setTimer ( fadeCamera, source, 1, 5000, 1, 0.5 ) 
  
  
  
end 
addEventHandler("onPlayerJoin", getRootElement(), setCameraOnPlayerJoin) 
  
  

I've left two errors in, where you made a big mistake. Find them via debug in game :).

Sorry, I posted and THEN read your script.

I meant so it would fade out onto a new view using setCameraMatrix.

EDIT: FIXED! The problem was that your setTimers were wrong? :S

EDIT: Lol, final problem, the Camera switches positions, but it doesnt fade the camera before hand? How do I do that?

function setCameraOnPlayerJoin()  
     fadeCamera(source, true, 5) 
setTimer ( fadeCamera, 5000, 1, source, true, 0.5 )     
 setCameraMatrix(source, 1000.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) 
  setTimer ( fadeCamera, 5000, 1, source, true, 0.5 ) 
setTimer( setCameraMatrix, 1005,1, source, 1025.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316, true,0.5)  
  
end 
addEventHandler("onPlayerJoin", getRootElement(), setCameraOnPlayerJoin) 

Link to comment
  
function setCameraOnPlayerJoin() 
     -- slowly fade the camera in to make the screen visible 
     fadeCamera(source, true, 5) 
     -- set the player's camera to a fixed position, looking at a fixed point 
    
  
  
 setTimer ( fadeCamera, source, 1, 5000, 1, 0.5 ) 
  
  
  
 setCameraMatrix(source, 1000.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) 
  
  setTimer ( fadeCamera, source, 1, 5000, 1, 0.5 ) 
  
  
  
end 
addEventHandler("onPlayerJoin", getRootElement(), setCameraOnPlayerJoin) 
  
  

I've left two errors in, where you made a big mistake. Find them via debug in game :).

What did you do!? You fixed it for him ;(. I wanted to make him believe he made a mistake, so he can figure it out. If he wasn't able to, then he must learn more. :S

Link to comment
  
function setCameraOnPlayerJoin() 
     -- slowly fade the camera in to make the screen visible 
     fadeCamera(source, true, 5) 
     -- set the player's camera to a fixed position, looking at a fixed point 
    
  
  
 setTimer ( fadeCamera, source, 1, 5000, 1, 0.5 ) 
  
  
  
 setCameraMatrix(source, 1000.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) 
  
  setTimer ( fadeCamera, source, 1, 5000, 1, 0.5 ) 
  
  
  
end 
addEventHandler("onPlayerJoin", getRootElement(), setCameraOnPlayerJoin) 
  
  

I've left two errors in, where you made a big mistake. Find them via debug in game :).

What did you do!? You fixed it for him ;(. I wanted to make him believe he made a mistake, so he can figure it out. If he wasn't able to, then he must learn more. :S

1. I saw the errors before he posted.

2. This is a Help section, not a learning section.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...