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_RadioVehicleSpawnPointComponent.c
Go to the documentation of this file.
1
[
EntityEditorProps
(
category
:
"GameScripted/GameMode"
, description:
"Spawn point entity"
, visible:
false
)]
2
class
SCR_RadioVehicleSpawnPointClass
:
SCR_SpawnPointClass
3
{
4
}
5
6
class
SCR_RadioVehicleSpawnPoint :
SCR_SpawnPoint
7
{
8
protected
SCR_PlayerSpawnPointManagerComponent
m_PlayerSpawnPointManager
;
9
protected
Vehicle
m_PhysicsVehicle
;
10
11
//------------------------------------------------------------------------------------------------
12
override
void
EOnInit
(
IEntity
owner)
13
{
14
super.EOnInit(owner);
15
16
BaseGameMode gameMode =
GetGame
().GetGameMode();
17
if
(gameMode)
18
m_PlayerSpawnPointManager
=
SCR_PlayerSpawnPointManagerComponent
.Cast(gameMode.FindComponent(
SCR_PlayerSpawnPointManagerComponent
));
19
20
IEntity
parent = owner.
GetParent
();
21
while
(parent)
22
{
23
if
(
Vehicle
.Cast(parent))
24
{
25
m_PhysicsVehicle
=
Vehicle
.Cast(parent);
26
break
;
27
}
28
29
parent = parent.
GetParent
();
30
}
31
}
32
33
//------------------------------------------------------------------------------------------------
34
override
bool
IsSpawnPointEnabled
()
35
{
36
return
m_bSpawnPointEnabled && (!
m_PlayerSpawnPointManager
||
m_PlayerSpawnPointManager
.IsRadioVehicleSpawningEnabled());
37
}
38
39
//------------------------------------------------------------------------------------------------
40
override
bool
CanReserveFor_S
(
int
playerId, out
SCR_ESpawnResult
result =
SCR_ESpawnResult
.SPAWN_NOT_ALLOWED)
41
{
42
if
(!super.CanReserveFor_S(playerId, result))
43
{
44
if
(
m_PlayerSpawnPointManager
&& !
m_PlayerSpawnPointManager
.IsRadioVehicleSpawningEnabled())
45
result =
SCR_ESpawnResult
.NOT_ALLOWED_RADIO_VEHICLE_SPAWNING_DISABLED;
46
47
return
false
;
48
}
49
50
//~ Vehicle is moving
51
if
(
m_PhysicsVehicle
)
52
{
53
Physics
physics =
m_PhysicsVehicle
.GetPhysics();
54
if
(physics && (physics.GetVelocity() !=
vector
.Zero || physics.GetAngularVelocity() !=
vector
.Zero))
55
{
56
result =
SCR_ESpawnResult
.NOT_ALLOWED_VEHICLE_MOVING;
57
return
false
;
58
}
59
}
60
61
62
//~ Check if occupied
63
if
(
m_FactionAffiliationComponent
)
64
{
65
Faction
defaultFaction =
m_FactionAffiliationComponent
.GetDefaultAffiliatedFaction();
66
Faction
currentFaction =
m_FactionAffiliationComponent
.GetAffiliatedFaction();
67
68
if
(!currentFaction)
69
return
true
;
70
71
if
(defaultFaction != currentFaction)
72
{
73
SCR_Faction
scrDefaultFaction =
SCR_Faction
.Cast(defaultFaction);
74
75
if
(!scrDefaultFaction || !scrDefaultFaction.IsFactionFriendly(currentFaction))
76
{
77
result =
SCR_ESpawnResult
.NOT_ALLOWED_SPAWNPOINT_OCCUPIED_BY_HOSTILE;
78
return
false
;
79
}
80
}
81
}
82
83
return
true
;
84
}
85
86
//------------------------------------------------------------------------------------------------
87
protected
override
void
InitFactionAffiliation
(
IEntity
owner)
88
{
89
IEntity
parent = owner.
GetParent
();
90
while
(parent && !
m_FactionAffiliationComponent
)
91
{
92
m_FactionAffiliationComponent
=
SCR_FactionAffiliationComponent
.Cast(parent.
FindComponent
(
SCR_FactionAffiliationComponent
));
93
if
(!
m_FactionAffiliationComponent
)
94
parent = parent.
GetParent
();
95
}
96
97
if
(!
m_FactionAffiliationComponent
)
98
m_FactionAffiliationComponent
=
SCR_FactionAffiliationComponent
.Cast(owner.
FindComponent
(
SCR_FactionAffiliationComponent
));
99
100
if
(
m_FactionAffiliationComponent
)
101
{
102
Faction
faction =
m_FactionAffiliationComponent
.GetDefaultAffiliatedFaction();
103
if
(faction)
104
m_sFaction
= faction.GetFactionKey();
105
}
106
}
107
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
m_sFaction
string m_sFaction
Definition
SCR_AnalyticsDataCollectionTransferSuppliesModule.c:19
m_FactionAffiliationComponent
FactionAffiliationComponent m_FactionAffiliationComponent
Definition
SCR_BaseSupportStationComponent.c:135
m_PhysicsVehicle
Vehicle m_PhysicsVehicle
Definition
SCR_BaseSupportStationComponent.c:133
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
SCR_ESpawnResult
SCR_ESpawnResult
Definition
SCR_ESpawnResult.c:9
m_PlayerSpawnPointManager
SCR_RadioVehicleSpawnPointClass m_PlayerSpawnPointManager
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
Faction
Definition
Faction.c:13
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
IEntity::GetParent
proto external IEntity GetParent()
Physics
Definition
Physics.c:22
SCR_FactionAffiliationComponent
Definition
SCR_FactionAffiliationComponent.c:11
SCR_Faction
Definition
SCR_Faction.c:6
SCR_PlayerSpawnPointManagerComponent
Definition
SCR_PlayerSpawnPointManagerComponent.c:11
SCR_RadioVehicleSpawnPointClass
Definition
SCR_RadioVehicleSpawnPointComponent.c:3
SCR_SpawnPointClass
Definition
SCR_SpawnPoint.c:3
SCR_SpawnPoint
Spawn point entity defines positions on which players can possibly spawn.
Definition
SCR_SpawnPoint.c:28
SCR_SpawnPoint::InitFactionAffiliation
void InitFactionAffiliation(IEntity owner)
Definition
SCR_SpawnPoint.c:789
SCR_SpawnPoint::CanReserveFor_S
bool CanReserveFor_S(int playerId, out SCR_ESpawnResult result=SCR_ESpawnResult.SPAWN_NOT_ALLOWED)
Definition
SCR_SpawnPoint.c:191
SCR_SpawnPoint::IsSpawnPointEnabled
bool IsSpawnPointEnabled()
Definition
SCR_SpawnPoint.c:111
vector
Definition
vector.c:13
Vehicle
enum EPhysicsLayerPresets Vehicle
Definition
gameLib.c:24
EOnInit
override void EOnInit(IEntity owner)
Definition
SCR_AIConfigComponent.c:87
scripts
Game
GameMode
Respawn
SCR_RadioVehicleSpawnPointComponent.c
Generated by
1.17.0