Skip to content

PlayerGatheredTrigger ​

Inherits: PlayerEventTrigger < EventTrigger < Resource

Triggers when the player gathers from a gathering node (a GatherInteraction): any node, or one kind of node, a number of times. As an objective of a quest it shows the tally ("Gather 5 Moonpetal 3/5").

Properties ​

intgather_node_id0
intamount_required1

Variables ​

intcurrent_amount0

Methods ​

Stringget_display_name()
Stringget_function_description()
intget_tally_target()
intget_tally_progress()
voidreset()
voidset_progress( amount: int )
voidsetup_player_connection( player: Player )
voidcleanup_player_connection( player: Player )
boolis_triggered( event_data: Dictionary )
Stringgenerate_objective_description()
boolconcerns_target( target: Variant )

Property descriptions ​

int gather_node_id = 0 ​

The kind of node (an interactable) to count. 0 = any gathering node

int amount_required = 1 ​

How many times the player has to gather before the trigger fires

Variable descriptions ​

int current_amount = 0 ​

How many gathers were counted so far

Method descriptions ​

String get_display_name() ​

The name of the trigger in the editor.

String get_function_description() ​

The sentence the editor shows for the trigger, with {placeholders} for its values.

int get_tally_target() ​

The number the quest objective counts up to (0 when it does not count).

int get_tally_progress() ​

How far the count of the quest objective is now.

void reset() ​

Sets the count back to zero.

void set_progress( amount: int ) ​

Sets the count (when a quest is restored from a save).

void setup_player_connection( player: Player ) ​

Connects the signal of a player this trigger listens to.

void cleanup_player_connection( player: Player ) ​

Disconnects the signal of a player.

bool is_triggered( event_data: Dictionary ) ​

Does this event data satisfy the trigger? Called when the signal the trigger listens to fires.

String generate_objective_description() ​

The line of the quest objective this trigger makes ("Kill 5 wolves").

bool concerns_target( target: Variant ) ​

True for a gathering node of the tracked definition (any node is not listed: 0 means every node)