Expose a way to wait until blueprints have finished loading #985
Labels
Status: Done
This issue has been completed or answered. This pull request has been merged.
Type: Bug
Milestone
Description
Is your feature request related to a problem?
In a
GameModeAddon
, I'd like to pragmatically create an Island "on startup" and set it as spawn point.My initial approach:
But this causes an error since blueprints have not been loaded at this stage.
It was suggested on Discord to try using
BentoBoxReadyEvent
and the new 1.8'sallLoaded
method, but unfortunately, these also appear to happen before blueprints are loaded as per logs below:Describe the solution you'd like us to implement.
Maybe BentoBox could have some sort of pipeline, a queue, where tasks are pushed to and a final event or addon method is invoked when the queue has been cleared.
This would allow sync/async operations to be pushed to this "global" queue of operations, and addon developers would have a way of waiting for these to be finished.
Perhaps addon developers should be able to add tasks to this queue too.
i.e my addon requires the outcome of an async operation to start functioning properly.
If I just run an async task, other addons that could potentially use my addon's API will get an error if they use it before the task has finished.
My addon could emit an event when it's ready, or it could add it's tasks to this "global queue" and consumers would use the standard BentoBox way of "waiting for all to be ready"
Describe alternatives you've considered.
Additional context
I'm using the code below for logging the events:
Thank you guys.
The text was updated successfully, but these errors were encountered: