Jump to content

Editor warnings


Tails

Recommended Posts

[2013-01-17 18:11:44] WARNING: [managers]\mapmanager\mapmanager_main.lua:6: Bad argument @ 'setGameType' [Expected string at argument 1, got boolean]

[2013-02-20 01:26:47] WARNING: [editor]\editor_main\server\saveloadtest_server.lua:702: Bad argument @ 'triggerClientEvent' [Expected string at argument 1, got nil]

Any idea on how to fix those warnings? Especially the 2nd one which I suspect to be the cause of my maps to go to shit and irretrievable.

It pops up everytime I start the editor.

Link to comment

I downloaded the latest copy of the resources and still got the warning.

This is not my code it's the official editor code. Might it have something to do with the editor_dump or editor_test not being there?

Line 9 in server is line 702 in the warning:

Server:

function beginTest(client,gamemodeName) 
    if ( isEditorSaving() or isEditorOpeningResource() ) then 
        triggerClientEvent ( client, "saveloadtest_return", client, "test", false, false,  
        "Cannot begin test while a save or load is in progress" ) 
        return false 
    end 
    local testMap = getResourceFromName(TEST_RESOURCE) 
    if ( not mapmanager.isMap(testMap) ) then 
        triggerClientEvent ( client, "saveloadtest_return", client, "test", false, false, 
        "Dummy 'editor_test' resource may be corrupted!" ) 
        return false 
    end 
    g_default_spawnmaponstart = get"freeroam.spawnmaponstart" 
    g_default_spawnmapondeath = get"freeroam.spawnmapondeath" 
    g_default_welcometextonstart = get"freeroam.welcometextonstart" 
    resetMapInfo() 
    setupMapSettings() 
    disablePickups(false) 
    gamemodeName = gamemodeName or lastTestGamemodeName 
    if ( gamemodeName ) then 
        lastTestGamemodeName = gamemodeName 
        set ( "*freeroam.spawnmapondeath", "false" ) 
        if getResourceState(freeroamRes) ~= "running" and not startResource ( freeroamRes, true ) then 
            restoreSettings() 
            triggerClientEvent ( root, "saveloadtest_return", client, "test", false, false,  
            "'editor_main' may lack sufficient ACL previlages to start/stop resources! (1)" ) 
            return false 
        end 
        local gamemode = getResourceFromName(gamemodeName) 
        if getResourceState ( gamemode ) == "running" and loadedEDF[gamemode] then 
            g_restoreEDF = gamemode 
            addEventHandler ( "onResourceStop", getResourceRootElement(gamemode), startGamemodeOnStop ) 
            if not stopResource ( gamemode ) then 
                restoreSettings() 
                g_restoreEDF = nil 
                removeEventHandler ( "onResourceStop", getResourceRootElement(gamemode), startGamemodeOnStop ) 
                triggerClientEvent ( root, "saveloadtest_return", client, "test", false, false,  
                "'editor_main' may lack sufficient ACL previlages to start/stop resources! (2)" ) 
                return false 
            end 
        else 
            if not mapmanager.changeGamemode(gamemode,testMap) then 
                restoreSettings() 
                triggerClientEvent ( root, "saveloadtest_return", client, "test", false, false,  
                "'editor_main' may lack sufficient ACL previlages to start/stop resources! (3)" ) 
                return false 
            end 
        end 
        g_in_test = "gamemode" 
    else 
        if getResourceState(freeroamRes) ~= "running" and not startResource ( freeroamRes, true ) then 
            restoreSettings() 
            triggerClientEvent ( root, "saveloadtest_return", client, "test", false, false,  
            "'editor_main' may lack sufficient ACL previlages to start/stop resources! (4)" ) 
            return false 
        end 
        if getResourceState(testMap) ~= "running" and not startResource ( testMap, true ) then 
            triggerClientEvent ( root, "saveloadtest_return", client, "test", false, false,  
            "'editor_main' may lack sufficient ACL previlages to start/stop resources! (5)" ) 
            return false 
        end 
        g_in_test = "map" 
    end 
    dumpSave() 
    for i,player in ipairs(getElementsByType"player") do 
        setElementDimension ( player, 0 ) 
    end 
    setElementData ( resourceRoot, "g_in_test", true ) 
    set ( "*freeroam.welcometextonstart", "false" ) 
    set ( "*freeroam.spawnmaponstart", "false" ) 
    addEvent("onPollStart") 
    addEventHandler("onPollStart", root, function() 
        stopTest() 
        cancelEvent() 
    end) 
end 

Client:

addEvent ( "saveloadtest_return",true ) 
function openResource ( resourceName ) 
    triggerServerEvent ( "openResource", getLocalPlayer(), resourceName ) 
end 
  
addEventHandler ( "saveloadtest_return", getRootElement(), 
    function ( command, returnValue, returnValue2, reason ) 
        reason = reason or "" 
        if ( command ) == "open" then 
            if ( returnValue ) then 
                for k,vehicle in ipairs(getElementsByType"vehicle") do 
                    makeVehicleStatic(vehicle) 
                end 
                loadedMap = returnValue 
                editor_gui.closeLoadDialog() 
            else 
                editor_gui.guiShowMessageBox ( "Map resource could not be started!", "error", "Error", true ) 
            end 
        elseif ( command ) == "save" then 
            if ( returnValue ) then 
                loadedMap = returnValue2 
                editor_gui.closeSaveDialog() 
            else 
                editor_gui.guiShowMessageBox ( "Map resource could not be saved! "..reason, "error", "Error", true ) 
                editor_gui.restoreSaveDialog() 
            end  
        elseif ( command ) == "quickSave" then 
            reason = reason or "The target resource may be in .zip format or corrupted." 
            editor_gui.guiShowMessageBox ( "Map resource could not be saved! "..reason, "error", "Error", true ) 
            editor_gui.restoreSaveDialog() 
        elseif ( command ) == "test" then 
            reason = reason or "" 
            editor_gui.guiShowMessageBox ( "Test could not be started! "..reason, "error", "Error", true ) 
            editor_gui.stopTest() 
        elseif ( command == "close" ) then 
            editor_gui.closeSaveDialog() 
            editor_gui.closeLoadDialog() 
        end 
    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...