Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_TutorialNavigation17.c
Go to the documentation of this file.
1 [EntityEditorProps(insertable: false)]
3 {
4 };
5 
6 //------------------------------------------------------------------------------------------------
8 {
9  bool m_bPositionFound;
10  //------------------------------------------------------------------------------------------------
11  override protected void Setup()
12  {
13  SCR_HintManagerComponent.HideHint();
14  SCR_HintManagerComponent.ClearLatestHint();
15 
16  SCR_MapEntity mapEnt = SCR_MapEntity.GetMapInstance();
17  if (!mapEnt)
18  return;
19 
20  SCR_MapMarkersUI mapMarkersUI = SCR_MapMarkersUI.Cast(mapEnt.GetMapUIComponent(SCR_MapMarkersUI));
21  if (!mapMarkersUI)
22  return;
23 
24  mapMarkersUI.GetOnCustomMarkerPlaced().Remove(MarkerPlaced);
25  mapMarkersUI.GetOnCustomMarkerPlaced().Insert(MarkerPlaced);
26 
27  PlaySoundSystem("Navigation_OrientationGridPos", true);
28  HintOnVoiceOver();
29 
30  }
31 
32  //------------------------------------------------------------------------------------------------
33  void MarkerPlaced(int posX, int posY, bool isLocal)
34  {
35  IEntity ent = GetGame().GetWorld().FindEntityByName("WP_GREENHOUSE");
36  if (!ent)
37  return;
38 
39  vector position = ent.GetOrigin();
40 
41  position[0] = position[0] - posX;
42  position[2] = position[2] - posY;
43 
44  if (position[0] > 50 || position[0] < -50)
45  return;
46 
47  if (position[2] > 50 || position[2] < -50)
48  return;
49 
50  m_bPositionFound = true;
51  }
52 
53  //------------------------------------------------------------------------------------------------
54  override protected bool GetIsFinished()
55  {
56  return m_bPositionFound;
57  }
58 };
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
SCR_TutorialNavigation17Class
Definition: SCR_TutorialNavigation17.c:2
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_TutorialNavigation17
Definition: SCR_TutorialNavigation17.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
position
vector position
Definition: SCR_DestructibleTreeV2.c:30