Skip to content

Interaction ​

Inherits: Resource

Inherited by: ConversationInteraction, CraftingInteraction, EntityInteraction, GrantQuestInteraction, InteractableObjectInteraction, ShowUIPanelInteraction, SpeakInteraction, TrainerInteraction, VendorInteraction

Base class for all entity interactions Provides the foundation for different types of NPC interactions

Variables ​

floatinteraction_distance2.0
Variantentity
GameHost.SystemHubsystem_hub

Methods ​

voidset_entity_reference( new_entity: Variant, p_system_hub: GameHost.SystemHub )
voidsetup_for_interactable_objects( interactable: InteractableObject )
boolcan_interact( player: Player )
Stringget_block_reason( _entity: Entity )
boolneeds_use_time( _entity: Entity )
voidstart_interaction( _player: Player )
voidend_interaction()

Variable descriptions ​

float interaction_distance = 2.0 ​

Range needed for interaction

Variant entity ​

Reference to the entity this interaction belongs to

GameHost.SystemHub system_hub ​

Refrence to the combat manager

Method descriptions ​

void set_entity_reference( new_entity: Variant, p_system_hub: GameHost.SystemHub ) ​

Set the entity reference

void setup_for_interactable_objects( interactable: InteractableObject ) ​

Sets the interaction up on its object. Nothing by default.

bool can_interact( player: Player ) ​

Check if the player can interact with this interaction

String get_block_reason( _entity: Entity ) ​

Why the interaction cannot start now ("" = it can, or it says nothing): the user is told when can_interact is false

bool needs_use_time( _entity: Entity ) ​

Does this use take the time the object asks for (its use time) right now? An interaction that is only a second look at something that is already there (a loot window with loot waiting) says no

void start_interaction( _player: Player ) ​

Start the interaction with the given player

void end_interaction() ​

End the current interaction