Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Skin .lua file can't load library when using gamedir flag #668

Open
DVN196 opened this issue May 1, 2024 · 0 comments
Open

[Bug] Skin .lua file can't load library when using gamedir flag #668

DVN196 opened this issue May 1, 2024 · 0 comments
Assignees
Labels

Comments

@DVN196
Copy link

DVN196 commented May 1, 2024

Describe the bug
When using gamedir flag and adding load path in lua files, the load path is relative to the game bin folder, not the gamedir

To Reproduce
Steps to reproduce the behavior:

  1. Use gamedir flag, add skin to skins folder
  2. Change skin
  3. There will be errors and warnings: the game cannot find lua file from skins/[skin-name]/... even if the file exist
  4. Copy the skin to bin/skins directory, the skin work normally.

Expected behavior
The load path should be relative to gamedir

Screenshots

Desktop (please complete the following information):

  • OS: Linux
  • GPU: RX6700
  • CPU: i5-12400
  • Version: [e.g. 0.4.0 or Git commit: 2019-12-18_c98c505] (found in log)

Additional context
I copy the files from skins/HeavenlyExpress-1.3.0/textures/_shared/scripts to the skin root folder to avoid the first error when loading skin.

Log file

[23:46:47][Warning] Lua error: .../skins/HeavenlyExpress-1.3.0/backgrounds/fallback/bg.lua:2: module 'commonShared' not found:
	no field package.preload['commonShared']
	no file '/usr/local/share/lua/5.3/commonShared.lua'
	no file '/usr/local/share/lua/5.3/commonShared/init.lua'
	no file '/usr/local/lib/lua/5.3/commonShared.lua'
	no file '/usr/local/lib/lua/5.3/commonShared/init.lua'
	no file './commonShared.lua'
	no file './commonShared/init.lua'
	no file 'skins/HeavenlyExpress-1.3.0/textures/_shared/scripts/commonShared.lua'
	no file 'skins/HeavenlyExpress-1.3.0/backgrounds/fallback/commonShared.lua'
@DVN196 DVN196 added the bug label May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants