ALw7sH Posted August 1, 2016 Share Posted August 1, 2016 Hi, In the race gamemode after map stop the camera fade in (screen goes black) my question is, is it script or its from mta itself? the weird thing is if you stop a running map in play gamemode for example the camera doesn't fade in but if you do it in race gamemode it does And yes I have looked into the race gamemode codes and it is not the race gamemode Link to comment
Bonus Posted August 1, 2016 Share Posted August 1, 2016 Searched for fadeCamera? It's definitely a script Link to comment
ALw7sH Posted August 1, 2016 Author Share Posted August 1, 2016 Searched in race, mapmanager and mapcycler there is fadeCamera in race but nothing related to what I'm talking about Link to comment
LabiVila Posted August 1, 2016 Share Posted August 1, 2016 Have you edited anything on race gamemode ever? Edited anything? If you haven't, then there is most likely something of your scripts that messed up the race gamemode Link to comment
ALw7sH Posted August 1, 2016 Author Share Posted August 1, 2016 Have you edited anything on race gamemode ever? Edited anything? If you haven't, then there is most likely something of your scripts that messed up the race gamemode I did edit it but it has nothing to do with what I'm saying because it is not something that shouldn't be there, the fade in is there by default Link to comment
MisterQuestions Posted August 1, 2016 Share Posted August 1, 2016 Maybe race_client > 'notifyLoadingMap' ? Link to comment
ALw7sH Posted August 1, 2016 Author Share Posted August 1, 2016 Maybe race_client > 'notifyLoadingMap' ? Its nothing in the race gamemode itself because I have tried to turn off all the fadeCamera functions and still The thing is when changing from map to another the race gamemode calls mapmanager, the mapmanager stop the map resource that was running, the screen goes black (camera fade in) right after stopping the map resource. Even if I stop the map resource manually the screen goes black too. The thing is I don't want the screen to fade in for players who are not logged in Link to comment
ALw7sH Posted August 1, 2016 Author Share Posted August 1, 2016 Is there any other function that does what fadeCamera does? spawnPlayer maybe? Link to comment
John Smith Posted August 2, 2016 Share Posted August 2, 2016 Most probably happens due to this line of code in race_server.lua: addEventHandler('onGamemodeMapStop', g_Root, function(mapres) --Clear the scoreboard for i,player in ipairs(getElementsByType"player") do setElementData ( player, "race rank", "" ) setElementData ( player, "checkpoint", "" ) end fadeCamera ( g_RootPlayers, false, 0.0, 0,0, 0 ) gotoState('NoMap') unloadAll() end ) Link to comment
ALw7sH Posted August 3, 2016 Author Share Posted August 3, 2016 Most probably happens due to this line of code in race_server.lua: addEventHandler('onGamemodeMapStop', g_Root, function(mapres) --Clear the scoreboard for i,player in ipairs(getElementsByType"player") do setElementData ( player, "race rank", "" ) setElementData ( player, "checkpoint", "" ) end fadeCamera ( g_RootPlayers, false, 0.0, 0,0, 0 ) gotoState('NoMap') unloadAll() end ) It's not, I've already edited it to what I want but still same thing happens Link to comment
Moderators IIYAMA Posted August 5, 2016 Moderators Share Posted August 5, 2016 Add another two lua files clientside and serverside, load those files as last. Add in both a wrapper function called fadeCamera and the traceback function from the site bellow. local fadeCamera2 = fadeCamera function fadeCamera (...) fadeCamera2(unpack({...})) traceback () end function traceback () local level = 1 while true do local info = debug.getinfo(level, "Sl") if not info then break end if info.what == "C" then -- is a C function? outputChatBox("C function") else -- a Lua function outputChatBox(string.format("[%s]:%d", info.short_src, info.currentline)) end level = level + 1 end end https://www.lua.org/pil/23.1.html Link to comment
ALw7sH Posted August 5, 2016 Author Share Posted August 5, 2016 I've tried it but with the race gamemode only and nothing, it seems to be mta thing that I can't edit if so then i'll have to create a new race gamemode with a new map loading system Link to comment
Moderators IIYAMA Posted August 5, 2016 Moderators Share Posted August 5, 2016 Maybe it is map-manager. I can assure you that the camera never fades to black, after the camera has been faded to visible. Unless a resource is doing it. Link to comment
ALw7sH Posted August 5, 2016 Author Share Posted August 5, 2016 Maybe it is map-manager.I can assure you that the camera never fades to black, after the camera has been faded to visible. Unless a resource is doing it. It's not the map manager too, I had a look at it, yes the race does calls the map manager to stop current map and starts the next map, when the map manager stop the current map the screen fades in immediately, but it has nothing to do with the map manager because even if you stop the current map from f8 or the admin panel the screen will fades in too Link to comment
MisterQuestions Posted August 6, 2016 Share Posted August 6, 2016 Well, maybe... caused by map stop, since on race maps are stoppped & started just as normal resources. Maybe when this resource is stopped camera auto-fades. Sometimes happened to me with freeroam too. Link to comment
ALw7sH Posted August 6, 2016 Author Share Posted August 6, 2016 It might be when there is nothing to play the screen fades in and mostly not by a script but mta itself, I have done a fix it's not the greatest but it works I've put "fadeCamera(true)" onResourcePreStart, the camera fades in for like one second only do you guys know a better fix? I've tried to put it right after stopResource in map manager but it didn't worked 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