Throughout the code for loading there are different waits to ensure that other components are already on the table before starting (e.g. the box for locked characters has to be there before pulling a character of that box). Some of those waits are currently with time, which is quite fragile if a lot of stuff happens at the same time or your PC is slow.
It would be better to ensure a specific ordering of events through wait events with conditions. What I'm imagening is a seperate tasks moduke, which would encapsulate that:
task = {}
tasks.UNLOCK_CHARACTERS = "UNLOCK_CHARACTERS"
tasks.PLACE_CHARACTER = "PLACE_CHARACTER"
-- ...
function tasks.waitFor(taskName) end
function tasks.isFinished(taskName) end
function tasks.finish(taskName) end
Also I diagram of which tasks have to wait for which other tasks would be cool.
Throughout the code for loading there are different waits to ensure that other components are already on the table before starting (e.g. the box for locked characters has to be there before pulling a character of that box). Some of those waits are currently with time, which is quite fragile if a lot of stuff happens at the same time or your PC is slow. It would be better to ensure a specific ordering of events through wait events with conditions. What I'm imagening is a seperate
tasks
moduke, which would encapsulate that:Also I diagram of which tasks have to wait for which other tasks would be cool.