Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_FiringRangeLineArea.c
Go to the documentation of this file.
1 [EntityEditorProps(category: "GameScripted/Firingrange", description: "Defines area from which player should shoot at target. Needs to be a child of firing line controller. ", color: "0 0 255 255")]
3 {
4 };
5 
6 //------------------------------------------------------------------------------------------------
7 class SCR_FiringRangeLineArea : ScriptedGameTriggerEntity
8 {
10  private SCR_FiringRangeController m_LineController;
11  private SCR_FiringRangeManager m_FiringRangeManager;
12 
13  //------------------------------------------------------------------------------------------------
14  override void EOnInit (IEntity owner)
15  {
16  // Get its parent - firing line controller
17  m_LineController = SCR_FiringRangeController.Cast(owner.GetParent());
18  if (!m_LineController)
19  return;
20 
21  // And it's parent firing range manager
22  m_FiringRangeManager = SCR_FiringRangeManager.Cast(m_LineController.GetParent());
23  }
24 
25  //------------------------------------------------------------------------------------------------
26  override void OnDeactivate(IEntity ent)
27  {
28  if (!m_LineController || !m_FiringRangeManager)
29  return;
30 
31  // Get the ID of player who left the trigger
32  int firigLineOwner = GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(ent);
33  if (!firigLineOwner)
34  return;
35 
36  // If those two match, break the targets sequence
37  if (m_LineController.GetFiringLineOwnerId() == firigLineOwner)
38  m_LineController.BackToDefaultTargetsFromLineArea();
39  }
40 
41  //------------------------------------------------------------------------------------------------
42 
43  void SCR_FiringRangeLineArea(IEntitySource src, IEntity parent)
44  {
45  }
46 
47  //------------------------------------------------------------------------------------------------
49  {
50 
51  }
52 };
EntityEditorProps
enum EQueryType EntityEditorProps(category:"GameScripted/Sound", description:"THIS IS THE SCRIPT DESCRIPTION.", color:"0 0 255 255")
Definition: SCR_AmbientSoundsComponent.c:12
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
ScriptedGameTriggerEntityClass
Definition: ScriptedGameTriggerEntity.c:12
SCR_FiringRangeManager
Definition: SCR_FiringRangeManager.c:7
SCR_FiringRangeLineArea
Definition: SCR_FiringRangeLineArea.c:7
SCR_FiringRangeLineAreaClass
Definition: SCR_FiringRangeLineArea.c:2
SCR_FiringRangeController
Definition: SCR_FiringRangeController.c:9
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180