Xeno Posted November 24, 2011 Share Posted November 24, 2011 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
Charlie_Jefferson Posted November 24, 2011 Share Posted November 24, 2011 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
qaisjp Posted November 24, 2011 Share Posted November 24, 2011 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
Xeno Posted November 24, 2011 Author Share Posted November 24, 2011 Thanks both of you Link to comment
Xeno Posted November 24, 2011 Author Share Posted November 24, 2011 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? 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
Charlie_Jefferson Posted November 24, 2011 Share Posted November 24, 2011 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. Link to comment
Xeno Posted November 24, 2011 Author Share Posted November 24, 2011 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. 1. I saw the errors before he posted. 2. This is a Help section, not a learning section. Link to comment
Charlie_Jefferson Posted November 24, 2011 Share Posted November 24, 2011 1. Okay. 2. If we only help you, you'll never learn. Most people come here and ask for help, on any script they make. Link to comment
Xeno Posted November 24, 2011 Author Share Posted November 24, 2011 1. Okay.2. If we only help you, you'll never learn. Most people come here and ask for help, on any script they make. I suppose, thanks anyway, Link to comment
Charlie_Jefferson Posted November 24, 2011 Share Posted November 24, 2011 You're welcome. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now