Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
DebugRocketTraces.c
Go to the documentation of this file.
1
// Script File
2
3
class
SCR_DebugShootComponentClass
:
DebugShootComponentClass
4
{
5
};
6
7
class
SCR_DebugShootComponent
: DebugShootComponent
8
{
9
[
Attribute
(
"{609E216CBF8D0B68}Prefabs/Weapons/Ammo/Ammo_Rocket_PG7VL.et"
,
UIWidgets
.ResourceNamePicker,
"Rocket"
,
"et"
)]
10
ResourceName
m_rocketResource;
11
12
InputManager
m_InputManager;
13
IEntity
m_owner;
14
15
override
void
OnPostInit
(
IEntity
owner)
16
{
17
18
owner.
SetFlags
(
EntityFlags
.ACTIVE,
false
);
19
SetEventMask(owner,
EntityEvent
.FRAME);
20
int
mask = GetEventMask();
21
m_InputManager =
GetGame
().GetInputManager();
22
m_InputManager.AddActionListener(
"MouseLeft"
,
EActionTrigger
.DOWN, CallbackFunc);
23
m_owner = owner;
24
}
25
26
27
void
CallbackFunc()
28
{
29
Resource
prefab =
Resource
.Load(m_rocketResource);
30
31
ChimeraGame
game
=
GetGame
();
32
33
CameraManager cameraManager =
GetGame
().GetCameraManager();
34
if
(!cameraManager)
35
return
;
36
37
CameraBase camera = cameraManager.CurrentCamera();
38
if
(!camera)
39
return
;
40
41
IEntity
rocket =
GetGame
().SpawnEntityPrefab(prefab,
game
.GetWorld());
42
43
//transform the rocket
44
45
vector
rot[4];
46
camera.GetWorldTransform(rot);
47
rot[3] =
vector
.Zero;
48
49
vector
forward =
vector
.Forward;
50
forward = forward.Multiply3(rot);
51
52
vector
mat[4];
53
camera.GetWorldTransform(mat);
54
mat[3] = mat[3] + forward;
55
56
rocket.
SetWorldTransform
(mat);
57
58
Fire
(forward, mat, rocket, m_owner);
59
60
}
61
62
void
Cleanup
()
63
{
64
m_InputManager.RemoveActionListener(
"MouseLeft"
,
EActionTrigger
.DOWN, CallbackFunc);
65
}
66
};
game
ref DSGameConfig game
Definition
DSConfig.c:81
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
Cleanup
void Cleanup()
Cleanup component.
Definition
SCR_VONController.c:854
ChimeraGame
Definition
ChimeraGame.c:8
DebugShootComponentClass
Definition
DebugShootComponent.c:13
IEntity
Definition
IEntity.c:13
IEntity::SetFlags
proto external EntityFlags SetFlags(EntityFlags flags, bool recursively=false)
IEntity::SetWorldTransform
proto external bool SetWorldTransform(vector mat[4])
See IEntity::SetTransform. Returns false, if there is no change in transformation.
InputManager
Input management system for user interactions.
Definition
InputManager.c:20
Resource
Object holding reference to resource. In destructor release the resource.
Definition
Resource.c:25
ResourceName
Definition
ResourceName.c:13
SCR_DebugShootComponentClass
Definition
DebugRocketTraces.c:4
SCR_DebugShootComponent
Definition
DebugRocketTraces.c:8
UIWidgets
Definition
attributes.c:40
vector
Definition
vector.c:13
Fire
DebugShootComponentClass ScriptComponentClass Fire(vector dir, vector mat[], IEntity projectile, IEntity owner)
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
EntityEvent
EntityEvent
Various entity events.
Definition
EntityEvent.c:14
EntityFlags
EntityFlags
Various entity flags.
Definition
EntityFlags.c:14
EActionTrigger
EActionTrigger
Definition
EActionTrigger.c:13
OnPostInit
@ OnPostInit
Definition
SndComponentCallbacks.c:15
scripts
GameCode
Character
DebugRocketTraces.c
Generated by
1.17.0