7 [
Attribute(
desc:
"When enabled, task will fail upon activation instead of being completed.",
category:
"Trigger Task")]
8 protected bool m_bToFail;
10 [
Attribute(
desc:
"When enabled, task will change state when its trigger is deactivated instead of activated.",
category:
"Trigger Task")]
11 protected bool m_bOnTriggerDeactivate;
15 protected void OnTriggerActivate()
27 if (!m_bOnTriggerDeactivate)
30 supportEntity.FailTask(
this);
32 supportEntity.FinishTask(
this);
35 protected void OnTriggerDeactivate()
47 if (m_bOnTriggerDeactivate)
50 supportEntity.FailTask(
this);
52 supportEntity.FinishTask(
this);
56 override void SetTargetFaction(
Faction targetFaction)
58 super.SetTargetFaction(targetFaction);
61 m_Trigger.SetOwnerFaction(targetFaction);
63 override void EOnInit(IEntity owner)
67 if (Replication.IsServer())
76 child = child.GetSibling();
81 m_Trigger.GetOnActivate().Insert(OnTriggerActivate);
82 m_Trigger.GetOnDeactivate().Insert(OnTriggerDeactivate);
86 Print(
"SCR_TriggerTask is missing a child of type SCR_BaseFactionTriggerEntity!", LogLevel.ERROR);