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_TutorialLogic_FreeRoam.c
Go to the documentation of this file.
1
[
BaseContainerProps
()]
2
class
SCR_TutorialLogic_FreeRoam
:
SCR_BaseTutorialCourseLogic
3
{
4
protected
const
int
FAST_TRAVEL_SIGN_DISTANCE
= 25;
5
//------------------------------------------------------------------------------------------------
6
void
SetUpAmbulance
()
7
{
8
IEntity
ambulance =
GetGame
().
GetWorld
().FindEntityByName(
"RespawnAmbulance"
);
9
if
(!ambulance)
10
return
;
11
12
SCR_VehicleSpawnProtectionComponent protectionComp = SCR_VehicleSpawnProtectionComponent.Cast(ambulance.
FindComponent
(SCR_VehicleSpawnProtectionComponent));
13
if
(protectionComp)
14
{
15
protectionComp.SetProtectOnlyDriverSeat(
true
);
16
protectionComp.SetVehicleOwner(-2);
17
}
18
19
IEntity
soldier =
GetGame
().
GetWorld
().FindEntityByName(
"Ambulance_Doctor"
);
20
if
(!soldier)
21
return
;
22
23
BaseCompartmentSlot
doctorCompartment;
24
SCR_BaseCompartmentManagerComponent compartmentMan = SCR_BaseCompartmentManagerComponent.Cast(ambulance.
FindComponent
(SCR_BaseCompartmentManagerComponent));
25
if
(compartmentMan)
26
{
27
array <BaseCompartmentSlot> compartments = {};
28
compartmentMan.GetCompartments(compartments);
29
foreach
(
BaseCompartmentSlot
compartment : compartments)
30
{
31
if
(compartment.Type() ==
SCR_DoctorCompartmentSlot
)
32
doctorCompartment = compartment;
33
}
34
}
35
36
SCR_CompartmentAccessComponent
compartmentAccess =
SCR_CompartmentAccessComponent
.Cast(soldier.
FindComponent
(
SCR_CompartmentAccessComponent
));
37
if
(!compartmentAccess)
38
return
;
39
40
//compartmentAccess.OpenDoor(ambulance, ECharacterDoorAnimType.INVALID, 4);
41
compartmentAccess.GetInVehicle(ambulance, doctorCompartment,
true
, 4,
ECloseDoorAfterActions
.LEAVE_OPEN,
true
);
42
GetGame
().GetCallqueue().CallLater(compartmentAccess.OpenDoor, 1000,
false
, ambulance,
ECharacterDoorAnimType
.INVALID, 4);
43
44
SCR_NarrativeComponent narrativeComponent = SCR_NarrativeComponent.Cast(soldier.
FindComponent
(SCR_NarrativeComponent));
45
46
if
(!SCR_NarrativeComponent)
47
return
;
48
49
narrativeComponent.Initialize(soldier);
50
}
51
52
//------------------------------------------------------------------------------------------------
53
void
PrepareFastTravelSigns
()
54
{
55
SCR_TutorialGamemodeComponent tutorial = SCR_TutorialGamemodeComponent.GetInstance();
56
if
(!tutorial)
57
return
;
58
59
SCR_BaseTutorialStage
stage = tutorial.GetCurrentStage();
60
if
(!stage)
61
return
;
62
63
IEntity
ent =
GetGame
().
GetWorld
().FindEntityByName(
"FastTravel_Signs"
);
64
if
(!ent)
65
return
;
66
67
SCR_Waypoint
wp;
68
ent = ent.
GetChildren
();
69
while
(ent)
70
{
71
wp = stage.
RegisterWaypoint
(ent,
""
,
"SERPENTINE"
);
72
if
(wp)
73
{
74
wp.
EnableFading
(
true
);
75
wp.
m_iMaximumDrawDistance
=
FAST_TRAVEL_SIGN_DISTANCE
;
76
wp.
SetOffsetVector
(
"0 2.5 0"
);
77
}
78
79
ent = ent.
GetSibling
();
80
}
81
}
82
83
//------------------------------------------------------------------------------------------------
84
void
PrepareHelicopter
()
85
{
86
SCR_TutorialGamemodeComponent tutorial = SCR_TutorialGamemodeComponent.GetInstance();
87
if
(!tutorial)
88
return
;
89
90
IEntity
spawnPos =
GetGame
().
GetWorld
().FindEntityByName(
"SpawnPos_UH1COURSE"
);
91
if
(!spawnPos)
92
return
;
93
94
SCR_VehicleDamageManagerComponent
damageManager;
95
96
IEntity
helicopter =
GetGame
().
GetWorld
().FindEntityByName(
"UH1COURSE"
);
97
if
(!helicopter)
98
{
99
tutorial.SpawnAsset(
"UH1COURSE"
,
"{70BAEEFC2D3FEE64}Prefabs/Vehicles/Helicopters/UH1H/UH1H.et"
, spawnPos);
100
return
;
101
}
102
103
104
if
(
vector
.Distance(helicopter.
GetOrigin
(), spawnPos.
GetOrigin
()) > 11 ||
IsHelicopterDamaged
())
105
tutorial.SpawnAsset(
"UH1COURSE"
,
"{70BAEEFC2D3FEE64}Prefabs/Vehicles/Helicopters/UH1H/UH1H.et"
, spawnPos);
106
}
107
108
//------------------------------------------------------------------------------------------------
109
protected
bool
IsHelicopterDamaged
()
110
{
111
Vehicle
helicopter =
Vehicle
.Cast(
GetGame
().GetWorld().FindEntityByName(
"UH1COURSE"
));
112
if
(!helicopter)
113
return
true
;
114
115
SCR_DamageManagerComponent damageManager = helicopter.GetDamageManager();
116
if
(damageManager && damageManager.GetState() !=
EDamageState
.UNDAMAGED)
117
return
true
;
118
119
SlotManagerComponent slotManager = SlotManagerComponent.Cast(helicopter.FindComponent(SlotManagerComponent));
120
if
(!slotManager)
121
return
false
;
122
123
IEntity
rotor;
124
SCR_RotorDamageManagerComponent rotorDmgComp;
125
EntitySlotInfo
slot = slotManager.GetSlotByName(
"RotorMain"
);
126
if
(slot)
127
{
128
rotor = slot.GetAttachedEntity();
129
rotorDmgComp = SCR_RotorDamageManagerComponent.Cast(rotor.
FindComponent
(SCR_RotorDamageManagerComponent));
130
if
(rotorDmgComp && rotorDmgComp.GetState() !=
EDamageState
.UNDAMAGED)
131
return
true
;
132
}
133
134
slot = slotManager.GetSlotByName(
"RotorTail"
);
135
if
(slot)
136
{
137
rotor = slot.GetAttachedEntity();
138
rotorDmgComp = SCR_RotorDamageManagerComponent.Cast(rotor.
FindComponent
(SCR_RotorDamageManagerComponent));
139
if
(rotorDmgComp && rotorDmgComp.GetState() !=
EDamageState
.UNDAMAGED)
140
return
true
;
141
}
142
143
return
false
;
144
}
145
146
//------------------------------------------------------------------------------------------------
147
void
PrepareDrivingCourseInstructor
()
148
{
149
SCR_TutorialGamemodeComponent tutorial = SCR_TutorialGamemodeComponent.GetInstance();
150
if
(!tutorial)
151
return
;
152
153
IEntity
spawnPos =
GetGame
().
GetWorld
().FindEntityByName(
"SpawnPos_SmallJeep"
);
154
155
IEntity
car = tutorial.SpawnAsset(
"SmallJeep"
,
"{94DE32169691AC34}Prefabs/Vehicles/Wheeled/M151A2/M151A2_transport_MERDC.et"
, spawnPos);
156
157
IEntity
instructor = tutorial.SpawnAsset(
"DRIVING_Copilot"
,
"{F9C424E7C6598A7E}Prefabs/Characters/Tutorial/Instructors/Driving_Instructor_Copilot.et"
, spawnPos);
158
159
if
(!instructor || !car)
160
return
;
161
162
/*tutorial.ChangeVehicleLockState(car, true);
163
164
SCR_VehicleSpawnProtectionComponent comp = SCR_VehicleSpawnProtectionComponent.Cast(car.FindComponent(SCR_VehicleSpawnProtectionComponent));
165
166
if (comp)
167
comp.SetReasonText("#AR-Tutorial_Action_Instructor");*/
168
169
SCR_CompartmentAccessComponent
compAccess =
SCR_CompartmentAccessComponent
.Cast(instructor.
FindComponent
(
SCR_CompartmentAccessComponent
));
170
if
(compAccess)
171
compAccess.
MoveInVehicle
(car,
ECompartmentType
.CARGO);
172
}
173
}
ECompartmentType
ECompartmentType
Definition
ECompartmentType.c:8
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
SCR_VehicleDamageManagerComponent
void SCR_VehicleDamageManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition
SCR_VehicleDamageManagerComponent.c:2166
BaseCompartmentSlot
Definition
BaseCompartmentSlot.c:2
EntitySlotInfo
Adds ability to attach an object to a slot.
Definition
EntitySlotInfo.c:9
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
IEntity::GetOrigin
proto external vector GetOrigin()
IEntity::GetChildren
proto external IEntity GetChildren()
IEntity::GetWorld
proto external BaseWorld GetWorld()
IEntity::GetSibling
proto external IEntity GetSibling()
SCR_BaseTutorialCourseLogic
Definition
SCR_BaseTutorialCourseLogic.c:3
SCR_BaseTutorialStage
Definition
SCR_BaseTutorialStage.c:8
SCR_BaseTutorialStage::RegisterWaypoint
SCR_Waypoint RegisterWaypoint(string entityName, string title=string.Empty, string icon="MISC")
Definition
SCR_BaseTutorialStage.c:293
SCR_CompartmentAccessComponent
Definition
SCR_CompartmentAccessComponent.c:16
SCR_CompartmentAccessComponent::MoveInVehicle
bool MoveInVehicle(IEntity vehicle, ECompartmentType compartmentType, bool performWhenPaused=false, BaseCompartmentSlot customSlot=null)
Definition
SCR_CompartmentAccessComponent.c:257
SCR_DoctorCompartmentSlot
Definition
SCR_DoctorCompartmentSlot.c:2
SCR_TutorialLogic_FreeRoam
Definition
SCR_TutorialLogic_FreeRoam.c:3
SCR_TutorialLogic_FreeRoam::PrepareDrivingCourseInstructor
void PrepareDrivingCourseInstructor()
Definition
SCR_TutorialLogic_FreeRoam.c:147
SCR_TutorialLogic_FreeRoam::FAST_TRAVEL_SIGN_DISTANCE
const int FAST_TRAVEL_SIGN_DISTANCE
Definition
SCR_TutorialLogic_FreeRoam.c:4
SCR_TutorialLogic_FreeRoam::SetUpAmbulance
void SetUpAmbulance()
Definition
SCR_TutorialLogic_FreeRoam.c:6
SCR_TutorialLogic_FreeRoam::IsHelicopterDamaged
bool IsHelicopterDamaged()
Definition
SCR_TutorialLogic_FreeRoam.c:109
SCR_TutorialLogic_FreeRoam::PrepareHelicopter
void PrepareHelicopter()
Definition
SCR_TutorialLogic_FreeRoam.c:84
SCR_TutorialLogic_FreeRoam::PrepareFastTravelSigns
void PrepareFastTravelSigns()
Definition
SCR_TutorialLogic_FreeRoam.c:53
SCR_Waypoint
Definition
SCR_Waypoint.c:3
SCR_Waypoint::m_iMaximumDrawDistance
int m_iMaximumDrawDistance
Definition
SCR_Waypoint.c:16
SCR_Waypoint::EnableFading
void EnableFading(bool enable)
Definition
SCR_Waypoint.c:32
SCR_Waypoint::SetOffsetVector
void SetOffsetVector(vector offset)
Definition
SCR_Waypoint.c:56
vector
Definition
vector.c:13
Vehicle
enum EPhysicsLayerPresets Vehicle
Definition
gameLib.c:24
EDamageState
EDamageState
Definition
EDamageState.c:13
ECharacterDoorAnimType
ECharacterDoorAnimType
Definition
ECharacterDoorAnimType.c:13
ECloseDoorAfterActions
ECloseDoorAfterActions
Definition
ECloseDoorAfterActions.c:13
scripts
Game
GameMode
Tutorial
Stages
Hub
SCR_TutorialLogic_FreeRoam.c
Generated by
1.17.0