Arma Reforger Script API
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
ExtBaseInteractionHandlerComponent Interface Reference

Collects interactions by performing a sphere cast initially and then a sphere query at the end. More...

Inheritance diagram for ExtBaseInteractionHandlerComponent:
[legend]

Public Member Functions

proto external UserActionContext GetCurrentContext ()
 Returns currently gathered (active-preferred) context or null if none.
 
proto external IEntity GetControlledEntity ()
 Returns the controlled entity or null if none.
 
proto external int GetFilteredActions (out notnull array< BaseUserAction > outActions, out notnull array< bool > outCanBePerformed)
 After collection is done, this method can be used for retrieving already checked user actions from current context.
 
proto external bool IsContextAvailable ()
 Returns true when there is a gathered context available.
 
proto external void SetManualCollectionOverride (bool enabled)
 If set to true, we expect a list of entities to be provided from the user instead.
 
proto external bool GetManualCollectionOverride ()
 Returns whether manual collection override is set (we expect a list of entities to be provided from the user instead)
 
proto external void SetNearbyCollectionEnabled (bool enabled)
 Sets whether nearby available context collection should be enabled.
 
proto external bool GetNearbyCollectionEnabled ()
 Returns whether nearby available context collection is enabled.
 
proto external float GetNearbyCollectionRadius ()
 Returns the radius in meters that is used for nearby available context collection.
 
proto external int GetNearbyAvailableContextList (out notnull array< UserActionContext > outContexts)
 If nearby collection is enabled, fills the provided array with collected contexts nearby.
 
proto external int GetNearbyShowableContextList (out notnull array< UserActionContext > outContexts)
 If nearby collection is enabled, fills the provided array with collected contexts nearby.
 
proto external int GetNearbyUnavailableContextList (out notnull array< UserActionContext > outContexts)
 If nearby collection is enabled, fills the provided array with collected contexts nearby.
 
proto external vector GetLastReferencePoint (float timeSlice)
 The last known interaction reference point.
 
- Public Member Functions inherited from BaseInteractionHandlerComponent
proto external bool IsInteractionAvailable ()
 Returns true if any interaction can be done at given moment, i.e. UI should be shown.
 
proto external BaseUserAction GetSelectedAction ()
 Return currently selected user action or null if none.
 
proto external float GetVisibilityRange ()
 Returns the global actions visibility range value defined by attribute in this component.
 
void OnInit (IEntity owner)
 Called on initialization.
 
void OnFrame (IEntity owner, float timeSlice)
 Called every frame, only for local player controller.
 
void OnAfterPostSimulate (IEntity owner, float timeSlice)
 Called after post simulate, only for local player controller.
 
- Public Member Functions inherited from GameComponent
bool OnTicksOnRemoteProxy ()
 

Protected Member Functions

proto external void SetSelectedAction (BaseUserAction action)
 Sets currently select action.
 
void OnControlledEntityChanged (IEntity from, IEntity to)
 
void OnContextChanged (UserActionContext previousContext, UserActionContext newContext)
 Event called when InteractionHandlerComponent finds new target UserActionContext and a change occurs.
 
void OnPostFrame (IEntity owner, IEntity controlledEntity, float timeSlice)
 Called once per frame after simulation.
 
bool CanContextChange (UserActionContext currentContext, UserActionContext newContext)
 Called before a context is set to determine whether a change can occur.
 
bool DoIntersectCheck (IEntity controlledEntity)
 Should preferred context collection use intersect checks? This will make a ray check against the context's radius.
 
bool GetIsInteractionAvailableScript ()
 Are any user actions available to interact with? Implement and return true if yes, false otherwise.
 
bool GetCanInteractScript (IEntity controlledEntity)
 Are we allowed to start collecting and processing interactions? Implement custom logic and return true if yes, false otherwise.
 
BaseUserAction GetSelectedActionScript ()
 Currently sected action or null if none.
 
array< IEntity > GetManualOverrideList (IEntity owner, out vector referencePoint)
 Callback whem manual collection override is enabled.
 

Detailed Description

Collects interactions by performing a sphere cast initially and then a sphere query at the end.

Iterates through hit entities and tries to find closest entity with ActionsManagerComponent that has a valid context.

Member Function Documentation

◆ CanContextChange()

bool ExtBaseInteractionHandlerComponent.CanContextChange ( UserActionContext  currentContext,
UserActionContext  newContext 
)
protected

Called before a context is set to determine whether a change can occur.

Implemented in SCR_InteractionHandlerComponent, and InteractionHandlerComponent.

◆ DoIntersectCheck()

bool ExtBaseInteractionHandlerComponent.DoIntersectCheck ( IEntity  controlledEntity)
protected

Should preferred context collection use intersect checks? This will make a ray check against the context's radius.

This works well in tight places where relying on physical collisions is impossible - e.g. in vehicle interiors.

Implemented in SCR_InteractionHandlerComponent, and InteractionHandlerComponent.

◆ GetCanInteractScript()

bool ExtBaseInteractionHandlerComponent.GetCanInteractScript ( IEntity  controlledEntity)
protected

Are we allowed to start collecting and processing interactions? Implement custom logic and return true if yes, false otherwise.

Parameters
controlledEntityThe entity that wants to be able to interact (player controlled)

Implemented in SCR_InteractionHandlerComponent, and InteractionHandlerComponent.

◆ GetControlledEntity()

proto external IEntity ExtBaseInteractionHandlerComponent.GetControlledEntity ( )

Returns the controlled entity or null if none.

◆ GetCurrentContext()

proto external UserActionContext ExtBaseInteractionHandlerComponent.GetCurrentContext ( )

Returns currently gathered (active-preferred) context or null if none.

◆ GetFilteredActions()

proto external int ExtBaseInteractionHandlerComponent.GetFilteredActions ( out notnull array< BaseUserAction outActions,
out notnull array< bool >  outCanBePerformed 
)

After collection is done, this method can be used for retrieving already checked user actions from current context.

Parameters
outActionsArray that will be filled with user actions that can be shown
outCanBePerformedArray that complements the outActions with result of CanBePerformed check
Returns
Amount of actions gathered, can be 0 if none

◆ GetIsInteractionAvailableScript()

bool ExtBaseInteractionHandlerComponent.GetIsInteractionAvailableScript ( )
protected

Are any user actions available to interact with? Implement and return true if yes, false otherwise.

Implemented in SCR_InteractionHandlerComponent, and InteractionHandlerComponent.

◆ GetLastReferencePoint()

proto external vector ExtBaseInteractionHandlerComponent.GetLastReferencePoint ( float  timeSlice)

The last known interaction reference point.

◆ GetManualCollectionOverride()

proto external bool ExtBaseInteractionHandlerComponent.GetManualCollectionOverride ( )

Returns whether manual collection override is set (we expect a list of entities to be provided from the user instead)

◆ GetManualOverrideList()

array< IEntity > ExtBaseInteractionHandlerComponent.GetManualOverrideList ( IEntity  owner,
out vector  referencePoint 
)
protected

Callback whem manual collection override is enabled.

See SetManualCollectionOverride. It may return nullptrs inside array if this is called between deletion of instance inside the array and updating of the array.

Parameters
ownerParent entity
referencePointPoint in world space used to calculate distance and sort contexts by

Implemented in SCR_InteractionHandlerComponent.

◆ GetNearbyAvailableContextList()

proto external int ExtBaseInteractionHandlerComponent.GetNearbyAvailableContextList ( out notnull array< UserActionContext outContexts)

If nearby collection is enabled, fills the provided array with collected contexts nearby.

Only contexts that have at least one action that can be shown and performed are output.

Parameters
outContextsArray of contexts that will be cleared and filled with nearby available contexts.
Returns
Returns the count of output contexts or 0 if none.

◆ GetNearbyCollectionEnabled()

proto external bool ExtBaseInteractionHandlerComponent.GetNearbyCollectionEnabled ( )

Returns whether nearby available context collection is enabled.

◆ GetNearbyCollectionRadius()

proto external float ExtBaseInteractionHandlerComponent.GetNearbyCollectionRadius ( )

Returns the radius in meters that is used for nearby available context collection.

◆ GetNearbyShowableContextList()

proto external int ExtBaseInteractionHandlerComponent.GetNearbyShowableContextList ( out notnull array< UserActionContext outContexts)

If nearby collection is enabled, fills the provided array with collected contexts nearby.

Only contexts that have at least one action that can be shown, but not performed are output.

Parameters
outContextsArray of contexts that will be cleared and filled with nearby available contexts.
Returns
Returns the count of output contexts or 0 if none.

◆ GetNearbyUnavailableContextList()

proto external int ExtBaseInteractionHandlerComponent.GetNearbyUnavailableContextList ( out notnull array< UserActionContext outContexts)

If nearby collection is enabled, fills the provided array with collected contexts nearby.

Only contexts that have at least one action, but none can be shown or performed are output.

Parameters
outContextsArray of contexts that will be cleared and filled with nearby available contexts.
Returns
Returns the count of output contexts or 0 if none.

◆ GetSelectedActionScript()

BaseUserAction ExtBaseInteractionHandlerComponent.GetSelectedActionScript ( )
protected

Currently sected action or null if none.

Implement and return currently selected action.

Implemented in SCR_InteractionHandlerComponent, and InteractionHandlerComponent.

◆ IsContextAvailable()

proto external bool ExtBaseInteractionHandlerComponent.IsContextAvailable ( )

Returns true when there is a gathered context available.

◆ OnContextChanged()

void ExtBaseInteractionHandlerComponent.OnContextChanged ( UserActionContext  previousContext,
UserActionContext  newContext 
)
protected

Event called when InteractionHandlerComponent finds new target UserActionContext and a change occurs.

Both previous and new context might be 'null' if no context is caught in collection.

Parameters
previousContextContext that was active up until this collection - can be null
newContextContext that will be active after this collection - can be null if nothing was caught

Implemented in SCR_InteractionHandlerComponent.

◆ OnControlledEntityChanged()

void ExtBaseInteractionHandlerComponent.OnControlledEntityChanged ( IEntity  from,
IEntity  to 
)
protected

◆ OnPostFrame()

void ExtBaseInteractionHandlerComponent.OnPostFrame ( IEntity  owner,
IEntity  controlledEntity,
float  timeSlice 
)
protected

Called once per frame after simulation.

Can be used for drawing and updating UI.

Implemented in SCR_InteractionHandlerComponent.

◆ SetManualCollectionOverride()

proto external void ExtBaseInteractionHandlerComponent.SetManualCollectionOverride ( bool  enabled)

If set to true, we expect a list of entities to be provided from the user instead.

◆ SetNearbyCollectionEnabled()

proto external void ExtBaseInteractionHandlerComponent.SetNearbyCollectionEnabled ( bool  enabled)

Sets whether nearby available context collection should be enabled.

Parameters
enabledTrue to enable collection, false to disable.

◆ SetSelectedAction()

proto external void ExtBaseInteractionHandlerComponent.SetSelectedAction ( BaseUserAction  action)
protected

Sets currently select action.

Only relevant to the owner of this component, ie. for the local player. Accepts null for when action is to be cleared.


The documentation for this interface was generated from the following file: