Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
TestPushUserAction.c
Go to the documentation of this file.
1
// Script File
2
class
TestPushUserAction
:
ScriptedUserAction
3
{
4
5
[
Attribute
(
"5"
,
UIWidgets
.Slider,
"Force multiplier (force is equal to mass * multiplier)"
,
"0 100 0.1"
)]
6
float
m_fForceMultiplier;
7
8
//------------------------------------------------------------------------------------------------
9
override
void
Init
(
IEntity
pOwnerEntity,
GenericComponent
pManagerComponent)
10
{
11
if
(!
GetGame
().GetWorldEntity())
12
return
;
13
}
14
15
//------------------------------------------------------------------------------------------------
16
override
void
PerformAction
(
IEntity
pOwnerEntity,
IEntity
pUserEntity)
17
{
18
Physics
physics = pOwnerEntity.
GetPhysics
();
19
if
(physics)
20
{
21
GenericEntity
genEnt =
GenericEntity
.Cast(pOwnerEntity);
22
SCR_InteractableBoxComponent boxComponent = SCR_InteractableBoxComponent.Cast(genEnt.
FindComponent
(SCR_InteractableBoxComponent));
23
if
(boxComponent)
24
{
25
boxComponent.CancelDragAction();
26
}
27
28
29
vector
userOrigin = pUserEntity.
GetOrigin
();
30
vector
thisOrigin = pOwnerEntity.
GetOrigin
();
31
vector
dir = thisOrigin-userOrigin;
32
dir.Normalize();
33
physics.ApplyImpulse(dir * physics.GetMass() * m_fForceMultiplier);
34
}
35
}
36
37
};
Init
override void Init()
Definition
CharacterCameraHandlerComponent.c:40
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
GenericComponent
Definition
GenericComponent.c:13
GenericEntity
Definition
GenericEntity.c:16
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
IEntity::GetOrigin
proto external vector GetOrigin()
IEntity::GetPhysics
proto external Physics GetPhysics()
Physics
Definition
Physics.c:22
ScriptedUserAction
Definition
ScriptedUserAction.c:13
TestPushUserAction
Definition
TestPushUserAction.c:3
UIWidgets
Definition
attributes.c:40
vector
Definition
vector.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
PerformAction
@ PerformAction
Definition
EUserActionEvent.c:15
scripts
Game
UserActions
TestPushUserAction.c
Generated by
1.17.0