InteractablesInterface Class
The InteractablesInterface class is used to collect and interact with multiple Interactables. The Interactables script extends this class, and a Room's room_interactables property is also an InteractablesInterface. When executing a Command, all the relevant InteractablesInterfaces available to the player are collected into a single InteractablesInterface which is passed to the Command's Callable. It's a very important class!
Functions
get_interactable
get_interactable(interactable_identifier: String) -> InteractableReturns an Interactable registered to this InteractablesInterface with identifier
interactable_identifier. If no Interactable with that identifier is found, returnsnull.
get_all_interactables
get_all_interactables() -> Array[Interactable]Returns an
Arrayof all the Interactables registered to this InteractablesInterface.
add_interactable
add_interactable(in_interactable: Interactable) -> voidRegisters an Interactable
in_interactableto this InteractablesInterface.
add_interactables
add_interactables(in_interactables: Array[Interactable]) -> voidRegisters all Interactables in
in_interactableto this InteractablesInterface.
attempt_interaction
attempt_interaction(interactable_identifier: String, interaction_identifier: String, ...args: Array) -> VariantAttempts an interaction with identifier
interaction_identifieron an Interactable with identifierinteractable_identifierwith any given argumentsargs. Arguments can be given as if they were regular arguments to this function; do not give them as anArray. If either no Interactableinteractable_identifieris found or that Interactable does not have an interactioninteraction_identifier,nullwill be returned; otherwise, the return value will be the value returned by the interaction.