Hello there! I'm running on a huge trouble: I'm trying to make an asynchronous load of all my game's content by moving all the steps into a new thread, but the problem is that the base path inside the new thread is different that the one in the main thread. This means that I cannot share required modules so far.
Example
Code: Select all
-- The main thread
thread = love.thread.newThread('app/load.lua');
thread:start();
In the load.lua
Code: Select all
-- Failing code
local module = require('app.another_module');
-- Bla bla bla
To make it run, I have (in this case for example) to type something like:
Code: Select all
local module = require('dist.app.another_module');
another_module.lua may have other includes for other modules that do work properly if executed in the main thread.
So, the question is, I can avoid this? Or I'll have to make threading more atomic? (Like making a new thread for image loading only and so on...)