The "Wait For Condition" System
Summary
This is a simple system to allow people to wait for conditions, and mark when they have been met or updated.
Each condition has a "name" - if you mark a condition with that name as "met", then any listeners of that condition name will be notified (and any subsequent users who listen to a condition that has already been met will be notified immediately).
You can also optionally include a generic object with a certain condition, e.g. if you want to wait for a certain actor to be ready, you can have a "OnActor[X]Ready" condition, and listeners will be informed both of when the actor is ready, and what the actor is.
Usage
Includes the following helper functions:
WaitForCondition
: A simple "wait for condition" - provide a condition name and a "On Condition Met" event, and it will trigger the event once the condition has been marked as done (via MarkConditionMet), or will trigger immediately if the condition has already been marked as done.WaitForCondition_WithResultObject
: Same as "WaitForCondition", but will also provide a "Result Object" associated with the condition, in the "On Condition Met" event.ListenToConditionUpdates
: Same as WaitForCondition_WithResultObject, but also listens to any subsequent updates to the "Result Object". (This will call the "On Condition Met" event immediately if the "Result Object" has already been provided via an earlier MarkConditionMet_WithResultObject, and then again every subsequent time)WaitForConditions
: Same as WaitForCondition, but takes a list of condition names, and only triggers if/when they have all been met.MarkConditionMet
: Call this to mark a condition as having been "met", triggering any listeners waiting on the condition.MarkConditionMet_WithResultObject
: Same as MarkConditionMet, but provides a "Result Object". This will trigger any listeners waiting on the condition, or having its result object updated. NOTE: This can be called multiple times with the same condition name to update the current "Result Object" associated with that condition.GetMetConditions
: Returns the list of all conditions that have been met so farHasMetCondition
: Returns true if the provided condition name has been marked as "met"GetConditionResultObject
: Returns the current object for the provided condition name.
Adding custom steps to the bootflow
If you want to add custom steps to the The Bootflow Subsystem, this can now be done, using the CustomBootflowConditions
world settings. These will be injected to the end of the bootflow, immediately before "Bootflow Finished" on the server, and before "Profile Setup" (and "Fade In") on the client. You can use this to therefore inject your own steps to the bootflow, which you can guarantee will all be met in the HandleBootflowFinished
step.
Last updated
Was this helpful?