Jump to content

[Race] Loading - setCameraMatrix


Mefisto_PL

Recommended Posts

Hi everyone ! I want to simply change the loading screen effect, but there is a one problem. I put there a setCameraMatrix, but it doesn't work.. Only black screen and my text which I render.. In debugscript isn't any error. I add only setCameraMatrix and nothing else. Only for see how it looks, here is a code.

function notifyLoadingMap( mapName, authorName ) 
    --fadeCamera( false, 0.0, 0,0,0 ) -- fadeout, instant, black 
    setCameraMatrix ( 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316 ) 
    TravelScreen.show( mapName, authorName ) 
    showChat ( false ) 
end 

Link to comment

It's default function from Race, only added setCameraMatrix.

PS. This event starts function..

addEventHandler('onGamemodeMapStart', g_Root, 
    function(mapres) 
        outputDebugString('onGamemodeMapStart(' .. getResourceName(mapres) .. ')') 
        if getTotalPlayerCount() == 0 then 
            outputDebugString('Stopping map') 
            triggerEvent('onGamemodeMapStop', g_Root) 
            return 
        end 
        gotoState('LoadingMap') 
        -- set up all players as not ready 
        for i,player in ipairs(getElementsByType('player')) do 
            setPlayerNotReady(player) 
        end 
        -- tell clients new map is loading 
        clientCall(g_Root, 'notifyLoadingMap', getResourceInfo(mapres, "name") or getResourceName(mapres), g_GameOptions.showauthorname and getResourceInfo( mapres , "author") ) 
  
        if g_CurrentRaceMode then 
            outputDebugString('Unloading previous map') 
            unloadAll() 
        end 
        TimerManager.createTimerFor("raceresource","loadmap"):setTimer( doLoadMap, 50, 1 ,mapres ) 
    end 
) 

Link to comment

Sorry for double post, I can't remove post before.

I change fadeCamera to true and it's showed now, but only for 2 seconds and screen backs to black color.. Anybody know how to fix it?

function notifyLoadingMap( mapName, authorName ) 
    fadeCamera ( true ) 
    setCameraMatrix ( 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316 ) 
    TravelScreen.show( mapName, authorName ) 
    showChat ( false ) 
end 

///EDIT

I found that in race_client.lua, but I don't know what I must change, i tried but it always was fail :D There is a code ( not full but this part is important )

    fadeCamera( false, 0.0 ) 
  
    -- Editor start 
    if isEditor() then 
        editorInitRace() 
        return 
    end 
  
    -- Min 3 seconds on travel message 
    local delay = TravelScreen.getTicksRemaining() 
    delay = math.max(50,delay) 
    setTimer(TravelScreen.hide,delay,1) 
  
    -- Delay readyness until after title 
    TitleScreen.bringForwardFadeout(3000) 
    delay = delay + math.max( 0, TitleScreen.getTicksRemaining() - 1500 ) 
  
    -- Do fadeup and then tell server client is ready 
    setTimer(fadeCamera, delay + 750, 1, true, 10.0) 
    setTimer(fadeCamera, delay + 1500, 1, true, 2.0) 
  
    setTimer( function() triggerServerEvent('onNotifyPlayerReady', g_Me) end, delay + 3500, 1 ) 
    outputDebug( 'MISC', 'initRace end' ) 
    setTimer( function() setCameraBehindVehicle( g_Vehicle ) end, delay + 300, 1 ) 
end 

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...