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_Obstace_TIME.c
Go to the documentation of this file.
1
[
EntityEditorProps
(insertable:
false
)]
2
class
SCR_Tutorial_Obstacle_TIMEClass
:
SCR_BaseTutorialStageClass
3
{
4
};
5
6
//------------------------------------------------------------------------------------------------
7
class
SCR_Tutorial_Obstacle_TIME
:
SCR_BaseTutorialStage
8
{
9
vector
m_vInstructorPos;
10
//------------------------------------------------------------------------------------------------
11
override
protected
void
Setup
()
12
{
13
ChimeraWorld
world =
GetGame
().GetWorld();
14
if
(world)
15
world.GetMusicManager().Stop(
"SOUND_OBSTACLE_COURSE"
);
16
17
float
finalTime =
m_TutorialComponent
.GetTimeElapsed();
18
19
string
time;
20
21
int
hour;
22
int
minute;
23
int
second;
24
25
SCR_DateTimeHelper
.GetHourMinuteSecondFromSeconds(finalTime, hour, minute, second);
26
27
string
buffer;
28
29
if
(hour > 0)
30
{
31
buffer = hour.ToString();
32
time += buffer +
":"
;
33
}
34
35
buffer = minute.ToString();
36
37
if
(minute > 0 && minute < 10)
38
time +=
"0"
;
39
40
time += buffer +
":"
;
41
42
buffer = second.ToString();
43
44
if
(second < 10)
45
time +=
"0"
;
46
47
time += buffer +
":"
;
48
49
int
ms = ((finalTime -
Math
.Floor(finalTime)) * 1000);
50
buffer = ms.ToString();
51
52
if
(ms < 10)
53
time +=
"00"
;
54
else
if
(ms < 100)
55
time +=
"0"
;
56
57
time += buffer;
58
59
SCR_HintUIInfo
info =
m_StageInfo
.GetHint();
60
61
if
(!info)
62
return
;
63
64
LocalizedString
stringToEdit = info.GetDescription();
65
66
if
(!stringToEdit)
67
return
;
68
69
stringToEdit = stringToEdit +
" "
+ time;
70
71
SCR_HintUIInfo
hintInfo =
SCR_HintUIInfo
.
CreateInfo
(stringToEdit,
string
.Empty, -1,
EHint
.UNDEFINED,
EFieldManualEntryId
.NONE,
false
);
72
hintInfo.
SetPriority
(1);
73
SCR_HintManagerComponent.ShowHint(hintInfo);
74
75
if
(finalTime < 73)
76
PlayNarrativeCharacterStage
(
"OBSTACLECOURSE_Instructor"
, 17);
// Good
77
else
if
(finalTime < 77)
78
PlayNarrativeCharacterStage
(
"OBSTACLECOURSE_Instructor"
, 16);
// Average
79
else
80
PlayNarrativeCharacterStage
(
"OBSTACLECOURSE_Instructor"
, 18);
// Bad
81
82
IEntity
ent =
GetGame
().GetWorld().FindEntityByName(
"SpawnPos_OBSTACLECOURSE_Instructor"
);
83
if
(ent)
84
m_vInstructorPos = ent.
GetOrigin
();
85
}
86
87
//------------------------------------------------------------------------------------------------
88
override
bool
GetIsFinished
()
89
{
90
if
(
vector
.Distance(m_vInstructorPos,
m_Player
.GetOrigin()) > 40)
91
return
true
;
92
93
return
m_sLastFinishedEvent
==
"SOUND_TUTORIAL_EVE_END_COURSE_INSTRUCTOR_A_02"
||
GetDuration
() > 25000;
94
}
95
};
EFieldManualEntryId
EFieldManualEntryId
used to grab the first id-matching Field Manual entry
Definition
EFieldManualEntryId.c:3
EHint
EHint
Definition
EHint.c:11
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
ChimeraWorld
Definition
ChimeraWorld.c:13
IEntity::IEntity
void IEntity(IEntitySource src, IEntity parent)
protected script Constructor
IEntity::GetOrigin
proto external vector GetOrigin()
LocalizedString
Definition
LocalizedString.c:22
Math
Definition
Math.c:13
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::m_StageInfo
SCR_TutorialStageInfo m_StageInfo
Definition
SCR_BaseTutorialStage.c:32
SCR_BaseTutorialStage::m_sLastFinishedEvent
string m_sLastFinishedEvent
Definition
SCR_BaseTutorialStage.c:21
SCR_BaseTutorialStage::GetDuration
float GetDuration()
Definition
SCR_BaseTutorialStage.c:42
SCR_BaseTutorialStage::m_TutorialComponent
SCR_TutorialGamemodeComponent m_TutorialComponent
Definition
SCR_BaseTutorialStage.c:29
SCR_BaseTutorialStage::PlayNarrativeCharacterStage
void PlayNarrativeCharacterStage(string characterName, int stage)
Definition
SCR_BaseTutorialStage.c:510
SCR_DateTimeHelper
Definition
SCR_DateTimeHelper.c:2
SCR_HintUIInfo
Definition
SCR_HintUIInfo.c:3
SCR_HintUIInfo::CreateInfo
static SCR_HintUIInfo CreateInfo(string description, string name, float duration, EHint type, EFieldManualEntryId fieldManualEntry, bool isTimerVisible)
Definition
SCR_HintUIInfo.c:204
SCR_HintUIInfo::SetPriority
void SetPriority(int priority)
Definition
SCR_HintUIInfo.c:95
SCR_Tutorial_Obstacle_TIMEClass
Definition
SCR_Tutorial_Obstace_TIME.c:3
SCR_Tutorial_Obstacle_TIME
Definition
SCR_Tutorial_Obstace_TIME.c:8
SCR_Tutorial_Obstacle_TIME::Setup
void Setup()
Definition
SCR_Tutorial_Obstace_TIME.c:11
SCR_Tutorial_Obstacle_TIME::GetIsFinished
override bool GetIsFinished()
Definition
SCR_Tutorial_Obstace_TIME.c:88
vector
Definition
vector.c:13
scripts
Game
GameMode
Tutorial
Stages
Movement
SCR_Tutorial_Obstace_TIME.c
Generated by
1.17.0