3Ra's Bob's and Angel's Mod Pack


3Ra Gaming's collection of Bob and Angel's mods, compiled for easy toggling and sharing.

7 years ago
0.14
57

b FARL Error message

7 years ago

I tried to reload an old autosave of the map and get the following error message repeated continuously. Jumped out of FARL train - cant remember if save was immediately before or after.
Unexpected error: 3Ra-AngelBobsPack/FARL/control.lua:151: attempt to call method 'update' (a nil value)
Error message keeps repeating, beeping and wont cease. Usually the small dialog with the FARL commands only appears when in the train but the dialog is displaying while out of the train

7 years ago

I got this, too. The only thing that helps is staying out of the FARL trains and reload an old save when the error message didn't already appear.

Yes, once you get this error message it will keep appearing, even if you're not inside a FARL train. Even restarting the server won't help once you've got a "broken" savegame.

7 years ago

I got really annoyed and changed the control.lua file to stop the error.

I also just noticed it on a multiplayer game map that I was following (someone else in that game probably used FARL). Trouble is that if you "fix" the mod then you cannot return to the multiplayer game because your version of the mods are not the same as everyone else. I guess that if you are hosting then you could make coding change, load map and then save it. Error should stop. Then restore the original zip file and rehost. Ask players not to use FARL.

It is a brute force solution. Never used this language before so probably did not do it properly. At the start of the function call I test for nil value in the parameter and if nil then calls the FARL reset functions.

(slightly before line 151 where the error occurs - I added 7 lines of code including the start/end comments)

local function on_tick(event)
local status, err = pcall(function()
-- if event.tick % 10 == 8 then
-- global.player_opened = global.player_opened or {}
-- for _, player in pairs(game.connected_players) do
-- if player.opened ~= nil and player.opened.type == "locomotive" and not global.player_opened[player.index] then
-- on_player_opened(player.opened, player)
-- global.player_opened[player.index] = player.opened
-- end
-- if global.player_opened[player.index] and player.opened == nil then
-- on_player_closed(global.player_opened[player.index], player)
-- global.player_opened[player.index] = nil
-- end
-- end
-- end

<pre>-- >>> Tony3D i added if event == nil then if farl and farl.active then farl:deactivate("Unexpected error: "..err) end end -- <<< Tony3D end of add if global.overlayStack and global.overlayStack[event.tick] then for _, overlay in pairs(global.overlayStack[event.tick]) do if overlay.valid then overlay.destroy() end end global.overlayStack[event.tick] = nil end </pre>
7 years ago

The forum manager reformatted the cut/paste.
I tried to show the code at the start of the function so that you could work out where to paste the tweak

<pre>-- >>> TJD i added if event == nil then if farl and farl.active then farl:deactivate("Unexpected error: "..err) end end -- <<< TJD end of add </pre>
7 years ago

the line feeds are important i think but the forum is reformatting
last attempt
-- >>> Tony3d i added
if event == nil then
if farl and farl.active then
farl:deactivate("Unexpected error: "..err)
end
end
-- <<< Tony3D end of add

code continues unchanged

if global.overlayStack and global.overlayStack[event.tick] then

etc etc

7 years ago

did this work for you

7 years ago

tony delete the farl folder out of the mod

New response