REFERENCEOBJECTS
UCISUseExecution
One use of an interaction object on one machine: it runs the MoveHandler and the Action of the use side, in the order of the side's ActionExecutionType, and ends the use.
- Objects: Start takes the side's MoveHandler and the action at the context's ActionIndex. By their GetEffectiveInstancingPolicy, a use runs either the object set on the interaction object itself (SharedPerObject) or a copy made for this use (InstancedPerExecution: NewObject with the object component as the outer and the object as the template). Each gets the context (SetExecutionContext). The execution holds its copies until it ends and then releases them; it holds the objects set on the interaction object only weakly. - Roles: an object runs here when ShouldRunOnRole(its NetExecutionPolicy, context) is true. The user's machine, the server and the clients that show the use each run an execution. Each step (Moving, Acting) has a leader (LeadsStep), which advances the use on its own completed steps; a machine that does not lead a step completes its own copy of it (at once when its object does not run here) and waits for the leader's phase (ApplyLeaderPhase, from the character component's MulticastUsePhase, ServerUsePhase or ClientUsePhase). - On the user's machine (OwnerData set) it drives the data object through the stages of UseObject / FinishUseObject: its Blueprint events in this order (OnObjectUseStarted, OnMovementStarted, OnMovementEnded, OnObjectActionStarted, OnObjectUseFinished), its virtual hooks OnMovementToObjectFinished, OnObjectActionUseFinished and FinishUseObject, the object's ownership and IsObjectUsing, and the data object's end of use broadcast. It never calls UseObject or InterruptUsing, which are the entry points that start and interrupt it. - On every machine where it runs, it fires the object component's OnUseStartedDelegate, OnActionStartedDelegate and OnUseFinishedDelegate.
Functions
The use to run: Context names the user, the object, the side and the action, and the role of this machine. OwnerData is the user's data object of the object, only on the user's machine (null elsewhere). Call once, before Start.
Starts the use (once): takes or makes the Action and the MoveHandler, sets their context, starts the MoveHandler (Moving) and, with StartParallelWithMoveHandler, the Action (Acting). The use may end inside this call (an object that finishes at once, a listener that interrupts it).
Starts the Action (Acting), or ends the use when the use has no action that runs here. Does nothing once Acting, or after the end.
Ends the use (once): the data object's OnObjectUseFinished, the MoveHandler finished and invalidated, the object released (the data object's ReleaseExecutedUse, then OnReleasing), the object's OnUseFinishedDelegate, OnEnded, the data object's end of use broadcast. The Action is not finished here: Interrupt finishes it.
Interrupts the use: aborts the MoveHandler (a per-execution instance while it moves; a SharedPerObject one also after its movement finished), then finishes the Action as interrupted, which ends the use; without an action the use ends as interrupted at once. bRejectedByServer sets the context's bRejectedByServer first. Does nothing before Start, while the use ends, or after the end.
None before Start and after the end; Moving, then Acting; Ending only inside End.
The Action this use runs (a per-execution instance or the object set on the interaction object); null without one, and after the end.
The MoveHandler this use runs; null without one, and after the end.
Start was called.
The use has ended (End ran to its end).
Started, not ending and not ended.
Whether an object with Policy runs on the machine of Ctx: AllMachines everywhere; LocalPredicted on the user's machine and the server; ServerOnly on the server; LocalOnly on the user's machine.
Whether the machine of Ctx leads a step whose object has Policy (bHasStepObject false: the step has no object). A use of a character on the server (Ctx.bIsOwner and Ctx.bIsServer) leads every step; a step without an object, and AllMachines and LocalOnly objects, are led by the user's machine; LocalPredicted by the user's machine and the server (whichever completes it first); ServerOnly by the server. The leader advances the use on its own completed steps; the other machines follow its phases.
Whether this machine leads Step (Moving or Acting) of this use (LeadsStep with the side's object of that step).
Whether the user's machine leads Step of this use: the server checks a client's phases with it (ServerUsePhase).
The leader's phase reached this machine, which does not lead the step. Does nothing unless the use runs and LeaderPhase is beyond GetPhase(). Acting: a movement that still runs here is finished (its OnLocalStepCompleted fires as for any finish here), the movement step completes and the action starts. Ending: interrupted, as Interrupt; else an action that still runs here finishes, not interrupted (one that finished here already is not finished again), and the use ends.
The use is ending or has ended as interrupted (set when End begins).