Endstar LUA API Documentation
Loading...
Searching...
No Matches
Interactable Class Reference

This class allows a player to Interact with the object by pressing the interact key. What it does when interacted with is up to the lua script! In the future, NPCs can also be told to interact with these objects! More...

Public Member Functions

int GetNumberOfInteractables ()
 Exposes the number of interactable colliders to the Lua environment.
 
void SetInteractionAnimation (Context instigator, int interactionAnimation)
 Sets the InteractionAnimation enum on the interactable.
 
void SetIsHeldInteraction (Context instigator, bool isHeldInteraction)
 If held, it requires the player to hold down the interact key, and upon release cancels the interaction.
 
void StopInteraction (Context instigator, Context targetInteractor)
 Calls "OnInteractionStopped" on the Interactable objects Lua Script and informs the interactor (usually a character) that it is done as well.
 
void SetInteractableEnabled (Context instigator, int index, bool isEnabled)
 Sets a specific interactable colliders enabled state.
 
void SetAllInteractablesEnabled (Context instigator, bool isEnabled)
 Sets all the interactable colliders enabled states.
 
void SetIconFromPropReference (Context instigator, PropLibraryReference propLibraryReference)
 This allows the player's interaction prompt to show the icon of an object next to it, indicating that the object is required, such as a key on a locked door!
 
void SetAnchorOverride (Context instigator, int index, Vector3 overridePosition)
 
void ClearAnchorOverride (Context instigator, int index)
 
void SetUsePlayerAnchor (Context instigator, int index, bool usePlayerAnchor)
 
void SetHidePromptDuringInteraction (Context instigator, bool value)
 Sets if the interaction prompt should be hidden during an active interaction.
 
void SetInteractableAlert (Context instigator, int interactionAlertType)
 Turns on the visual indicator above this object!
 
void SetInteractableAlertForIndex (Context instigator, int interactionAlertType, int index)
 Turns on the visual indicator above this object!
 
void SetInteractablePromptText (Context instigator, string newPromptText)
 
void SetInteractablePromptText (Context instigator, string newPromptText, int index)
 
void SetProximityIndicatorDistance (Context instigator, float newMaximumDistance)
 
void SetProximityIndicatorDistance (Context instigator, float newMaximumDistance, int index)
 
void ReserveInteraction (Context instigator)
 
void ReserveInteraction (Context instigator, int index)
 
void ClearInteractionReservation (Context instigator)
 
void ClearInteractionReservation (Context instigator, int index)
 

Detailed Description

This class allows a player to Interact with the object by pressing the interact key. What it does when interacted with is up to the lua script! In the future, NPCs can also be told to interact with these objects!

Member Function Documentation

◆ ClearAnchorOverride()

void ClearAnchorOverride ( Context instigator,
int index )

◆ ClearInteractionReservation() [1/2]

void ClearInteractionReservation ( Context instigator)

◆ ClearInteractionReservation() [2/2]

void ClearInteractionReservation ( Context instigator,
int index )

◆ GetNumberOfInteractables()

int GetNumberOfInteractables ( )

Exposes the number of interactable colliders to the Lua environment.

Returns

◆ ReserveInteraction() [1/2]

void ReserveInteraction ( Context instigator)

◆ ReserveInteraction() [2/2]

void ReserveInteraction ( Context instigator,
int index )

◆ SetAllInteractablesEnabled()

void SetAllInteractablesEnabled ( Context instigator,
bool isEnabled )

Sets all the interactable colliders enabled states.

Parameters
contextThe source context that is triggering this change
isEnabledThe new enabled state of all the interactable colliders

◆ SetAnchorOverride()

void SetAnchorOverride ( Context instigator,
int index,
Vector3 overridePosition )

◆ SetHidePromptDuringInteraction()

void SetHidePromptDuringInteraction ( Context instigator,
bool value )

Sets if the interaction prompt should be hidden during an active interaction.

Parameters
instigatorThe source context that is triggering this change
valueTrue is hidden

◆ SetIconFromPropReference()

void SetIconFromPropReference ( Context instigator,
PropLibraryReference propLibraryReference )

This allows the player's interaction prompt to show the icon of an object next to it, indicating that the object is required, such as a key on a locked door!

Parameters
instigatorThe source context that is triggering this change
propLibraryReferenceWhich item should it point to? Nil is acceptable to clear the icon!

◆ SetInteractableAlert()

void SetInteractableAlert ( Context instigator,
int interactionAlertType )

Turns on the visual indicator above this object!

<param name="instigator"The source context that is triggering this change>

Parameters
interactionAlertTypeWhat InteractionAnimation should appear above the object?

◆ SetInteractableAlertForIndex()

void SetInteractableAlertForIndex ( Context instigator,
int interactionAlertType,
int index )

Turns on the visual indicator above this object!

<param name="instigator"The source context that is triggering this change>

Parameters
interactionAlertTypeWhat InteractionAnimation should appear above the object?
indexThe index of the collider you wish to change. Most objects have only a single collider and you can pass in 0

◆ SetInteractableEnabled()

void SetInteractableEnabled ( Context instigator,
int index,
bool isEnabled )

Sets a specific interactable colliders enabled state.

Parameters
contextThe source context that is triggering this change
indexThe index of the collider you wish to change. Most objects have only a single collider and you can pass in 0
isEnabledThe new enabled state of the interactable collider

◆ SetInteractablePromptText() [1/2]

void SetInteractablePromptText ( Context instigator,
string newPromptText )

◆ SetInteractablePromptText() [2/2]

void SetInteractablePromptText ( Context instigator,
string newPromptText,
int index )

◆ SetInteractionAnimation()

void SetInteractionAnimation ( Context instigator,
int interactionAnimation )

Sets the InteractionAnimation enum on the interactable.

Parameters
interactionAnimationWhich InteractionAnimation should play when a character interacts with this?

◆ SetIsHeldInteraction()

void SetIsHeldInteraction ( Context instigator,
bool isHeldInteraction )

If held, it requires the player to hold down the interact key, and upon release cancels the interaction.

Parameters
isHeldInteractionDoes the key need to be held?

◆ SetProximityIndicatorDistance() [1/2]

void SetProximityIndicatorDistance ( Context instigator,
float newMaximumDistance )

◆ SetProximityIndicatorDistance() [2/2]

void SetProximityIndicatorDistance ( Context instigator,
float newMaximumDistance,
int index )

◆ SetUsePlayerAnchor()

void SetUsePlayerAnchor ( Context instigator,
int index,
bool usePlayerAnchor )

◆ StopInteraction()

void StopInteraction ( Context instigator,
Context targetInteractor )

Calls "OnInteractionStopped" on the Interactable objects Lua Script and informs the interactor (usually a character) that it is done as well.

Parameters
context