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_AdditionalDeployablePart.c
Go to the documentation of this file.
1
class
SCR_AdditionalDeployablePart
:
ScriptAndConfig
2
{
3
[
Attribute
(uiwidget:
UIWidgets
.ResourcePickerThumbnail,
desc
:
"Prefab which is going to be required in order to deploy the main entity"
,
params
:
"et"
)]
4
protected
ResourceName
m_sPrefab
;
5
6
[
Attribute
(defvalue:
"1"
,
desc
:
"How many instances of this prefab should be spawned"
,
params
:
"1 inf"
)]
7
protected
int
m_iNumberOfPrefabs
;
8
9
//------------------------------------------------------------------------------------------------
11
ResourceName
GetPrefab
()
12
{
13
return
m_sPrefab
;
14
}
15
16
//------------------------------------------------------------------------------------------------
21
bool
SpawnPrefabs
(
int
authorPlayerId,
IEntity
user, notnull
EntitySpawnParams
params
)
22
{
23
Resource
resource =
Resource
.Load(
m_sPrefab
);
24
if
(!resource.IsValid())
25
{
26
Print
(
"[SCR_AdditionalDeployablePart.SpawnPrefabs] => Failed to load the resource from m_sPrefab = "
+
m_sPrefab
,
LogLevel
.ERROR);
27
return
false
;
28
}
29
30
vector
spawnedMat[4];
31
IEntity
spawnedEntity;
32
InventoryItemComponent
spawnedIIC;
33
int
numberOfSuccesfullySpawnedEnts;
34
for
(
int
i; i <
m_iNumberOfPrefabs
; i++)
35
{
36
spawnedEntity =
GetGame
().SpawnEntityPrefab(resource,
GetGame
().GetWorld(),
params
);
37
if
(!spawnedEntity)
38
continue
;
39
40
numberOfSuccesfullySpawnedEnts++;
41
PostPrefabSpawn
(spawnedEntity);
42
SCR_MultiPartDeployableItemComponent.SetAuthor(spawnedEntity, authorPlayerId);
43
44
spawnedIIC =
InventoryItemComponent
.Cast(spawnedEntity.
FindComponent
(
InventoryItemComponent
));
45
if
(spawnedIIC)
46
spawnedIIC.PlaceOnGround(user);
47
}
48
49
return
numberOfSuccesfullySpawnedEnts ==
m_iNumberOfPrefabs
;
50
}
51
52
//------------------------------------------------------------------------------------------------
55
void
PostPrefabSpawn
(notnull
IEntity
spawnedEntity);
56
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
params
category params
Definition
SCR_SpherePointGeneratorPreviewComponent.c:21
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
InventoryItemComponent
Definition
InventoryItemComponent.c:13
Resource
Object holding reference to resource. In destructor release the resource.
Definition
Resource.c:25
ResourceName
Definition
ResourceName.c:13
SCR_AdditionalDeployablePart
Definition
SCR_AdditionalDeployablePart.c:2
SCR_AdditionalDeployablePart::GetPrefab
ResourceName GetPrefab()
Definition
SCR_AdditionalDeployablePart.c:11
SCR_AdditionalDeployablePart::PostPrefabSpawn
void PostPrefabSpawn(notnull IEntity spawnedEntity)
SCR_AdditionalDeployablePart::SpawnPrefabs
bool SpawnPrefabs(int authorPlayerId, IEntity user, notnull EntitySpawnParams params)
Definition
SCR_AdditionalDeployablePart.c:21
SCR_AdditionalDeployablePart::m_sPrefab
ResourceName m_sPrefab
Definition
SCR_AdditionalDeployablePart.c:4
SCR_AdditionalDeployablePart::m_iNumberOfPrefabs
int m_iNumberOfPrefabs
Definition
SCR_AdditionalDeployablePart.c:7
ScriptAndConfig
Definition
Types.c:124
UIWidgets
Definition
attributes.c:40
vector
Definition
vector.c:13
EntitySpawnParams
void EntitySpawnParams()
Definition
gameLib.c:130
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
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
Components
SCR_AdditionalDeployablePart.c
Generated by
1.17.0