I'm struggling a bit with one of my mods, which seems to have been broken by recent patches.
It's the 'MakeBuildModeMoreVisible' mini-mod I posted here: http://forums.faforever.com/viewtopic.php?f=41&t=13764
There is actually very little to this mod.
(It just registers a beat function which perfoms a console action on changes to the state indicated by IsInBuildMode().)
But this now crashes the game during startup ('in transit'), when activated.
(A debug message comes up, with the last lines of the log, but this doesn't seem to give much in the way of useful clues about why it is crashing, or else I don't understand enough to get any clues from this.)
I cut it down to just one line of lua, while still repeating the issue, and a minimal repeat case is attached.
This now just hooks 'lua/ui/game/gamemain.lua', and adds a single line with "import('/lua/ui/game/buildmode.lua')".
For what it's worth, the error text I get follows:
- Code: Select all
Unhandled exception:
state->m_rootState == m_state
Program : C:\ProgramData\FAForever\bin\ForgedAlliance.exe
Cmd line arguments :
Callstack:
Unknown symbol (address 0x008d462c)
Last 100 lines of log...
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): in function `import'
warning: ...a\faforever\gamedata\lua.nx2\lua\ui\game\economy.lua(16): in main chunk
warning: [C]: in function `doscript'
warning: [C]: in function `pcall'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(48): in function `import'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): in function `import'
warning: ...forever\gamedata\lua.nx2\lua\ui\game\missiontext.lua(19): in main chunk
warning: [C]: in function `doscript'
warning: [C]: in function `pcall'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(48): in function `import'
warning: ...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua(127): in function <...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua:90>
warning: ...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua(383): in function `OnSync'
warning: [string "OnSync()"](1): in main chunk
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): Error importing '/lua/ui/game/gamemain.lua'
warning: stack traceback:
warning: [C]: in function `error'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(52): in function `import'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): in function `import'
warning: ...a\faforever\gamedata\lua.nx2\lua\ui\game\economy.lua(16): in main chunk
warning: [C]: in function `doscript'
warning: [C]: in function `pcall'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(48): in function `import'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): in function `import'
warning: ...forever\gamedata\lua.nx2\lua\ui\game\missiontext.lua(19): in main chunk
warning: [C]: in function `doscript'
warning: [C]: in function `pcall'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(48): in function `import'
warning: ...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua(127): in function <...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua:90>
warning: ...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua(383): in function `OnSync'
warning: [string "OnSync()"](1): in main chunk
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): Error importing '/lua/ui/game/economy.lua'
warning: stack traceback:
warning: [C]: in function `error'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(52): in function `import'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): in function `import'
warning: ...forever\gamedata\lua.nx2\lua\ui\game\missiontext.lua(19): in main chunk
warning: [C]: in function `doscript'
warning: [C]: in function `pcall'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(48): in function `import'
warning: ...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua(127): in function <...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua:90>
warning: ...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua(383): in function `OnSync'
warning: [string "OnSync()"](1): in main chunk
warning: Error running lua command: ...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua(127): Error importing '/lua/ui/game/missiontext.lua'
stack traceback:
[C]: in function `error'
...alliance\gamedata\mohodata.scd\lua\system\import.lua(52): in function `import'
...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua(127): in function <...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua:90>
...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua(383): in function `OnSync'
[string "OnSync()"](1): in main chunk
debug: Loading module '\000/lua/ui/game/gamemain.lua\000'
info: Hooked /lua/ui/game/gamemain.lua with /mods/ui-party/hook/lua/ui/game/gamemain.lua
info: Hooked /lua/ui/game/gamemain.lua with /mods/reminder/hook/lua/ui/game/gamemain.lua
info: Hooked /lua/ui/game/gamemain.lua with /mods/notify/hook/lua/ui/game/gamemain.lua
info: Hooked /lua/ui/game/gamemain.lua with /mods/supremeeconomy/hook/lua/ui/game/gamemain.lua
info: Hooked /lua/ui/game/gamemain.lua with /mods/simpleridleengineersandfactories/hook/lua/ui/game/gamemain.lua
info: Hooked /lua/ui/game/gamemain.lua with /mods/repeatimportproblem/hook/lua/ui/game/gamemain.lua
info: Hooked /lua/ui/game/gamemain.lua with /mods/autoharvest/hook/lua/ui/game/gamemain.lua
info: Hooked /lua/ui/game/gamemain.lua with /mods/common/hook/lua/ui/game/gamemain.lua
debug: Loading module '\000/lua/ui/game/buildmode.lua\000'
info: Hooked /lua/ui/game/buildmode.lua with /mods/makebuildmodemorevisible/hook/lua/ui/game/buildmode.lua
debug: Loading module '\000/lua/ui/game/construction.lua\000'
info: Hooked /lua/ui/game/construction.lua with /mods/ui-party/hook/lua/ui/game/construction.lua
info: Hooked /lua/ui/game/construction.lua with /mods/notify/hook/lua/ui/game/construction.lua
warning: ...orever\gamedata\lua.nx2\lua\ui\game\construction.lua(83): Attempt to set attribute 'HandleEvent' on nil
warning: stack traceback:
warning: [C]: in function `error'
warning: ...alliance\gamedata\mohodata.scd\lua\system\config.lua(12): in function <...alliance\gamedata\mohodata.scd\lua\system\config.lua:11>
warning: ...orever\gamedata\lua.nx2\lua\ui\game\construction.lua(83): in main chunk
warning: [C]: in function `doscript'
warning: [C]: in function `pcall'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(48): in function `import'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): in function `import'
warning: ... alliance\gamedata\lua.scd\lua\ui\game\buildmode.lua(13): in main chunk
warning: [C]: in function `doscript'
warning: [C]: in function `pcall'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(48): in function `import'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): in function `import'
warning: ...\faforever\gamedata\lua.nx2\lua\ui\game\gamemain.lua(1212): in main chunk
warning: [C]: in function `doscript'
warning: [C]: in function `pcall'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(48): in function `import'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): Error importing '/lua/ui/game/construction.lua'
warning: stack traceback:
warning: [C]: in function `error'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(52): in function `import'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): in function `import'
warning: ... alliance\gamedata\lua.scd\lua\ui\game\buildmode.lua(13): in main chunk
warning: [C]: in function `doscript'
warning: [C]: in function `pcall'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(48): in function `import'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): in function `import'
warning: ...\faforever\gamedata\lua.nx2\lua\ui\game\gamemain.lua(1212): in main chunk
warning: [C]: in function `doscript'
warning: [C]: in function `pcall'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(48): in function `import'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): Error importing '/lua/ui/game/buildmode.lua'
warning: stack traceback:
warning: [C]: in function `error'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(52): in function `import'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): in function `import'
warning: ...\faforever\gamedata\lua.nx2\lua\ui\game\gamemain.lua(1212): in main chunk
warning: [C]: in function `doscript'
warning: [C]: in function `pcall'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(48): in function `import'
warning: Error importing /lua/ui/game/gamemain.lua:
Error importing '/lua/ui/game/gamemain.lua'
stack traceback:
[C]: in function `error'
...alliance\gamedata\mohodata.scd\lua\system\import.lua(52): in function `import'
warning: Error running '/lua/ui/game/gamemain.lua:OnBeat': attempt to index a nil value
stack traceback:
I'm kind of stuck, at this point, since I don't really know enough about lua, or the import mechanism to chase this down further.
Is it maybe a case of circular imports, or something like that?
Can someone else check if they get the same issue, either with the original mod, or with this minimal repeat case mod?
Any ideas or suggestions?