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_PlayerHubAreaTriggerEnity.c
Go to the documentation of this file.
1
[
EntityEditorProps
(
category
:
"Editor"
, description:
"Trigger entity for Player Hub."
, color:
"0 0 255 255"
)]
2
class
SCR_PlayerHubAreaTriggerEntityClass
:
ScriptedGameTriggerEntityClass
3
{
4
};
5
6
//------------------------------------------------------------------------------------------------
7
class
SCR_PlayerHubAreaTriggerEntity
: ScriptedGameTriggerEntity
8
{
9
protected
int
m_iWarningTimerDuration
= 5;
10
11
//Todo: Kill and trigger only works on server side and doesn't properly check if the entity that left the trigger was the player!
12
//======================== TIMER COMPLETED/CANCELED ========================\\
13
void TimerDone(IEntity playerToKill, bool canceled = false)
14
{
15
if
(!canceled)
16
{
17
GenericEntity
genericEntity =
GenericEntity
.Cast(playerToKill);
18
if
(genericEntity)
19
{
20
SCR_CharacterControllerComponent
characterController =
SCR_CharacterControllerComponent
.Cast(genericEntity.
FindComponent
(
SCR_CharacterControllerComponent
));
21
if
(characterController)
22
characterController.ForceDeath();
23
}
24
}
25
}
26
27
28
29
30
//****************//
31
//OVERRIDE METHODS//
32
//****************//
33
34
//------------------------------------------------------------------------------------------------
36
override
void
OnActivate
(
IEntity
ent)
37
{
38
//Always canceles timer no matter which hub is entered
39
SCR_PlayerHubWarningEditorUIComponent
.
CancelWarningTimer
(
this
);
40
}
41
43
override
void
OnDeactivate
(
IEntity
ent)
44
{
45
//Always start timer if leaving hub (Todo: Breaks if trigger in hub overlaps)
46
SCR_PlayerHubWarningEditorUIComponent.SetWarningTimer(
m_iWarningTimerDuration
,
this
, ent);
47
}
48
49
50
51
//************************//
52
//CONSTRUCTOR / DESTRUCTOR//
53
//************************//
54
55
//------------------------------------------------------------------------------------------------
56
void
SCR_PlayerHubAreaTriggerEntity(IEntitySource src,
IEntity
parent)
57
{
58
//SetEventMask(EntityEvent.INIT);
59
}
60
61
//------------------------------------------------------------------------------------------------
62
void
~SCR_PlayerHubAreaTriggerEntity()
63
{
64
//Canceles timer (If current timer is from this hub)
65
SCR_PlayerHubWarningEditorUIComponent.CancelWarningTimer(
this
,
true
);
66
}
67
68
};
OnDeactivate
override void OnDeactivate()
Definition
SCR_CharacterCommandLoiter.c:75
OnActivate
override void OnActivate()
Definition
SCR_CharacterCommandLoiter.c:31
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
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
IEntity
enum EVehicleType IEntity
GenericEntity
Definition
GenericEntity.c:16
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
SCR_CharacterControllerComponent
Definition
SCR_CharacterControllerComponent.c:36
SCR_PlayerHubAreaTriggerEntityClass
Definition
SCR_PlayerHubAreaTriggerEnity.c:3
SCR_PlayerHubAreaTriggerEntity
Definition
SCR_PlayerHubAreaTriggerEnity.c:8
SCR_PlayerHubAreaTriggerEntity::m_iWarningTimerDuration
int m_iWarningTimerDuration
Definition
SCR_PlayerHubAreaTriggerEnity.c:9
SCR_PlayerHubWarningEditorUIComponent
Definition
SCR_PlayerHubWarningEditorUIComponent.c:2
SCR_PlayerHubWarningEditorUIComponent::CancelWarningTimer
static void CancelWarningTimer(SCR_PlayerHubAreaTriggerEntity hub, bool hubDestroyed=false)
Definition
SCR_PlayerHubWarningEditorUIComponent.c:85
ScriptedGameTriggerEntityClass
Definition
ScriptedGameTriggerEntity.c:13
scripts
Game
Editor
Entities
SCR_PlayerHubAreaTriggerEnity.c
Generated by
1.17.0