Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_InstantTriggerComponent.c
Go to the documentation of this file.
1 [ComponentEditorProps(category: "GameScripted/Trigger", description: "Gets the BaseTriggerComponent on the entity and triggers it on EOnInit")]
2 class SCR_InstantTriggerComponentClass : ScriptComponentClass
3 {
4  //------------------------------------------------------------------------------------------------
5  //Needs BaseTriggerComponent
6  static override array<typename> Requires(IEntityComponentSource src)
7  {
8  array<typename> requires = {};
9 
10  requires.Insert(BaseTriggerComponent);
11 
12  return requires;
13  }
14 }
15 
16 class SCR_InstantTriggerComponent : ScriptComponent
17 {
18  //------------------------------------------------------------------------------------------------
19  override void EOnInit(IEntity owner)
20  {
21  if (SCR_Global.IsEditMode(owner))
22  return;
23 
24  BaseTriggerComponent trigger = BaseTriggerComponent.Cast(owner.FindComponent(BaseTriggerComponent));
25  if (trigger)
26  trigger.OnUserTrigger(owner);
27  else
28  Print("'SCR_InstantTriggerComponent' could not find 'BaseTriggerComponent'!", LogLevel.ERROR);
29  }
30 
31  //------------------------------------------------------------------------------------------------
32  override void OnPostInit(IEntity owner)
33  {
34  SetEventMask(owner, EntityEvent.INIT);
35  }
36 }
ComponentEditorProps
SCR_FragmentEntityClass ComponentEditorProps
BaseTriggerComponent
Definition: BaseTriggerComponent.c:12
ScriptComponent
SCR_SiteSlotEntityClass ScriptComponent
OnPostInit
override void OnPostInit(IEntity owner)
Called on PostInit when all components are added.
Definition: SCR_InstantTriggerComponent.c:32
SCR_InstantTriggerComponentClass
Definition: SCR_InstantTriggerComponent.c:2
EOnInit
SCR_InstantTriggerComponentClass ScriptComponentClass EOnInit(IEntity owner)
Definition: SCR_InstantTriggerComponent.c:19
SCR_Global
Definition: Functions.c:6
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180