Arma Reforger Script API
|
Core component to manage SCR_EditableEntityComponent. More...
Public Member Functions | |
void | AddToRoot (SCR_EditableEntityComponent entity) |
void | RemoveFromRoot (SCR_EditableEntityComponent entity) |
void | RegisterEntity (SCR_EditableEntityComponent entity) |
void | UnRegisterEntity (SCR_EditableEntityComponent entity, IEntity owner=null) |
void | AddOrphan (RplId parentId, RplId orphanId) |
Add orphaned entity. | |
int | RemoveOrphans (RplId parentId, out notnull array< SCR_EditableEntityComponent > outOrphans) |
Remove orphaned entities belonging to given parent. | |
void | GetAllEntities (out notnull set< SCR_EditableEntityComponent > entities, bool onlyDirect=false, bool skipIgnored=false) |
Get all entities. | |
void | GetAllEntities (out notnull set< SCR_EditableEntityComponent > entities, EEditableEntityAccessKey accessKey) |
Get all editable entities with specified access keys. | |
int | GetAllEntitiesByAuthorUID (out notnull set< SCR_EditableEntityComponent > entities, string playerUID) |
Get all editable entities with specified PlayerUID. | |
int | GetAllEntitiesByAuthorID (out notnull set< SCR_EditableEntityComponent > entities, int playerID) |
Get all editable entities with specified PlayerID. | |
SCR_EditableEntityComponent | FindNearestEntity (vector pos, EEditableEntityType type, EEditableEntityFlag flags=0, bool onlyDirect=true) |
Find nearest entity to given position. | |
SCR_EditableEntityInteraction | GetEntityInteraction (EEditableEntityType type) |
Get interaction class for given entity type. | |
bool | GetEntityCanBeControlled (EEditableEntityType type) |
Check if entity can be controlled by player, used for delaying budget update/AI check. | |
EEditableEntityBudget | GetBudgetForEntityType (EEditableEntityType entityType) |
void | GetBudgets (out notnull array< ref SCR_EditableEntityCoreBudgetSetting > budgets) |
Get all entity budget settings. | |
bool | GetBudget (EEditableEntityBudget budgetType, out SCR_EditableEntityCoreBudgetSetting budgetSettings) |
Get current budget settings of given type. | |
void | GetLabelGroups (out notnull array< ref SCR_EditableEntityCoreLabelGroupSetting > labelGroups) |
Get all entity label group settings. | |
int | GetLabelGroupOrder (EEditableEntityLabelGroup groupLabel) |
Get the order of the given group type. | |
bool | GetLabelGroupType (EEditableEntityLabel label, out EEditableEntityLabelGroup labelGroup) |
Get group enum value of passed entity label. | |
bool | GetLabelsOfGroup (EEditableEntityLabelGroup groupType, out notnull array< SCR_EditableEntityCoreLabelSetting > labels) |
Get all label settings of the passed label group. | |
bool | GetLabelUIInfo (EEditableEntityLabel entityLabel, out SCR_UIInfo uiInfo) |
Get UI info of passed entity label. | |
bool | GetLabelUIInfoIfValid (EEditableEntityLabel entityLabel, EEditorMode currentMode, out SCR_UIInfo uiInfo) |
Get UI info of passed entity label if the label is valid to display. | |
SCR_EditableEntityCampaignBuildingModeLabelData | GetBuildModeLabelData (EEditableEntityLabel entityLabel) |
Get UI infos and Linked Conflict service point of passed entity label for BuildMode specific Labels Will ignore any non-buildmode labels as well as any build mode labels that have neither UIInfo nor linked Conflict service point. | |
int | GetCampaignBuildingModeLabelsData (notnull array< EEditableEntityLabel > entityLabels, notnull out array< ref SCR_EditableEntityCampaignBuildingModeLabelData > validBuildmodeLabelData) |
Get UI infos and Linked Conflict service point of all passed entity labels for BuildMode specific Labels Will ignore any non-buildmode labels as well as any build mode labels that have neither UIInfo nor linked Conflict service point. | |
SCR_UIInfo | GetBuildModeLabelUIInfo (EEditableEntityLabel entityLabel) |
Get UI info of passed entity label for BuildMode labels. | |
SCR_EServicePointType | GetBuildModeLabelLinkedConflictService (EEditableEntityLabel entityLabel) |
Get linked conflict service point of passed entity label for BuildMode labels. | |
int | GetLabelOrder (EEditableEntityLabel entityLabel) |
Get specific label order. | |
void | OrderLabels (inout notnull array< EEditableEntityLabel > labels) |
Get a label array and order it according to group and label index. | |
void | LoadSettings (SCR_EditableEntityComponent entity) |
Load global settings for given entity. | |
SCR_EditableEntityCoreTypeSetting | GetSettings (SCR_EditableEntityComponent entity) |
Get global settings for given entity. | |
float | GetPlayerDrawDistanceSq (bool isInVehicle) |
Get draw distance override value for player characters. | |
void | Log () |
Print out the hierarchy of all editable entities. | |
void | UpdateBudgets (SCR_EditableEntityComponent entity, bool added, IEntity owner=null) |
void | RegisterAuthorServer (SCR_EditableEntityAuthor newAuthor) |
void | AuthorEntityRemovedServer (SCR_EditableEntityAuthor newAuthor) |
set< SCR_EditableEntityAuthor > | GetAllAuthorsServer () |
void | RequestAllAuthors () |
void | AddAuthorOnRequest (notnull SCR_EditableEntityAuthor newAuthor) |
Do not call this function yourself, this has to be requested by server. | |
void | OnAuthorRequestFinished () |
override void | OnUpdate (float timeSlice) |
override void | OnGameStart () |
override void | OnGameEnd () |
void | SCR_EditableEntityCore () |
Static Public Member Functions | |
static int | GetAllEntitiesByAuthorUIDExt (out notnull set< SCR_EditableEntityComponent > entities, string playerUID) |
Static call for GetAllEntitiesByAuthorUID for ease of use -> only works for Streamed in Entities. | |
static int | GetAllEntitiesByAuthorIDExt (out notnull set< SCR_EditableEntityComponent > entities, int playerID) |
Static call for GetAllEntitiesByAuthorUID for ease of use -> only works for Streamed in Entities. | |
Public Attributes | |
ref map< RplId, ref array< RplId > > | m_OrphanEntityIds = new map<RplId, ref array<RplId>>() |
ref ScriptInvoker | Event_OnEntityRegistered = new ScriptInvoker |
Called when an entity is made editable. | |
ref ScriptInvoker | Event_OnEntityUnregistered = new ScriptInvoker |
Called when an entity is made not editable. | |
ref ScriptInvoker | Event_OnEntityRefreshed = new ScriptInvoker |
Called when manual refresh of the entity is triggered. | |
ref ScriptInvoker | Event_OnParentEntityChanged = new ScriptInvoker |
Called when entity is changes parent. | |
ref ScriptInvoker | Event_OnEntityAccessKeyChanged = new ScriptInvoker |
Called when entity access key is modified. | |
ref ScriptInvoker | Event_OnEntityVisibilityChanged = new ScriptInvoker |
Called when entity access keys are updated. | |
ref ScriptInvoker | Event_OnEntityTransformChanged = new ScriptInvoker |
Called when entity transformation is changed by the editor. | |
ref ScriptInvoker | Event_OnEntityTransformChangedServer = new ScriptInvoker |
Called when entity transformation is changed by the editor only server only. Sends EditableEntity and Prev ETransformMode. | |
ref ScriptInvoker_EntityCoreBudgetUpdatedEvent | Event_OnEntityBudgetUpdated = new ScriptInvoker_EntityCoreBudgetUpdatedEvent() |
Called when entity budget is updated. | |
ref ScriptInvoker | Event_OnEntityExtendedChange = new ScriptInvoker |
Called when entity is extended or cease to be extended. | |
ref ScriptInvoker_AuthorRequestedFinishedEvent | Event_OnAuthorsRegisteredFinished = new ScriptInvoker_AuthorRequestedFinishedEvent |
Protected Member Functions | |
void | UpdateBudgetForEntity (SCR_EditableEntityComponent entity, bool added, IEntity owner) |
void | UpdateBudget (EEditableEntityBudget budgetType, bool added, SCR_EditableEntityComponent entity, SCR_EntityBudgetValue budgetCost=null) |
Protected Attributes | |
float | m_fPlayerDrawDistance |
float | m_fPlayerVehicleDistanceModifier |
bool | m_bAuthorRequesting |
Core component to manage SCR_EditableEntityComponent.
The list of editable entities tracked here is local!
void SCR_EditableEntityCore.SCR_EditableEntityCore | ( | ) |
void SCR_EditableEntityCore.AddAuthorOnRequest | ( | notnull SCR_EditableEntityAuthor | newAuthor | ) |
Do not call this function yourself, this has to be requested by server.
void SCR_EditableEntityCore.AddOrphan | ( | RplId | parentId, |
RplId | orphanId | ||
) |
Add orphaned entity.
This can happen when an entity is intialised, but its parent was not yet streamed in. In such case the entity is added to the list of orphans. Once the parent is initialised, it will be added to it.
parentId | Replication ID of the parent entity |
parentId | Replication ID of the orphan entity |
void SCR_EditableEntityCore.AddToRoot | ( | SCR_EditableEntityComponent | entity | ) |
entity |
void SCR_EditableEntityCore.AuthorEntityRemovedServer | ( | SCR_EditableEntityAuthor | newAuthor | ) |
SCR_EditableEntityComponent SCR_EditableEntityCore.FindNearestEntity | ( | vector | pos, |
EEditableEntityType | type, | ||
EEditableEntityFlag | flags = 0 , |
||
bool | onlyDirect = true |
||
) |
Find nearest entity to given position.
pos | Position from which the distance is measured |
type | Required entity type |
flags | Required entity flags |
onlyDirect | True to scan only root entities, false to scan all editable entities in the world |
set< SCR_EditableEntityAuthor > SCR_EditableEntityCore.GetAllAuthorsServer | ( | ) |
void SCR_EditableEntityCore.GetAllEntities | ( | out notnull set< SCR_EditableEntityComponent > | entities, |
bool | onlyDirect = false , |
||
bool | skipIgnored = false |
||
) |
Get all entities.
[out] | entities | Array to be filled with child entities |
onlyDirect | When true, only the direct descendants are returned, otherwise all children, children of children etc. are returned. | |
skipIgnored | When true, entities flagged by IGNORE_LAYERS will not be included in the list |
void SCR_EditableEntityCore.GetAllEntities | ( | out notnull set< SCR_EditableEntityComponent > | entities, |
EEditableEntityAccessKey | accessKey | ||
) |
Get all editable entities with specified access keys.
[out] | entities | Array to be filled with editable entities |
accessKey | Access key. Only entities with at least one compatible key will be returned. |
int SCR_EditableEntityCore.GetAllEntitiesByAuthorID | ( | out notnull set< SCR_EditableEntityComponent > | entities, |
int | playerID | ||
) |
Get all editable entities with specified PlayerID.
Works only if this session wasn't reloaded. -> only works for Streamed in Entities
[out] | entities | Array to be filled with editable entities |
playerID | Player Unique Identifier. Returns all entities with author of this identifier. |
|
static |
Static call for GetAllEntitiesByAuthorUID for ease of use -> only works for Streamed in Entities.
[out] | entities | Array to be filled with editable entities |
playerID | Player Unique Identifier. Returns all entities with author of this identifier. |
int SCR_EditableEntityCore.GetAllEntitiesByAuthorUID | ( | out notnull set< SCR_EditableEntityComponent > | entities, |
string | playerUID | ||
) |
Get all editable entities with specified PlayerUID.
Works even after World Save/Load -> only works for Streamed in Entities
[out] | entities | Array to be filled with editable entities |
playerUID | Player Unique Identifier. Returns all entities with author of this identifier. |
|
static |
Static call for GetAllEntitiesByAuthorUID for ease of use -> only works for Streamed in Entities.
[out] | entities | Array to be filled with editable entities |
playerUID | Player Unique Identifier. Returns all entities with author of this identifier. |
bool SCR_EditableEntityCore.GetBudget | ( | EEditableEntityBudget | budgetType, |
out SCR_EditableEntityCoreBudgetSetting | budgetSettings | ||
) |
Get current budget settings of given type.
[out] | SCR_EditableEntityCoreBudgetSetting |
EEditableEntityBudget SCR_EditableEntityCore.GetBudgetForEntityType | ( | EEditableEntityType | entityType | ) |
entityType |
void SCR_EditableEntityCore.GetBudgets | ( | out notnull array< ref SCR_EditableEntityCoreBudgetSetting > | budgets | ) |
Get all entity budget settings.
[out] | Array | with entity budget settings |
SCR_EditableEntityCampaignBuildingModeLabelData SCR_EditableEntityCore.GetBuildModeLabelData | ( | EEditableEntityLabel | entityLabel | ) |
Get UI infos and Linked Conflict service point of passed entity label for BuildMode specific Labels Will ignore any non-buildmode labels as well as any build mode labels that have neither UIInfo nor linked Conflict service point.
entityLabel | label to get data from |
SCR_EServicePointType SCR_EditableEntityCore.GetBuildModeLabelLinkedConflictService | ( | EEditableEntityLabel | entityLabel | ) |
Get linked conflict service point of passed entity label for BuildMode labels.
Will ignore any non assigned values (-1 or less)
entityLabel | label to get data from |
SCR_UIInfo SCR_EditableEntityCore.GetBuildModeLabelUIInfo | ( | EEditableEntityLabel | entityLabel | ) |
Get UI info of passed entity label for BuildMode labels.
Will return null if no UIInfo assigned or if not a building mode specific label
entityLabel | label to get data from |
int SCR_EditableEntityCore.GetCampaignBuildingModeLabelsData | ( | notnull array< EEditableEntityLabel > | entityLabels, |
notnull out array< ref SCR_EditableEntityCampaignBuildingModeLabelData > | validBuildmodeLabelData | ||
) |
Get UI infos and Linked Conflict service point of all passed entity labels for BuildMode specific Labels Will ignore any non-buildmode labels as well as any build mode labels that have neither UIInfo nor linked Conflict service point.
entityLabels | labels to get data from | |
[out] | validBuildmodeLabelData | array of specific build mode label data. Which has such info as: Label, UiInfo and Linked Conflict service point |
bool SCR_EditableEntityCore.GetEntityCanBeControlled | ( | EEditableEntityType | type | ) |
Check if entity can be controlled by player, used for delaying budget update/AI check.
EEditableEntityType | type of the entity to check |
SCR_EditableEntityInteraction SCR_EditableEntityCore.GetEntityInteraction | ( | EEditableEntityType | type | ) |
Get interaction class for given entity type.
type | Entity type |
int SCR_EditableEntityCore.GetLabelGroupOrder | ( | EEditableEntityLabelGroup | groupLabel | ) |
Get the order of the given group type.
groupLabel | given group type |
void SCR_EditableEntityCore.GetLabelGroups | ( | out notnull array< ref SCR_EditableEntityCoreLabelGroupSetting > | labelGroups | ) |
Get all entity label group settings.
[out] | Array | with current entity label groups |
bool SCR_EditableEntityCore.GetLabelGroupType | ( | EEditableEntityLabel | label, |
out EEditableEntityLabelGroup | labelGroup | ||
) |
Get group enum value of passed entity label.
EEditableEntityLabel | enum value | |
[out] | Label | group enum value this entity label belongs to. |
int SCR_EditableEntityCore.GetLabelOrder | ( | EEditableEntityLabel | entityLabel | ) |
Get specific label order.
Returns -1 if label not found
bool SCR_EditableEntityCore.GetLabelsOfGroup | ( | EEditableEntityLabelGroup | groupType, |
out notnull array< SCR_EditableEntityCoreLabelSetting > | labels | ||
) |
Get all label settings of the passed label group.
EEditableEntityLabelGroup | enum value of group | |
[out] | Array | with all label settings of labels in this group |
bool SCR_EditableEntityCore.GetLabelUIInfo | ( | EEditableEntityLabel | entityLabel, |
out SCR_UIInfo | uiInfo | ||
) |
Get UI info of passed entity label.
EEditableEntityLabel | enum value | |
[out] | SCR_UIInfo | matching the passed label enum value |
bool SCR_EditableEntityCore.GetLabelUIInfoIfValid | ( | EEditableEntityLabel | entityLabel, |
EEditorMode | currentMode, | ||
out SCR_UIInfo | uiInfo | ||
) |
Get UI info of passed entity label if the label is valid to display.
EEditableEntityLabel | enum value | |
currentMode | Current editor mode | |
[out] | SCR_UIInfo | matching the passed label enum value |
float SCR_EditableEntityCore.GetPlayerDrawDistanceSq | ( | bool | isInVehicle | ) |
Get draw distance override value for player characters.
isInVehicle |
SCR_EditableEntityCoreTypeSetting SCR_EditableEntityCore.GetSettings | ( | SCR_EditableEntityComponent | entity | ) |
Get global settings for given entity.
entity | Editable entity |
void SCR_EditableEntityCore.LoadSettings | ( | SCR_EditableEntityComponent | entity | ) |
Load global settings for given entity.
entity | Affected entity |
void SCR_EditableEntityCore.Log | ( | ) |
Print out the hierarchy of all editable entities.
void SCR_EditableEntityCore.OnAuthorRequestFinished | ( | ) |
override void SCR_EditableEntityCore.OnGameEnd | ( | ) |
override void SCR_EditableEntityCore.OnGameStart | ( | ) |
override void SCR_EditableEntityCore.OnUpdate | ( | float | timeSlice | ) |
void SCR_EditableEntityCore.OrderLabels | ( | inout notnull array< EEditableEntityLabel > | labels | ) |
Get a label array and order it according to group and label index.
void SCR_EditableEntityCore.RegisterAuthorServer | ( | SCR_EditableEntityAuthor | newAuthor | ) |
void SCR_EditableEntityCore.RegisterEntity | ( | SCR_EditableEntityComponent | entity | ) |
entity |
void SCR_EditableEntityCore.RemoveFromRoot | ( | SCR_EditableEntityComponent | entity | ) |
entity |
int SCR_EditableEntityCore.RemoveOrphans | ( | RplId | parentId, |
out notnull array< SCR_EditableEntityComponent > | outOrphans | ||
) |
Remove orphaned entities belonging to given parent.
parentId | Replication ID of the parent entity | |
[out] | outOrphans | Array to be filled with orphaned entities |
void SCR_EditableEntityCore.RequestAllAuthors | ( | ) |
void SCR_EditableEntityCore.UnRegisterEntity | ( | SCR_EditableEntityComponent | entity, |
IEntity | owner = null |
||
) |
entity | |
owner |
|
protected |
budgetType | |
added | |
entity | |
budgetCost |
|
protected |
entity | |
added | |
owner |
void SCR_EditableEntityCore.UpdateBudgets | ( | SCR_EditableEntityComponent | entity, |
bool | added, | ||
IEntity | owner = null |
||
) |
entity | |
added | |
owner |
ref ScriptInvoker_AuthorRequestedFinishedEvent SCR_EditableEntityCore.Event_OnAuthorsRegisteredFinished = new ScriptInvoker_AuthorRequestedFinishedEvent |
ref ScriptInvoker SCR_EditableEntityCore.Event_OnEntityAccessKeyChanged = new ScriptInvoker |
Called when entity access key is modified.
ref ScriptInvoker_EntityCoreBudgetUpdatedEvent SCR_EditableEntityCore.Event_OnEntityBudgetUpdated = new ScriptInvoker_EntityCoreBudgetUpdatedEvent() |
Called when entity budget is updated.
ref ScriptInvoker SCR_EditableEntityCore.Event_OnEntityExtendedChange = new ScriptInvoker |
Called when entity is extended or cease to be extended.
ref ScriptInvoker SCR_EditableEntityCore.Event_OnEntityRefreshed = new ScriptInvoker |
Called when manual refresh of the entity is triggered.
ref ScriptInvoker SCR_EditableEntityCore.Event_OnEntityRegistered = new ScriptInvoker |
Called when an entity is made editable.
ref ScriptInvoker SCR_EditableEntityCore.Event_OnEntityTransformChanged = new ScriptInvoker |
Called when entity transformation is changed by the editor.
ref ScriptInvoker SCR_EditableEntityCore.Event_OnEntityTransformChangedServer = new ScriptInvoker |
Called when entity transformation is changed by the editor only server only. Sends EditableEntity and Prev ETransformMode.
ref ScriptInvoker SCR_EditableEntityCore.Event_OnEntityUnregistered = new ScriptInvoker |
Called when an entity is made not editable.
ref ScriptInvoker SCR_EditableEntityCore.Event_OnEntityVisibilityChanged = new ScriptInvoker |
Called when entity access keys are updated.
ref ScriptInvoker SCR_EditableEntityCore.Event_OnParentEntityChanged = new ScriptInvoker |
Called when entity is changes parent.
|
protected |
|
protected |
|
protected |
ref map<RplId, ref array<RplId> > SCR_EditableEntityCore.m_OrphanEntityIds = new map<RplId, ref array<RplId>>() |