Jump to content

[General] - Mod loader bug


Recommended Posts

Bug Submission:

Category: General
Platform: PC
Issue Title: Mod loader bug
Issue Description: In the mod loader there's a part that causes the game to crash if the inital modinit load fails.


Nov 20 20:18:21 -- game/client/strict.lua:26: variable 'res' is not declared

stack traceback:
[C] ?
[C] in function 'assert'
game/client/strict.lua:26 in function
game/client/mod-manager.lua:208 in function 'mountContentModPrelocalize'
game/client/mod-manager.lua:62 in function 'init'
game/client/class.lua:39 in function
main.lua:129 in main chunk


local ok, mod = pcall( dofile, initFile ) --Maybe this should be an xpcall instead of a pcall?
if ok then
if mod.initStrings then

modData.modfn = mod

ok, res = xpcall(
function()
local modapi = reinclude( "mod-api" )
modData.api = modapi( self, id, modData.folder, scriptsAlias )
modData.modfn.initStrings( modData.api )
end,
function( err )
log:write( "mod.initStrings ERROR: %s\n%s", tostring(err), debug.traceback() )
end )
else
log:write( "\tMOD-NO INITSTRINGS FUNCTION PRESENT")
end
end

 

--This part should not be here

--[[
if ok then
log:write( "\tMOD-INITSTRINGS OK")
-- Anything here to finalize mod content?
else
log:write( "\tMOD-INITSTRINGS FAILED: %s", tostring(res))
end

]]


This way the debug traceback is destroyed making it hard to find what's not working
Steps to Reproduce: Make a mod with a faulty modinit (see above)
Link to comment
https://forums.kleientertainment.com/forums/topic/59271-general-mod-loader-bug/
Share on other sites

  • Developer

Res needed to be defined earlier.. fix will go out in the next patch.

In the meantime, if you don't mind editing your basegame scripts.zip,

you can add: 

      local res = ""

before:
      local ok, mod = pcall( dofile, initFile )
 
in the mod-manager.lua

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...