This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

World Triggers

Image showing a PrintLog World Trigger component, as seen in the Entity Inspector.

World Trigger Overview

Functionality

World Triggers do the actual processing once an input fires.

Triggers can Trigger Other Triggers.

Triggers can have Reset Enabled or Disabled.

Reset can be by toggle, or by direct command.

Repeated Activations can just keep firing the same Trigger if valid.

Triggers have logic for:

  • Trigger

  • Sets Triggered

  • Updates Listening

  • Reset

  • Removes Triggered

  • Updates Listening

Some can have boolean logic like “Any“ or “All“ as requirements to finally activate. Allowing the need for multiple Switches.

TriggerTypes

Basic Types

  • Toggle (On/Off)
  • ProgressionSwitch (Count Up/Down)
  • Make Sound
  • Play/Stop Cinematic/Timeline
  • Dialogue
  • Item Spawn
  • Spawn Object
  • Spawn Pulse
  • GS_Action
  • SetRecord
  • Play/Stop Animation

Unit Facing

Has various means of targeting a Unit.

  • Equip Item
  • Affect Stats
  • Give Item
  • Status Effect
  • Level Up
  • Change Stage (player only)
  • Teleport

Repeater/Boolean Types

  • Invert Trigger
  • Any/All Trigger
  • Timeout Trigger

Using World Triggers


API

// WorldTriggerIncomingEvents
//! Trigger intakes a list of channels to determine if it should fire.
//! If onlyOnce, will not fire a second time.
//! Call parent to determine if Trigger goes through before handling additional logic.
bool Trigger(AZStd::unordered_set<AZStd::string> channels) override;

//! Reset takes channels like Trigger, but processes the reveral of what the Trigger did.
//! If can't reset, will not fire.
//! Call parent to determine if Reset goes through before handling additional logic.
bool Reset(AZStd::unordered_set<AZStd::string> channels) override;


// Local Methods
// Utility that quickly checks for channels being fired.
virtual bool EvaluateChannels(AZStd::unordered_set<AZStd::string> channels);
virtual bool IsTriggered() { return isTriggered; };

Extending World Triggers