Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_Tutorial_LRS_Attach_Optic.c
Go to the documentation of this file.
1
[
EntityEditorProps
(insertable:
false
)]
2
class
SCR_Tutorial_LRS_Attach_OpticClass
:
SCR_BaseTutorialStageClass
3
{
4
};
5
6
//------------------------------------------------------------------------------------------------
7
class
SCR_Tutorial_LRS_Attach_Optic
:
SCR_BaseTutorialStage
8
{
9
WeaponComponent
m_WeaponComp;
10
CharacterControllerComponent m_CharacterComponent;
11
//------------------------------------------------------------------------------------------------
12
override
protected
void
Setup
()
13
{
14
SCR_HintManagerComponent.HideHint();
15
SCR_HintManagerComponent.ClearLatestHint();
16
17
IEntity
gun =
GetGame
().GetWorld().FindEntityByName(
"Course_M21"
);
18
if
(!gun)
19
return
;
20
21
m_WeaponComp =
WeaponComponent
.Cast(gun.
FindComponent
(
WeaponComponent
));
22
m_CharacterComponent = CharacterControllerComponent.Cast(
m_Player
.FindComponent(CharacterControllerComponent));
23
24
if
(
IsOpticAttached
())
25
{
26
m_bFinished
=
true
;
27
return
;
28
}
29
30
PlayNarrativeCharacterStage
(
"LONGRANGESHOOTING_Instructor"
, 3);
31
}
32
33
//------------------------------------------------------------------------------------------------
34
override
void
OnVoiceoverEventFinished
(
string
eventName)
35
{
36
if
(eventName !=
"SOUND_TUTORIAL_TA_RIFLE_PICKED_UP_INSTRUCTOR_K_02"
)
37
return
;
38
39
RegisterWaypoint
(
"Course_Optic"
,
""
,
"GUNLOWER"
);
40
}
41
42
//------------------------------------------------------------------------------------------------
43
protected
bool
IsOpticAttached
()
44
{
45
if
(!m_WeaponComp)
46
return
false
;
47
48
array <AttachmentSlotComponent> attachments = {};
49
m_WeaponComp.GetAttachments(attachments);
50
51
return
attachments.IsIndexValid(0) && attachments[0].GetAttachedEntity();
52
}
53
54
//------------------------------------------------------------------------------------------------
55
override
protected
bool
GetIsFinished
()
56
{
57
bool
opticsAttached =
IsOpticAttached
();
58
59
if
(opticsAttached)
60
{
61
UnregisterWaypoint
(
"Course_Optic"
);
62
return
true
;
63
}
64
65
if
(m_CharacterComponent)
66
{
67
if
(
m_TutorialComponent
.IsEntityInPlayerInventory(
"Course_Optic"
))
68
{
69
if
(m_CharacterComponent.GetInspect())
70
ShowHint
(2);
71
else
72
ShowHint
(1);
73
}
74
}
75
76
return
false
;
77
}
78
};
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
EntityEditorProps
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
Definition
SCR_CompassComponent.c:10
ShowHint
void ShowHint()
Definition
SCR_PerceivedFactionManagerComponent.c:54
IEntity::IEntity
void IEntity(IEntitySource src, IEntity parent)
protected script Constructor
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
SCR_BaseTutorialStageClass
Definition
SCR_BaseTutorialStage.c:3
SCR_BaseTutorialStage
Definition
SCR_BaseTutorialStage.c:8
SCR_BaseTutorialStage::m_Player
ChimeraCharacter m_Player
Definition
SCR_BaseTutorialStage.c:27
SCR_BaseTutorialStage::UnregisterWaypoint
void UnregisterWaypoint(IEntity waypointEntity)
Definition
SCR_BaseTutorialStage.c:270
SCR_BaseTutorialStage::m_bFinished
bool m_bFinished
Definition
SCR_BaseTutorialStage.c:30
SCR_BaseTutorialStage::m_TutorialComponent
SCR_TutorialGamemodeComponent m_TutorialComponent
Definition
SCR_BaseTutorialStage.c:29
SCR_BaseTutorialStage::RegisterWaypoint
SCR_Waypoint RegisterWaypoint(string entityName, string title=string.Empty, string icon="MISC")
Definition
SCR_BaseTutorialStage.c:293
SCR_BaseTutorialStage::PlayNarrativeCharacterStage
void PlayNarrativeCharacterStage(string characterName, int stage)
Definition
SCR_BaseTutorialStage.c:510
SCR_Tutorial_LRS_Attach_OpticClass
Definition
SCR_Tutorial_LRS_Attach_Optic.c:3
SCR_Tutorial_LRS_Attach_Optic
Definition
SCR_Tutorial_LRS_Attach_Optic.c:8
SCR_Tutorial_LRS_Attach_Optic::GetIsFinished
bool GetIsFinished()
Definition
SCR_Tutorial_LRS_Attach_Optic.c:55
SCR_Tutorial_LRS_Attach_Optic::Setup
void Setup()
Definition
SCR_Tutorial_LRS_Attach_Optic.c:12
SCR_Tutorial_LRS_Attach_Optic::IsOpticAttached
bool IsOpticAttached()
Definition
SCR_Tutorial_LRS_Attach_Optic.c:43
SCR_Tutorial_LRS_Attach_Optic::OnVoiceoverEventFinished
override void OnVoiceoverEventFinished(string eventName)
Definition
SCR_Tutorial_LRS_Attach_Optic.c:34
WeaponComponent
Definition
WeaponComponent.c:13
scripts
Game
GameMode
Tutorial
Stages
ShootingLongRange
SCR_Tutorial_LRS_Attach_Optic.c
Generated by
1.17.0