Page 1 of 1

Scenario Lua: files excluded by commenting

Posted: Fri Apr 28, 2017 4:53 am
by Pirion
Control.lua has commented files, yet it is still running something in them.
We are receiving errors -
Response: (server1)Error in event on_player_created: "/var/www/factorio/server1/temp/currently-playing/bps.lua:12: attempt to index field 'automated-construction' (a nil value)".
Response: (server1)Error in event on_tick: "/var/www/factorio/server1/temp/currently-playing/rocket.lua:403: attempt to index local 'force_mem' (a nil value)".

However looking at the source, the requires these lines are commented & the error is from not having the variables initialized. We are running headless linux; 15.03. This was not an issue in 15.02.

Code: Select all

require "util"
require "locale/utils/event"
require "config"
require "locale/utils/admin"
--require "locale/utils/undecorator"
require "locale/utils/utils"
--require "locale/utils/gravestone"
require "locale/utils/bot"
require "autodeconstruct"
require "announcements"
--require "rocket"
--require "bps"
require "tag"
require "autofill"
--require "showhealth"
--require "locale/mapsettings/spiral"
--require "rso"

Re: Scenario Lua: files excluded by commenting

Posted: Fri Apr 28, 2017 8:28 am
by Klonan
Thanks for the report,

Nothing has changed with our Lua implementation since 0.14 that would cause any changes such as this,
Are you sure it isn't a scripting error or oversight?

Can you provide a easy file that can reproduce the issue?

Re: Scenario Lua: files excluded by commenting

Posted: Fri Apr 28, 2017 12:39 pm
by Pirion
While I can't rule out a scripting oversight, We have all errors the server encounters posting to a log. This server has been running for three days and only started displaying these errors once I switched into 0.15.03. I will do some testing to determine if I can reproduce on a simpler file.

Thanks!

Re: Scenario Lua: files excluded by commenting

Posted: Fri Apr 28, 2017 1:59 pm
by posila
In 0.15.3 migration reloaded scenario scripts to fix scripts being removed by tutorial. It is possible you server has old version of the scenario and which got reloaded into the previous save.

Re: Scenario Lua: files excluded by commenting

Posted: Fri Apr 28, 2017 2:00 pm
by I_IBlackI_I
Yeah we have noticed some strange stuff when using a save-file from 0.15.2 to 0.15.3, all scenario code doesn't work on the save-file, but when creating a new save-file it works fine.

Re: Scenario Lua: files excluded by commenting

Posted: Fri Apr 28, 2017 2:02 pm
by posila
You can just unzip the save replace scenario scripts and zip it back to fix the save.

Re: Scenario Lua: files excluded by commenting

Posted: Fri Apr 28, 2017 4:33 pm
by Pirion
I realized I never posted the save. I've attached it - however I've been unable to duplicate at all. I suspect it is due to the events being registered in commented files, possibly in the migration.
We've updated our source to fully remove these files, so I don't expect we'll see it again. If anyone wants to do some testing - feel free. ; ;)