Skip to content

TriggerAreaDetectionFactionTrigger ​

Inherits: EventTrigger < Resource

Triggers when an entity of a specific faction enters or exits a detection trigger area

Properties ​

inttrigger_area_id0
TriggerModetrigger_modeTriggerMode.ON_ENTER
intfaction_id0

Variables ​

Stringtrigger_area_name""
TriggerAreatarget_trigger_areanull

Methods ​

Stringget_display_name()
Stringget_function_description()
voidsetup()
voidcleanup()
voidfind_target_trigger_area()
voidconnect_trigger_area_signals()
voiddisconnect_trigger_area_signals()
boolis_matching_entity( body: Node3D )
boolis_triggered( event_data: Dictionary )
Stringgenerate_objective_description()

Enumerations ​

enum TriggerMode ​

The options of trigger mode: on enter, on exit, on both.

  • ON_ENTER = 0
  • ON_EXIT = 1
  • ON_BOTH = 2

Property descriptions ​

int trigger_area_id = 0 ​

The trigger area ID to track

TriggerMode trigger_mode = TriggerMode.ON_ENTER ​

When to trigger (enter, exit, or both)

int faction_id = 0 ​

Required faction ID

Variable descriptions ​

String trigger_area_name = "" ​

Trigger area name - auto-populated from the target trigger area if it exists

TriggerArea target_trigger_area = null ​

Reference to the target Trigger area

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.

void setup() ​

Starts listening: connects the signals the trigger waits for.

void cleanup() ​

Stops listening: disconnects the signals of the trigger.

void find_target_trigger_area() ​

Finds the trigger area the trigger watches by its id.

void connect_trigger_area_signals() ​

Connects the signals of the trigger area (an entity enters, an entity leaves).

void disconnect_trigger_area_signals() ​

Disconnects the signals of the trigger area.

bool is_matching_entity( body: Node3D ) ​

Is the body an entity of the faction the trigger waits for?

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").