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_HelicopterCinematicFlyComponent.c
Go to the documentation of this file.
1
[
ComponentEditorProps
(
category
:
"GameScripted/Component"
, description:
""
)]
2
class
SCR_HelicopterCinematicFlyComponentClass
:
ScriptComponentClass
3
{
4
}
5
6
class
SCR_HelicopterCinematicFlyComponent :
ScriptComponent
7
{
8
[
Attribute
(defvalue:
"2"
,
desc
:
"A force multiplier used on a helicopter."
)]
9
float
m_fForceMultiplier;
10
11
[
Attribute
(defvalue:
"10"
,
desc
:
"A force multiplier used on a helicopter with it's initial kick to keep the direction."
)]
12
float
m_fInitialForceMultiplier;
13
14
[
Attribute
(defvalue:
"2000"
,
desc
:
"Delay (ms) between two pulses."
)]
15
int
m_iPulseDelay;
16
17
DamageManagerComponent
m_DamageManager
;
18
19
//------------------------------------------------------------------------------------------------
20
override
void
EOnInit
(
IEntity
owner)
21
{
22
m_DamageManager
=
DamageManagerComponent
.Cast(
GetOwner
().
FindComponent
(
DamageManagerComponent
));
23
24
VehicleHelicopterSimulation
vehicleSimulation =
VehicleHelicopterSimulation
.Cast(
GetOwner
().
FindComponent
(
VehicleHelicopterSimulation
));
25
vehicleSimulation.EngineStart();
26
vehicleSimulation.SetThrottle(1);
27
vehicleSimulation.RotorSetForceScaleState(0, 2);
28
vehicleSimulation.RotorSetForceScaleState(1, 1);
29
30
Kick
(
true
);
31
32
GetGame
().GetCallqueue().CallLater(
Kick
, m_iPulseDelay,
true
, 0);
33
}
34
35
//------------------------------------------------------------------------------------------------
36
override
void
OnPostInit
(
IEntity
owner)
37
{
38
SetEventMask
(owner,
EntityEvent
.INIT);
39
}
40
41
//------------------------------------------------------------------------------------------------
42
void
Kick
(
bool
initialKick =
false
)
43
{
44
if
(
m_DamageManager
.IsDestroyed())
45
{
46
GetGame
().GetCallqueue().Remove(
Kick
);
47
return
;
48
}
49
50
float
forceMultiplier;
51
52
if
(initialKick)
53
forceMultiplier = m_fForceMultiplier * m_fInitialForceMultiplier;
54
else
55
forceMultiplier = m_fForceMultiplier;
56
57
vector
velOrig =
GetOwner
().
GetPhysics
().GetVelocity();
58
vector
rotVector =
GetOwner
().
GetAngles
();
59
vector
vel = {velOrig[0] +
Math
.Sin(rotVector[1] *
Math
.DEG2RAD) * forceMultiplier, velOrig[1], velOrig[2] +
Math
.Cos(rotVector[1] *
Math
.DEG2RAD) * forceMultiplier };
60
GetOwner
().
GetPhysics
().SetVelocity(vel);
61
}
62
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
ComponentEditorProps
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
Definition
SCR_AIGroupUtilityComponent.c:12
m_DamageManager
DamageManagerComponent m_DamageManager
Definition
SCR_AITargetInfo.c:19
Kick
void Kick(bool initialKick=false)
Definition
SCR_HelicopterCinematicFlyComponent.c:42
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
DamageManagerComponent
Definition
DamageManagerComponent.c:13
GenericComponent::SetEventMask
proto external int SetEventMask(notnull IEntity owner, int mask)
GenericComponent::FindComponent
proto external GenericComponent FindComponent(typename typeName)
IEntity
Definition
IEntity.c:13
IEntity::GetAngles
proto external vector GetAngles()
Same as GetYawPitchRoll(), but returns rotation vector around X, Y and Z axis.
IEntity::GetPhysics
proto external Physics GetPhysics()
Math
Definition
Math.c:13
SCR_HelicopterCinematicFlyComponentClass
Definition
SCR_HelicopterCinematicFlyComponent.c:3
ScriptComponentClass
Definition
ScriptComponentClass.c:8
ScriptComponent
Definition
ScriptComponent.c:24
ScriptComponent::GetOwner
proto external GenericEntity GetOwner()
Get owner entity.
ScriptComponent::EOnInit
void EOnInit(IEntity owner)
VehicleHelicopterSimulation
Definition
VehicleHelicopterSimulation.c:13
vector
Definition
vector.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
EntityEvent
EntityEvent
Various entity events.
Definition
EntityEvent.c:14
OnPostInit
@ OnPostInit
Definition
SndComponentCallbacks.c:15
scripts
Game
Components
SCR_HelicopterCinematicFlyComponent.c
Generated by
1.17.0