|H|TiTanium Posted August 12, 2013 Share Posted August 12, 2013 (edited) Hello, it's not a big problem and I'm sure you can do it easily, as I'm not an experienced scripter yet, I thought about asking you how do I do it. My problem is that I can do my screen black using fadeCamera but I don't know how do I back to normal. I tried setTimer but probably I made something wrong and due that it doesn't work. It's made client-side This is the function which makes my screen black: function piscar( hitElement, matchingDimension ) if ( hitElement == getLocalPlayer() and source == myMarker ) then fadeCamera ( false, 1, 0, 0, 0 ) end end addEventHandler( "onClientMarkerHit", getRootElement(), piscar ) As you see, when I reach marker, my screen is faded to black, but it doesn't back to normal, the only thing I need is a way of making screen back to normal. Edited August 12, 2013 by Guest Link to comment
Castillo Posted August 12, 2013 Share Posted August 12, 2013 You use the same function, fadeCamera. With this it'll fade it back in after 3 seconds. setTimer ( fadeCamera, 3000, 1, true ) Put that under your fadeCamera. Link to comment
|H|TiTanium Posted August 12, 2013 Author Share Posted August 12, 2013 oh, my bad I tried : setTimer ( piscar, 1000, 1, true ) I thought I should trigger it to the function Link to comment
Castillo Posted August 12, 2013 Share Posted August 12, 2013 No, with what I gave you it'll work. Link to comment
|H|TiTanium Posted August 12, 2013 Author Share Posted August 12, 2013 (edited) EDIT: Please, there is a bug, before screen gets faded the camera is already placed and looking to the wall, how do I make screen fade first and then camera gets placed and looking at the wall ? So now, I got a new problem, when the player reaches marker, his camera is faded to black and then it backs to normal, then when it's back a GUI appears and the camera is looking to the wall ( as I want ), but when the player clicks on Close button, the camera still looking at wall, I tried setCameraTarget , but the seems impossible as what I'm trying to do can only be made on server-side ( I'm scripting on client-side ), I got these lua codes, First code is working perfectly, camera is faded, GUI appears, camera is looking at wall. Second code is the problem... function showGUI( hitElement, matchingDimension ) if ( hitElement == getLocalPlayer() and source == myMarker ) then setCameraMatrix( 2151.23975, -1178.32861, 23.82031, 2139.42456, -1178.52942, 23.99219 ) -- This is where camera is at and where it's looking at showChat( false ) -- Chat is hidden as soon as camera is faded guiSetVisible ( myWindow, true ) -- Gui appears and also Cursor showCursor( true ) end end addEventHandler( "onClientMarkerHit", getRootElement(), showGUI ) The above code is when player reaches the marker, and the below is when player clicks on "Close" button. Problem is here : function quandofecha( thePlayer ) fadeCamera ( false, 1, 0, 0, 0 ) setTimer ( fadeCamera, 1000, 1, true ) setCameraTarget( thePlayer ) -- I'm sure I'm doing this wrongly, but I don't have any idea of how do I back the camera, also I think it's not possible on client-side ( I'm building on it ) and please, teach me how do I do it... showChat( true ) end addEventHandler("onClientGUIClick", myButton2, quandofecha, false) Edited August 12, 2013 by Guest Link to comment
Castillo Posted August 12, 2013 Share Posted August 12, 2013 function quandofecha( ) fadeCamera ( false, 1, 0, 0, 0 ) setTimer ( fadeCamera, 1000, 1, true ) setCameraTarget( localPlayer ) showChat( true ) end Link to comment
|H|TiTanium Posted August 12, 2013 Author Share Posted August 12, 2013 Read my edit and if you can help me, please do it Link to comment
Castillo Posted August 12, 2013 Share Posted August 12, 2013 With the script I posted it has to work. Link to comment
|H|TiTanium Posted August 12, 2013 Author Share Posted August 12, 2013 Yeah, it's working, but this is the problem now : Please, there is a bug, before screen gets faded the camera is already placed and looking to the wall, how do I make screen fade first and then camera gets placed and looking at the wall ? Link to comment
Castillo Posted August 12, 2013 Share Posted August 12, 2013 Post your current script. Link to comment
|H|TiTanium Posted August 13, 2013 Author Share Posted August 13, 2013 Not needed, it's fixed now, thanks anyway ;DDD 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