It seems like in scenario only the files in root directory and the locales directory are getting copied and this prevents the usage of lua packages.
how to reproduce?
make a file like mypackage/file.lua in scenario and try to require "mypackage.file" and it will fail because the mypackage directory is not in save file.
doing it with any lua file in root directory of scenario works so having file.lua in root directory and doing require "file" works fine.
[0.14.3] [rrrola] LUA Packages of scenario arent copied into save.
-
- Inserter
- Posts: 47
- Joined: Tue Oct 20, 2015 12:56 pm
- Contact:
Re: [0.14.3] LUA Packages of scenario arent copied into save.
Just encountered this in 14.5, too. Tried to include the stdlib in my scenario for convenience, but require wouldn't work with any lua file not in the root directory of the scenario.
-
- Burner Inserter
- Posts: 9
- Joined: Mon May 30, 2016 12:18 pm
- Contact:
Re: [0.14.3] [rrrola] LUA Packages of scenario arent copied into save.
Not a bug - you need to put the packages in the directory "lualib". You can have subdirectories in there.
(This also goes for the directories "locale", "campaign-locale" and "inner-saves").
(This also goes for the directories "locale", "campaign-locale" and "inner-saves").
Re: [0.14.3] [rrrola] LUA Packages of scenario arent copied into save.
I move this to Not a Bug then.Jan Kadlec wrote:Not a bug - you need to put the packages in the directory "lualib". You can have subdirectories in there.
(This also goes for the directories "locale", "campaign-locale" and "inner-saves").