Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_TutorialNavigation16.c
Go to the documentation of this file.
1 [EntityEditorProps(insertable: false)]
3 {
4 };
5 
6 //------------------------------------------------------------------------------------------------
8 {
9  bool m_bPositionFound;
10  int m_iPlacedMarkers;
11  //------------------------------------------------------------------------------------------------
12  override protected void Setup()
13  {
14  SCR_HintManagerComponent.HideHint();
15  SCR_HintManagerComponent.ClearLatestHint();
16 
17  SCR_MapEntity mapEnt = SCR_MapEntity.GetMapInstance();
18  if (!mapEnt)
19  return;
20 
21  SCR_MapMarkersUI mapMarkersUI = SCR_MapMarkersUI.Cast(mapEnt.GetMapUIComponent(SCR_MapMarkersUI));
22  if (!mapMarkersUI)
23  return;
24 
25  mapMarkersUI.GetOnCustomMarkerPlaced().Insert(MarkerPlaced);
26 
27  PlaySoundSystem("Navigation_OrientationLocationMarker");
28  HintOnVoiceOver();
29  }
30 
31  //------------------------------------------------------------------------------------------------
32  protected void UpdateHint()
33  {
34  string text;
35 
36  if (m_iPlacedMarkers >= 5 && m_iPlacedMarkers < 10)
37  {
38  text = "5";
39  m_TutorialComponent.ShowMapDescriptor("LighthousePos", true);
40  }
41 
42  if (m_iPlacedMarkers >= 10 && m_iPlacedMarkers < 15)
43  {
44  text = "10";
45  m_TutorialComponent.ShowMapDescriptor("ChurchPos", true);
46  }
47 
48  if (m_iPlacedMarkers >= 15 && m_iPlacedMarkers < 20)
49  {
50  text = "15";
51  m_TutorialComponent.ShowMapDescriptor("TowerPos", true);
52  }
53 
54  if (m_iPlacedMarkers >= 20)
55  {
56  text = "20";
57  m_TutorialComponent.ShowMapDescriptor("NavigationPos", true)
58  }
59 
60  SCR_HintManagerComponent.ShowHint(m_TutorialHintList.GetHint(m_TutorialComponent.GetStage(), text));
61  }
62 
63  //------------------------------------------------------------------------------------------------
64  protected void MarkerPlaced(int posX, int posY, bool isLocal)
65  {
66  vector position = m_Player.GetOrigin();
67 
68  position[0] = position[0] - posX;
69  position[2] = position[2] - posY;
70 
71  m_iPlacedMarkers++;
72 
73  if (m_iPlacedMarkers == 5)
74  UpdateHint();
75 
76  if (m_iPlacedMarkers == 10)
77  {
78  ScriptInvokerVoid invoker = m_System.GetOnFinished();
79  if (invoker)
80  invoker.Insert(UpdateHint);
81 
82  PlaySoundSystem("Navigation_OrientationStruggle2", true);
83  }
84 
85  if (m_iPlacedMarkers == 15)
86  PlaySoundSystem("Navigation_OrientationStruggle3");
87 
88  if (m_iPlacedMarkers == 20)
89  {
90  PlaySoundSystem("Navigation_OrientationStruggle4", true);
91 
92  m_fDelay = 14;
93  m_bPositionFound = true;
94  }
95 
96  if (position[0] > 150 || position[0] < -150)
97  return;
98 
99  if (position[2] > 150 || position[2] < -150)
100  return;
101 
102  m_bPositionFound = true;
103  }
104 
105  //------------------------------------------------------------------------------------------------
106  override protected bool GetIsFinished()
107  {
108  return m_bPositionFound;
109  }
110 
111  //------------------------------------------------------------------------------------------------
113  {
114  if (!m_System)
115  return;
116 
117  ScriptInvokerVoid invoker = m_System.GetOnFinished();
118  if (invoker)
119  invoker.Remove(UpdateHint);
120  }
121 };
SCR_BaseCampaignTutorialArlandStage
Definition: SCR_BaseCampaignTutorialArlandStage.c:7
EntityEditorProps
enum EQueryType EntityEditorProps(category:"GameScripted/Sound", description:"THIS IS THE SCRIPT DESCRIPTION.", color:"0 0 255 255")
Definition: SCR_AmbientSoundsComponent.c:12
m_fDelay
protected float m_fDelay
Definition: SCR_TooltipManagerEditorUIComponent.c:8
SCR_TutorialNavigation16Class
Definition: SCR_TutorialNavigation16.c:2
m_Player
protected ChimeraCharacter m_Player
Definition: SCR_CampaignTutorialComponentArland.c:40
SCR_TutorialNavigation16
Definition: SCR_TutorialNavigation16.c:7
SCR_MapEntity
Map entity.
Definition: SCR_MapEntity.c:20
SCR_BaseCampaignTutorialArlandStageClass
Definition: SCR_BaseCampaignTutorialArlandStage.c:2
SCR_MapMarkersUI
Markers UI map component.
Definition: SCR_MapMarkersUI.c:6
ScriptInvokerVoid
ScriptInvokerBase< ScriptInvokerVoidMethod > ScriptInvokerVoid
Definition: SCR_ScriptInvokerHelper.c:9
position
vector position
Definition: SCR_DestructibleTreeV2.c:30