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_FreeSpawnRequestComponent.c
Go to the documentation of this file.
1
[
ComponentEditorProps
(
category
:
"GameScripted/Respawn/PlayerController"
)]
2
class
SCR_FreeSpawnRequestComponentClass
:
SCR_SpawnRequestComponentClass
3
{
4
}
5
6
class
SCR_FreeSpawnRequestComponent : SCR_SpawnRequestComponent
7
{
8
//------------------------------------------------------------------------------------------------
9
override
typename
GetHandlerType
()
10
{
11
return
SCR_FreeSpawnHandlerComponent;
12
}
13
14
//------------------------------------------------------------------------------------------------
15
override
typename
GetDataType
()
16
{
17
return
SCR_FreeSpawnData
;
18
}
19
20
//------------------------------------------------------------------------------------------------
21
override
bool
DoCanRequestRespawn
(
SCR_SpawnData
data
)
22
{
23
#ifdef _ENABLE_RESPAWN_LOGS
24
Print
(
string
.Format(
"%1::DoCanRequestRespawn(playerId: %2, data: %3)"
,
Type
().
ToString
(),
25
GetPlayerController
().
GetPlayerId
(),
data
),
LogLevel
.NORMAL);
26
#endif
27
28
// We can construct whatever we want here on client
29
Rpc(Rpc_CanRequestRespawn_S,
data
.GetPosition(),
data
.GetAngles(),
data
.GetPrefab());
30
return
true
;
31
}
32
33
//------------------------------------------------------------------------------------------------
34
[
RplRpc
(
RplChannel
.Reliable,
RplRcver
.Server)]
35
private
void
Rpc_CanRequestRespawn_S(vector
position
, vector
angles
, ResourceName prefab)
36
{
37
#ifdef _ENABLE_RESPAWN_LOGS
38
Print
(
string
.Format(
"%1::Rpc_CanRequestRespawn_S(playerId: %2, pos: %3, ang: %4, pref: %5)"
,
Type
().
ToString
(),
39
GetPlayerController
().
GetPlayerId
(),
40
position
,
41
angles
,
42
prefab),
LogLevel
.NORMAL);
43
#endif
44
45
SCR_FreeSpawnData
data
=
new
SCR_FreeSpawnData(prefab,
position
,
angles
);
46
ProcessCanRequest_S
(
data
);
47
}
48
49
//------------------------------------------------------------------------------------------------
53
protected
override
bool
DoRequestRespawn
(
SCR_SpawnData
data
)
54
{
55
#ifdef _ENABLE_RESPAWN_LOGS
56
Print
(
string
.Format(
"%1::DoRequestRespawn(playerId: %2, data: %3)"
,
Type
().
ToString
(),
57
GetPlayerController
().
GetPlayerId
(),
data
),
LogLevel
.NORMAL);
58
#endif
59
60
// We can construct whatever we want here on client
61
Rpc(Rpc_RequestRespawn_S,
data
.GetPosition(),
data
.GetAngles(),
data
.GetPrefab());
62
return
true
;
63
}
64
65
//------------------------------------------------------------------------------------------------
66
[
RplRpc
(
RplChannel
.Reliable,
RplRcver
.Server)]
67
private
void
Rpc_RequestRespawn_S(vector
position
, vector
angles
, ResourceName prefab)
68
{
69
#ifdef _ENABLE_RESPAWN_LOGS
70
Print
(
string
.Format(
"%1::Rpc_RequestRespawn_S(playerId: %2, pos: %3, ang: %4, pref: %5)"
,
Type
().
ToString
(),
71
GetPlayerController
().
GetPlayerId
(),
72
position
,
73
angles
,
74
prefab),
LogLevel
.NORMAL);
75
#endif
76
77
SCR_FreeSpawnData
data
=
new
SCR_FreeSpawnData(prefab,
position
,
angles
);
78
ProcessRequest_S
(
data
);
79
}
80
81
#ifdef ENABLE_DIAG
82
//------------------------------------------------------------------------------------------------
83
override
SCR_BaseRespawnDiag CreateDiag()
84
{
85
return
new
SCR_FreeRespawnDiag();
86
}
87
#endif
88
}
89
90
#ifdef ENABLE_DIAG
91
class
SCR_FreeRespawnDiag : SCR_RespawnDiag<SCR_FreeSpawnRequestComponent>
92
{
93
protected
string
m_Prefab
=
"{7A9EE19AB67B298B}Prefabs/Characters/Factions/INDFOR/FIA/Character_FIA_base.et"
;
94
protected
string
m_Position
=
"0 0.1 2"
;
95
protected
string
m_Angles =
"0 180 0"
;
96
97
//------------------------------------------------------------------------------------------------
98
override
void
DrawContent()
99
{
100
super.DrawContent();
101
DbgUI.InputText(
"Prefab: "
,
m_Prefab
);
102
DbgUI.InputText(
"Position: "
,
m_Position
);
103
}
104
105
//------------------------------------------------------------------------------------------------
106
protected
override
SCR_SpawnData CreateData()
107
{
108
vector
position
=
m_Position
.ToVector();
109
vector
angles
= m_Angles.ToVector();
110
return
new
SCR_FreeSpawnData(
m_Prefab
,
position
,
angles
);
111
}
112
}
113
#endif
m_Prefab
ResourceName m_Prefab
Definition
ForestGeneratorObjects.c:45
angles
ref array< string > angles
Definition
PrefabImporter.c:22
ComponentEditorProps
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
Definition
SCR_AIGroupUtilityComponent.c:12
position
vector position
Definition
SCR_DestructibleTreeV2.c:30
data
Get all prefabs that have the spawner data
Definition
SCR_EntityCatalogManagerComponent.c:320
GetHandlerType
SCR_FreeSpawnRequestComponentClass SCR_SpawnRequestComponentClass GetHandlerType()
Definition
SCR_FreeSpawnRequestComponent.c:9
GetDataType
override GetDataType()
Definition
SCR_FreeSpawnRequestComponent.c:15
DoRequestRespawn
bool DoRequestRespawn(SCR_SpawnData data)
Definition
SCR_SpawnRequestComponent.c:334
ProcessRequest_S
void ProcessRequest_S(SCR_SpawnData data)
Definition
SCR_SpawnRequestComponent.c:344
ProcessCanRequest_S
void ProcessCanRequest_S(SCR_SpawnData data)
Definition
SCR_SpawnRequestComponent.c:211
DoCanRequestRespawn
bool DoCanRequestRespawn(SCR_SpawnData data)
Definition
SCR_SpawnRequestComponent.c:201
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
Type
int Type
Definition
ScriptCamera.c:17
SCR_FreeSpawnData
Definition
SCR_FreeSpawnData.c:3
SCR_FreeSpawnRequestComponentClass
Definition
SCR_FreeSpawnRequestComponent.c:3
SCR_SpawnData
Definition
SCR_SpawnData.c:10
SCR_SpawnRequestComponentClass
Definition
SCR_SpawnRequestComponent.c:2
Print
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
LogLevel
Enum with severity of the logging message.
Definition
LogLevel.c:14
GetPlayerController
proto external PlayerController GetPlayerController()
Definition
SCR_PlayerDeployMenuHandlerComponent.c:307
GetPlayerId
proto external int GetPlayerId()
Definition
SCR_SpawnRequestComponent.c:39
RplRpc
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
Definition
EnNetwork.c:95
RplRcver
RplRcver
Definition
RplRcver.c:59
RplChannel
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.
Definition
RplChannel.c:14
ToString
proto external string ToString()
Plain C++ pointer, no weak pointers, no memory management.
m_Position
vector m_Position
Only in XY, Z is ignored.
Definition
EnWidgets.c:81
scripts
Game
Respawn
RequestHandling
Implementation
FreeSpawn
SCR_FreeSpawnRequestComponent.c
Generated by
1.17.0