Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCE_EntityEditorEffect.c
Go to the documentation of this file.
1
[
BaseContainerProps
(),
SCR_BaseContainerCustomTitleResourceName
(
"m_Prefab"
,
true
,
"ENT: \"%1\""
)]
7
class
SCR_EntityEditorEffect
:
SCR_BaseEditorEffect
8
{
9
//---- REFACTOR NOTE START: Should be protected ----
10
[
Attribute
(
params
:
"et"
, uiwidget:
UIWidgets
.ResourcePickerThumbnail,
desc
:
"Spawned entity"
)]
11
private
ResourceName
m_Prefab;
12
//---- REFACTOR NOTE END ----
13
14
[
Attribute
(
desc
:
"Spawn the entity only when no entities are passed to the event."
)]
15
protected
bool
m_bNoEntities
;
16
17
[
Attribute
(
desc
:
"True to delete previous entity created by this effect when a new one is being created."
)]
18
protected
bool
m_bReplacePrevious
;
19
20
protected
IEntity
m_Entity
;
21
22
//---- REFACTOR NOTE START: Not up to date with internal scripting style ----
27
IEntity
GetEntity
()
28
{
29
return
m_Entity
;
30
}
31
32
override
bool
EOnActivate
(
SCR_BaseEditorComponent
editorComponent,
vector
position
=
vector
.Zero, set<SCR_EditableEntityComponent> entities = null)
33
{
34
if
(
position
==
vector
.Zero)
return
false
;
35
36
if
(
m_bNoEntities
&& entities && !entities.IsEmpty())
return
false
;
37
38
Resource
resource =
Resource
.Load(m_Prefab);
39
if
(!resource || !resource.IsValid())
40
{
41
Print
(
string
.Format(
"Invalid prefab '%1'!"
, m_Prefab),
LogLevel
.WARNING);
42
return
false
;
43
}
44
45
IEntitySource
entitySource =
SCR_BaseContainerTools
.FindEntitySource(resource);
46
if
(!entitySource)
47
{
48
Print
(
string
.Format(
"Prefab '%1' is not an entity!"
, m_Prefab),
LogLevel
.WARNING);
49
return
false
;
50
}
51
52
EntitySpawnParams
spawnParams =
new
EntitySpawnParams
;
53
spawnParams.Transform[3] =
position
;
54
55
//--- Apply scale from prefab
56
float
scale
;
57
entitySource.Get(
"scale"
,
scale
);
58
if
(
scale
!= 1)
59
{
60
spawnParams.Transform[0] = spawnParams.Transform[0] *
scale
;
61
spawnParams.Transform[1] = spawnParams.Transform[1] *
scale
;
62
spawnParams.Transform[2] = spawnParams.Transform[2] *
scale
;
63
}
64
65
if
(
m_bReplacePrevious
)
66
SCR_EntityHelper
.DeleteEntityAndChildren(
m_Entity
);
67
m_Entity
=
GetGame
().SpawnEntityPrefab(resource,
GetGame
().GetWorld(), spawnParams);
68
return
true
;
69
}
70
//---- REFACTOR NOTE END ----
71
};
scale
vector scale
Definition
BlenderEndpoints.c:50
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
SCR_BaseContainerCustomTitleResourceName
SCR_CampaignMilitaryBaseComponent SCR_MilitaryBaseComponent SCR_BaseContainerCustomTitleResourceName("m_sBaseName", true)
Definition
SCR_CampaignMilitaryBaseComponent.c:2910
position
vector position
Definition
SCR_DestructibleTreeV2.c:30
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
IEntitySource
Definition
IEntitySource.c:13
Resource
Object holding reference to resource. In destructor release the resource.
Definition
Resource.c:25
ResourceName
Definition
ResourceName.c:13
SCR_BaseContainerTools
Definition
SCR_BaseContainerTools.c:4
SCR_BaseEditorComponent
Definition
SCR_BaseEditorComponent.c:120
SCR_BaseEditorEffect
Definition
SCR_BaseEditorEffect.c:8
SCR_EntityEditorEffect
Definition
SCE_EntityEditorEffect.c:8
SCR_EntityEditorEffect::m_Entity
IEntity m_Entity
Definition
SCE_EntityEditorEffect.c:20
SCR_EntityEditorEffect::m_bNoEntities
bool m_bNoEntities
Definition
SCE_EntityEditorEffect.c:15
SCR_EntityEditorEffect::GetEntity
IEntity GetEntity()
Definition
SCE_EntityEditorEffect.c:27
SCR_EntityEditorEffect::EOnActivate
override bool EOnActivate(SCR_BaseEditorComponent editorComponent, vector position=vector.Zero, set< SCR_EditableEntityComponent > entities=null)
Definition
SCE_EntityEditorEffect.c:32
SCR_EntityEditorEffect::m_bReplacePrevious
bool m_bReplacePrevious
Definition
SCE_EntityEditorEffect.c:18
SCR_EntityHelper
Definition
SCR_EntityHelper.c:2
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
Editor
Containers
Effects
SCE_EntityEditorEffect.c
Generated by
1.17.0