love-android + dofile in *.love
Posted: Sat Jan 16, 2016 12:00 pm
Hello there!
I know there are tons of dofile-related questions and threads, but I wasn't able to find answer to my question.
There's a *.love file which runs perfectly on Linux (Debian Jessie) with the LÖVE 0.1.10 (built from sources), but fails to execute on Android device.
The "main.lua" file starts with:
*Note the line with dofile("menu.lua").
While it's "ok" on full-fledged Linux, on Android I'm getting the error.
If I were opening just a main.lua file...
Then my guess would have been the error occurred due to a wrongly set working dir...
But I'm running a *.love file! Does LÖVE for android unpack content of a love file to some temp dir?
Hom am I supposed to use multiple files on Android?
Note:
The menu.lua file can't be loaded by "require" as is.
"menu.lua" is not really a library but rather a saved separately menu-related code.
I know there are tons of dofile-related questions and threads, but I wasn't able to find answer to my question.
There's a *.love file which runs perfectly on Linux (Debian Jessie) with the LÖVE 0.1.10 (built from sources), but fails to execute on Android device.
The "main.lua" file starts with:
Code: Select all
debug = true
local debug_file = io.open("debug.txt")
game = {}
game.animations = {}
game.previous_level = nil
game.current_level = 1
game.started = false
game.in_menu = true
game.font = love.graphics.newFont("pixel.ttf", 18)
dofile("menu.lua")
dofile("tbl_ser.lua")
game.anim8 = require 'anim8/anim8'
While it's "ok" on full-fledged Linux, on Android I'm getting the
Code: Select all
main.lua:15: module 'menu.lua' not found
If I were opening just a main.lua file...
Then my guess would have been the error occurred due to a wrongly set working dir...
But I'm running a *.love file! Does LÖVE for android unpack content of a love file to some temp dir?
Hom am I supposed to use multiple files on Android?
Note:
The menu.lua file can't be loaded by "require" as is.
"menu.lua" is not really a library but rather a saved separately menu-related code.