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_BasePrefabSpawner.c
Go to the documentation of this file.
1
class
SCR_BasePrefabSpawner
:
GenericEntity
2
{
3
[
Attribute
(
""
,
UIWidgets
.ResourcePickerThumbnail,
desc
:
"Prefab to be spawned"
,
params
:
"et"
)]
4
protected
ResourceName
m_rnPrefab
;
5
6
void
SCR_BasePrefabSpawner
(
IEntitySource
src,
IEntity
parent)
7
{
8
SetEventMask
(
EntityEvent
.INIT |
EntityEvent
.FRAME );
9
Activate
();
10
}
11
12
protected
override
void
EOnInit
(
IEntity
owner)
13
{
14
}
15
16
protected
override
void
EOnFrame
(
IEntity
owner,
float
timeSlice)
17
{
18
if
(!
Replication
.IsServer())
19
return
;
20
21
if
(
CanSpawn
())
22
Spawn
();
23
}
24
25
protected
bool
CanSpawn
()
26
{
27
return
false
;
28
}
29
30
protected
bool
Spawn
()
31
{
32
BaseWorld
myWorld =
GetGame
().GetWorld();
33
if
(!myWorld ||
m_rnPrefab
.IsEmpty())
34
return
false
;
35
36
Resource
res =
Resource
.Load(
m_rnPrefab
);
37
EntitySpawnParams
params
=
new
EntitySpawnParams
();
38
39
vector
mat[4];
40
GetWorldTransform
(mat);
41
params
.Transform = mat;
42
IEntity
newEnt =
GetGame
().SpawnEntityPrefab(res, myWorld,
params
);
43
if
(!newEnt)
44
return
false
;
45
46
newEnt.
SetFlags
(
EntityFlags
.VISIBLE,
true
);
47
48
OnSpawn
(newEnt);
49
50
return
true
;
51
}
52
53
protected
void
OnSpawn
(
IEntity
newEnt)
54
{
55
}
56
};
57
58
class
SCR_BasePrefabSpawnerClass
: GenericEntityClass
59
{
60
};
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
BaseWorld
Definition
BaseWorld.c:13
GenericEntity
Definition
GenericEntity.c:16
GenericEntity::Activate
proto external void Activate()
IEntity::IEntity
void IEntity(IEntitySource src, IEntity parent)
protected script Constructor
IEntity::SetEventMask
proto external EntityEvent SetEventMask(EntityEvent e)
IEntity::GetWorldTransform
proto external void GetWorldTransform(out vector mat[])
See IEntity::GetTransform.
IEntity::SetFlags
proto external EntityFlags SetFlags(EntityFlags flags, bool recursively=false)
IEntitySource
Definition
IEntitySource.c:13
Replication
Main replication API.
Definition
Replication.c:14
Resource
Object holding reference to resource. In destructor release the resource.
Definition
Resource.c:25
ResourceName
Definition
ResourceName.c:13
SCR_BasePrefabSpawnerClass
Definition
SCR_BasePrefabSpawner.c:59
SCR_BasePrefabSpawner::OnSpawn
void OnSpawn(IEntity newEnt)
Definition
SCR_BasePrefabSpawner.c:53
SCR_BasePrefabSpawner::EOnInit
override void EOnInit(IEntity owner)
Definition
SCR_BasePrefabSpawner.c:12
SCR_BasePrefabSpawner::CanSpawn
bool CanSpawn()
Definition
SCR_BasePrefabSpawner.c:25
SCR_BasePrefabSpawner::Spawn
bool Spawn()
Definition
SCR_BasePrefabSpawner.c:30
SCR_BasePrefabSpawner::EOnFrame
override void EOnFrame(IEntity owner, float timeSlice)
Definition
SCR_BasePrefabSpawner.c:16
SCR_BasePrefabSpawner::SCR_BasePrefabSpawner
void SCR_BasePrefabSpawner(IEntitySource src, IEntity parent)
Definition
SCR_BasePrefabSpawner.c:6
SCR_BasePrefabSpawner::m_rnPrefab
ResourceName m_rnPrefab
Definition
SCR_BasePrefabSpawner.c:4
UIWidgets
Definition
attributes.c:40
vector
Definition
vector.c:13
EntitySpawnParams
void EntitySpawnParams()
Definition
gameLib.c:130
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
EntityEvent
EntityEvent
Various entity events.
Definition
EntityEvent.c:14
EntityFlags
EntityFlags
Various entity flags.
Definition
EntityFlags.c:14
scripts
GameCode
Base
SCR_BasePrefabSpawner.c
Generated by
1.17.0