Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_CampaignTutorialArlandDrivingAdvanced22.c
Go to the documentation of this file.
1 [EntityEditorProps(insertable: false)]
3 {
4 };
5 
6 //------------------------------------------------------------------------------------------------
8 {
9  //------------------------------------------------------------------------------------------------
10  override protected void Setup()
11  {
12  m_bCheckWaypoint = false;
13  RegisterWaypoint("Hummer2");
14  m_TutorialComponent.SetWaypointMiscImage("CUSTOM", true);
15 
16  SCR_HintManagerComponent.HideHint();
17 
18  array<IEntity> rootItems = {};
19 
20  IEntity entity = GetGame().GetPlayerManager().GetPlayerControlledEntity(GetGame().GetPlayerController().GetPlayerId());
21 
22  if (!entity)
23  return;
24 
25  SCR_CharacterInventoryStorageComponent component = SCR_CharacterInventoryStorageComponent.Cast(entity.FindComponent(SCR_CharacterInventoryStorageComponent));
26 
27  if (!component)
28  return;
29 
30  SCR_InventoryStorageManagerComponent storageManComp = SCR_InventoryStorageManagerComponent.Cast(m_Player.FindComponent(SCR_InventoryStorageManagerComponent));
31 
32  if (!storageManComp)
33  return;
34 
35  storageManComp.GetAllRootItems(rootItems);
36 
37  foreach (IEntity item : rootItems)
38  {
39  if(!item)
40  continue;
41 
42  SCR_RepairSupportStationComponent repairComp = SCR_RepairSupportStationComponent.Cast(item.FindComponent(SCR_RepairSupportStationComponent));
43 
44  if (repairComp)
45  component.StoreItemToQuickSlot(item, 4, true);
46  }
47  if (!m_TutorialComponent.GetVoiceSystem().IsPlaying())
48  PlaySoundSystem("Repair");
49  else
50  GetGame().GetCallqueue().CallLater(PlaySoundSystem, 1000, false, "Repair", false);
51  }
52 
53  //------------------------------------------------------------------------------------------------
54  override protected bool GetIsFinished()
55  {
56  if (!m_TutorialComponent.GetVoiceSystem().IsPlaying())
57  {
58  SCR_HintManagerComponent.ShowHint(m_TutorialHintList.GetHint(m_TutorialComponent.GetStage()));
59  }
60 
61  Vehicle hmw = m_TutorialComponent.GetHummer();
62  if (hmw)
63  {
64  SCR_VehicleDamageManagerComponent damageManager = SCR_VehicleDamageManagerComponent.Cast(hmw.GetDamageManager());
65  if (damageManager)
66  {
67  HitZone engineHitZone = damageManager.GetHitZoneByName("Engine_01");
68  if (engineHitZone)
69  return engineHitZone.GetHealth() > 598;
70  }
71  return false;
72  }
73  return false;
74  }
75 };
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
HitZone
Definition: HitZone.c:12
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_VehicleDamageManagerComponent
void SCR_VehicleDamageManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_VehicleDamageManagerComponent.c:1720
SCR_CampaignTutorialArlandDrivingAdvanced22Class
Definition: SCR_CampaignTutorialArlandDrivingAdvanced22.c:2
GetPlayerController
proto external PlayerController GetPlayerController()
Definition: SCR_PlayerDeployMenuHandlerComponent.c:307
m_Player
protected ChimeraCharacter m_Player
Definition: SCR_CampaignTutorialComponentArland.c:40
SCR_BaseCampaignTutorialArlandStageClass
Definition: SCR_BaseCampaignTutorialArlandStage.c:2
SCR_CampaignTutorialArlandDrivingAdvanced22
Definition: SCR_CampaignTutorialArlandDrivingAdvanced22.c:7
GetPlayerId
proto external int GetPlayerId()
Definition: SCR_SpawnRequestComponent.c:39