Arma Reforger Script API
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SCR_EditableEntityComponent Interface Reference

Component defining editable entity. More...

Inheritance diagram for SCR_EditableEntityComponent:
[legend]

Public Member Functions

string GetDisplayName ()
 Get entity name from info component.
 
ResourceName GetPrefab (bool shorten=false)
 Get entity prefab.
 
SCR_EditableEntityComponentClass GetEditableEntityData (IEntity owner=null)
 Get prefab data of this editable entity.
 
EEditableEntityType GetEntityType (IEntity owner=null)
 Get entity type.
 
SCR_EditableEntityInteraction GetEntityInteraction (IEntity owner=null)
 Get entity interaction rules of this entity.
 
SCR_UIInfo GetInfo (IEntity owner=null)
 Get information about the entity.
 
ScriptInvokerEntity GetOnDeleted ()
 Get event called when entity is deleted.
 
void SetInfoInstance (SCR_UIInfo info)
 Set information about the entity on entity instance, locally on this machine.
 
bool IsReplicated (out RplId replicationID=-1)
 Check component's replication.
 
bool Serialize (out SCR_EditableEntityComponent outTarget=null, out int outTargetIndex=-1, out EEditableEntitySaveFlag outSaveFlags=0)
 Check if the entity can be serialized during session saving managed by SCR_EditableEntityStruct.
 
void Deserialize (SCR_EditableEntityComponent target, int targetValue)
 Deserialise the entity based on given params.
 
GenericEntity GetOwnerScripted ()
 
bool GetPos (out vector pos)
 Get position representing the entity.
 
vector GetIconPos ()
 Get icon offset.
 
bool GetTransform (out vector outTransform[4])
 Get world transformation matrix of editable entity.
 
bool GetLocalTransform (out vector outTransform[4])
 Get local transformation matrix of editable entity.
 
int GetPlayerID ()
 Get player controlling this entity.
 
Faction GetFaction ()
 Get entity's faction.
 
ScriptInvoker GetOnUIRefresh ()
 Get event called when GUI should refresh entity's GUI, i.e., update faction color and call events in GUI widgets.
 
ScriptInvoker GetOnUIReset ()
 Get event called when GUI should reset widgets that are used for entity visualization.
 
SCR_EditableEntityComponent GetAIGroup ()
 Get entity's AI group.
 
SCR_EditableEntityComponent GetAIEntity ()
 Get entity which represents this entity as AI.
 
SCR_EditableEntityComponent GetVehicle ()
 Get vehicle the entity's in.
 
int GetCrew (out notnull array< CompartmentAccessComponent > crewCompartmentAccess, bool ignorePlayers=true)
 Get crew of vehicle or if in a vehicle get self.
 
float GetHealth ()
 Get entity health.
 
bool CanDestroy ()
 
bool IsDestroyed ()
 Check if the entity is destroyed.
 
void SetStatic (bool isStatic)
 Set entity as static.
 
bool GetStatic ()
 Check if the entity is marked as static.
 
void UpdateStaticPos ()
 Update static cached position.
 
void SetHierarchyAsDirtyInParents ()
 Mark hierarchy in all parents of the entity as dirty, i.e., modified by user.
 
void SetHierarchyAsDirty ()
 Mark entity hierarchy as dirty, i.e., modified by user.
 
void SetTransformWithChildren (vector transform[4])
 Update transformation of the entity and all its editor children and broadcast the changes to all clients.
 
void SetTransform (vector transform[4], bool changedByUser=false)
 Update entity's transformation and broadcast the changes to all clients.
 
bool Destroy ()
 Kill/destroy this editable entity.
 
bool Delete (bool changedByUser=false, bool updateNavmesh=false)
 Delete this editable entity.
 
RplId GetOwnerRplId ()
 
float GetMaxDrawDistanceSq ()
 Get squared maximum distance in which this entity is drawn in editor (e.g., with an icon).
 
void SetMaxDrawDistance (float maxDrawDistance)
 Set maximum distance in which this entity is drawn in editor (e.g., with an icon).
 
bool GetEntityBudgetCost (out notnull array< ref SCR_EntityBudgetValue > outBudgets, IEntity owner=null)
 Get entity budget costs.
 
bool GetEntityChildrenBudgetCost (out notnull array< ref SCR_EntityBudgetValue > outBudgets, IEntity owner=null)
 Get entity budget costs including cost of children (for groups/compositions)
 
bool GetEntityAndChildrenBudgetCost (out notnull array< ref SCR_EntityBudgetValue > outBudgets, IEntity owner=null)
 Get budgets for both, entity and it's children.
 
bool CanDuplicate (out notnull set< SCR_EditableEntityComponent > outRecipients)
 Can entity be duplicated by editor and which recipients should be passed to the duplicated entity Overridden by other EditableEntityComponents.
 
void ForceVehicleCompartments (notnull array< ECompartmentType > forceVehicleCompartments)
 Authority Only, forces entities such as Character and Group to place characters into a specific vehicle position.
 
void OnCreatedServer (notnull SCR_PlacingEditorComponent placedEditorComponent)
 
bool HasEntityState (EEditableEntityState state)
 Check if given entity state is active.
 
EEditableEntityState GetEntityStates ()
 Check bit array with all currently active states.
 
void SetEntityState (EEditableEntityState state, bool toSet)
 Set value of an entity state.
 
void ResetEntityStates ()
 Reset all entity states.
 
bool HasEntityFlag (EEditableEntityFlag flag)
 Check if a flag is active.
 
EEditableEntityFlag GetEntityFlags ()
 Get entity flags.
 
void SetEntityFlag (EEditableEntityFlag flag, bool toSet)
 Set entity flag.
 
void CopyEntityFlags (EEditableEntityFlag flags)
 Override the Entity flags.
 
string GetLogText (string prefix="")
 
void Log (string prefix="", bool onlyDirect=false, LogLevel logLevel=LogLevel.DEBUG)
 Print out entity information.
 
void Log (string prefix, EEditableEntityAccessKey accessKey)
 Print out the entity and all its descendants which are compatible with given key.
 
void LogAccessKey ()
 Print out entity's access key.
 
SCR_EditableEntityComponent EOnEditorPlace (out SCR_EditableEntityComponent parent, SCR_EditableEntityComponent recipient, EEditorPlacingFlags flags, bool isQueue, int playerID=0)
 Event called on server when the entity is placed in the editor.
 
void EOnEditorSessionLoad (SCR_EditableEntityComponent parent)
 Event called on server when the session is being loaded by SCR_EditableEntityStruct.
 
override bool RplSave (ScriptBitWriter writer)
 
override bool RplLoad (ScriptBitReader reader)
 
override void OnDelete (IEntity owner)
 
override void OnPostInit (IEntity owner)
 
void SCR_EditableEntityComponent (IEntityComponentSource src, IEntity ent, IEntity parent)
 
void Attach (notnull SCR_EditableEntityComponent attachable)
 Add the received attachable waypoint to the attached entities (runs on parent)
 
void Detach (notnull SCR_EditableEntityComponent attachable)
 Removes the received attachable waypoint from the attached entities (runs on parent)
 
set< SCR_EditableEntityComponentGetAttachedEntities ()
 Returns attached entities of self.
 
bool IsAttachable ()
 Returns if current entity is attachable.
 
bool IsAttached ()
 Returns if current entity is attached.
 
SCR_EditableEntityComponent GetAttachedTo ()
 Returns current entity which this editable task is attached to.
 
Hierarchy

Functions to manage hierarchy of the entity.

bool CanSetParent (SCR_EditableEntityComponent parentEntity)
 Check if the entity can be moved to intended parent.
 
SCR_EditableEntityComponent SetParentEntity (SCR_EditableEntityComponent parentEntity, bool changedByUser=false)
 Set parent of the entity.
 
void RestoreParentEntity ()
 Add the entity to its previous parent after it was unregistered using RemoveParentEntity() Allowed only on server.
 
void RemoveParentEntity ()
 Remove entity from its parent.
 
SCR_EditableEntityComponent GetParentEntity ()
 Get parent entity.
 
void GetParentEntities (out notnull array< SCR_EditableEntityComponent > entities)
 Get hierarchy of all parent entities, all the way to the root.
 
bool IsChildOf (SCR_EditableEntityComponent entity)
 Check if the entity is in hierarchy of given entity.
 
set< SCR_EditableEntityComponentGetChildrenRef ()
 Get direct reference to entity's immediate children.
 
void GetChildren (out notnull set< SCR_EditableEntityComponent > entities, bool onlyDirect=false, bool skipIgnored=false)
 Get child entities.
 
void GetChildren (out notnull set< SCR_EditableEntityComponent > entities, bool onlyDirect, EEditableEntityAccessKey accessKey)
 Get child entities with compatible key.
 
int GetChildrenCount (bool onlyDirect=false)
 Get number of child entities.
 
SCR_EditableEntityComponent GetChild (int index)
 Get child on given index.
 
bool IsLayer ()
 Check if the entity is also a layer, i.e., has some child entities.
 
bool CanEnterLayer (SCR_LayersEditorComponent layersManager=null, bool toExtreme=false)
 Checks if can enter layer.
 
bool IsRegistered ()
 Check if the entity is registered.
 
Visibility

Functions to manage visibility of the entity.

void SetVisible (bool show)
 Set entity visibility.
 
void EnableVisibilityReplication (bool enable)
 
bool CanReplicateVisibility ()
 
void OnRplVisibilityChanged ()
 
bool GetVisibleSelf ()
 Check visibility setting of the entity.
 
bool GetVisibleInHierarchy ()
 Check visibility setting of the entity in hierarchy (e.g., if an entity is set as visible, but its parent is not, false will be returned).
 
Access Key

Functions to manage access key.

  • Access key is shared over network and define who has rights to edit the entity.
  • Key is a flag composed of multiple EEditableEntityAccessKey values.
  • When at least one of the values is compatible with editor key values, the entity will become available.*
void AddAccessKey (EEditableEntityAccessKey accessKey)
 Add access key.
 
void RemoveAccessKey (EEditableEntityAccessKey accessKey)
 Remove access key.
 
void ClearAccessKeys ()
 Clear all access keys.
 
EEditableEntityAccessKey GetAccessKey ()
 Get entity's access key.
 
bool HasAccessSelf (EEditableEntityAccessKey accessKey)
 Check access key of the entity.
 
bool HasAccessInHierarchy (EEditableEntityAccessKey accessKey)
 Check acces keys of the entity in hierarchy (e.g., if an entity is compatible, but its parent is not, false will be returned).
 
bool HasAccessSelf ()
 Check access key of the entity compared to those defined in SCR_AccessKeysEditorComponent.
 
bool HasAccessInHierarchy ()
 Check access key of the entity in hierarchy (e.g., if an entity is compatible, but its parent is not, false will be returned).
 

Static Public Member Functions

static SCR_EditableEntityComponent GetEditableEntity (IEntity owner)
 Get editable entity component on given entity.
 

Protected Member Functions

bool IsServer ()
 
bool CanRpc ()
 
void SetTransformOwner (vector transform[4])
 
void SetTransformBroadcast (vector transform[4])
 
void OnParentEntityChanged (SCR_EditableEntityComponent parentEntity, SCR_EditableEntityComponent parentEntityPrev, bool changedByUser)
 
void SetParentEntityBroadcast (SCR_EditableEntityComponent parentEntity, SCR_EditableEntityComponent parentEntityPrev, bool changedByUser=false, bool isAutoRegistration=false)
 
void SetParentEntityBroadcastReceive (RplId parentEntityID, RplId parentEntityPrevID, bool changedByUser)
 
void OnRegistrationChanged (bool toRegister)
 
EEditableEntityRegister GetAutoRegister ()
 
void Register ()
 
void Unregister (IEntity owner=null)
 
void AddToParent (SCR_EditableEntityComponent parentEntity, bool changedByUser)
 
void RemoveFromParent (SCR_EditableEntityComponent parentEntity, bool changedByUser)
 
void AddChild (SCR_EditableEntityComponent entity)
 
void RemoveChild (SCR_EditableEntityComponent entity)
 
void UpdateGameHierarchy (IEntity parent, IEntity child, bool toAdd)
 
void OnChildEntityChanged (SCR_EditableEntityComponent child, bool isAdded)
 
void SetEntityStateInChildren (IEntity owner, EEditableEntityState state, bool toSet, out array< Managed > components=null)
 
void OnVisibilityChanged ()
 
void OnAccessKeyChanged (EEditableEntityAccessKey accessKey)
 
void Refresh ()
 
RplComponent GetRplComponent ()
 
bool ValidateType ()
 

Protected Attributes

EEditableEntityRegister m_bAutoRegister
 
vector m_vIconPos
 
bool m_bEnabledVisibilityReplication
 
bool m_bVisible
 
bool m_bStatic
 
float m_fMaxDrawDistance
 
EEditableEntityAccessKey m_AccessKey
 
EEditableEntityFlag m_Flags
 
SCR_EditableEntityComponent m_ParentEntity
 
GenericEntity m_Owner
 
EEditableEntityState m_EntityState
 
SCR_UIInfo m_UIInfoInstance
 
ref set< SCR_EditableEntityComponentm_Entities
 
vector m_vStaticPos
 
int m_iIconBoneIndex = -1
 
ref ScriptInvokerEntity m_OnDeleted
 
ref set< SCR_EditableEntityComponentm_aAttachedEntities
 

Detailed Description

Component defining editable entity.

Implementation Notes

Examples
d:/jenkins/workspace/ar_data_branches_stable_1.2.0/A4Data/scripts/Game/Editor/Containers/EditableEntityFilters/SCR_RenderedEditableEntityFilter.c.

Constructor & Destructor Documentation

◆ SCR_EditableEntityComponent()

void SCR_EditableEntityComponent.SCR_EditableEntityComponent ( IEntityComponentSource  src,
IEntity  ent,
IEntity  parent 
)
Parameters
[in]src
[in]ent
[in]parent

Member Function Documentation

◆ AddAccessKey()

void SCR_EditableEntityComponent.AddAccessKey ( EEditableEntityAccessKey  accessKey)

Add access key.

Available only on server!

Parameters
[in]accessKeyKey to be added

◆ AddChild()

void SCR_EditableEntityComponent.AddChild ( SCR_EditableEntityComponent  entity)
protected

◆ AddToParent()

void SCR_EditableEntityComponent.AddToParent ( SCR_EditableEntityComponent  parentEntity,
bool  changedByUser 
)
protected

◆ Attach()

void SCR_EditableEntityComponent.Attach ( notnull SCR_EditableEntityComponent  attachable)

Add the received attachable waypoint to the attached entities (runs on parent)

Parameters
[in]targetto link current entity to

◆ CanDestroy()

bool SCR_EditableEntityComponent.CanDestroy ( )
Returns
if destroying of entity is allowed. Does not check if entity is destroyed already. Use IsDestroyed() for this

Implemented in SCR_EditableExplosiveChargeComponent, SCR_EditableGroupComponent, and SCR_EditableMineComponent.

◆ CanDuplicate()

bool SCR_EditableEntityComponent.CanDuplicate ( out notnull set< SCR_EditableEntityComponent outRecipients)

Can entity be duplicated by editor and which recipients should be passed to the duplicated entity Overridden by other EditableEntityComponents.

Parameters
[out]outRecipientseditableEntityComponents that will be passed to the duplicated entity (Groupcomponent / FactionComponent)
Returns
true if entity can be duplicated

Implemented in SCR_EditableFactionComponent, SCR_EditableGroupComponent, and SCR_EditableWaypointComponent.

◆ CanEnterLayer()

bool SCR_EditableEntityComponent.CanEnterLayer ( SCR_LayersEditorComponent  layersManager = null,
bool  toExtreme = false 
)

Checks if can enter layer.

Parameters
[in]layersManagergive a layermanager ref, it will find the layer manager if left empty
[in]toExtremeWhen enable, it will not move just one layer up, but all the way to root. And the same when moving down
Returns
false if no layermanager or if unable to enter layer

◆ CanReplicateVisibility()

bool SCR_EditableEntityComponent.CanReplicateVisibility ( )
Returns

◆ CanRpc()

bool SCR_EditableEntityComponent.CanRpc ( )
protected

◆ CanSetParent()

bool SCR_EditableEntityComponent.CanSetParent ( SCR_EditableEntityComponent  parentEntity)

Check if the entity can be moved to intended parent.

Parameters
[in]parentEntityNew parent. Null when evaluating root.
Returns

Implemented in SCR_EditableWaypointComponent.

◆ ClearAccessKeys()

void SCR_EditableEntityComponent.ClearAccessKeys ( )

Clear all access keys.

Available only on server!

◆ CopyEntityFlags()

void SCR_EditableEntityComponent.CopyEntityFlags ( EEditableEntityFlag  flags)

Override the Entity flags.

Parameters
[in]flagsThe flags to override to

◆ Delete()

bool SCR_EditableEntityComponent.Delete ( bool  changedByUser = false,
bool  updateNavmesh = false 
)

Delete this editable entity.

Parameters
[in]changedByUserTrue when the change was initiated by user
[in]updateNavmeshTrue to update navmesh after the entity is deleted (set to false when deleting children of already deleted entity)
Returns
true if deleted

Implemented in SCR_EditableCharacterComponent, and SCR_EditableTaskComponent.

◆ Deserialize()

void SCR_EditableEntityComponent.Deserialize ( SCR_EditableEntityComponent  target,
int  targetValue 
)

Deserialise the entity based on given params.

Parameters
[in]targetEntity to which this entity is attached to outside of hierarchy structure, e.g., character in a vehicle or waypoint on a target
[in]targetIndexFurther specification of the target, e.g., crew position index in a vehicle

Implemented in SCR_EditableCharacterComponent, and SCR_EditableTaskComponent.

◆ Destroy()

bool SCR_EditableEntityComponent.Destroy ( )

Kill/destroy this editable entity.

Returns
true if destroyed

Implemented in SCR_EditableExplosiveChargeComponent, SCR_EditableGroupComponent, and SCR_EditableMineComponent.

◆ Detach()

void SCR_EditableEntityComponent.Detach ( notnull SCR_EditableEntityComponent  attachable)

Removes the received attachable waypoint from the attached entities (runs on parent)

Parameters
[in]attachabletarget to remove link

◆ EnableVisibilityReplication()

void SCR_EditableEntityComponent.EnableVisibilityReplication ( bool  enable)
Parameters
[in]enable

◆ EOnEditorPlace()

SCR_EditableEntityComponent SCR_EditableEntityComponent.EOnEditorPlace ( out SCR_EditableEntityComponent  parent,
SCR_EditableEntityComponent  recipient,
EEditorPlacingFlags  flags,
bool  isQueue,
int  playerID = 0 
)

Event called on server when the entity is placed in the editor.

Parameters
[out]parentEditable entity in which the new one is being created (rewrite the variable the change the parent)
[in]recipientEntity that receives this editable entity (e.g., a group receiving a waypoint)
[in]flagsPlacing flags enabled by user
[in]isQueuetrue if the entity was placed in a queue (i.e., placing remains active)
[in]playerIDID of the player placing the entity.
Returns
Editable entity which is added to editor hieraechy (can be overloaded, e.g., to provide group after spawning a character)

Implemented in SCR_EditableCharacterComponent, SCR_EditableTaskComponent, SCR_EditableVehicleComponent, and SCR_EditableWaypointComponent.

◆ EOnEditorSessionLoad()

void SCR_EditableEntityComponent.EOnEditorSessionLoad ( SCR_EditableEntityComponent  parent)

Event called on server when the session is being loaded by SCR_EditableEntityStruct.

Parameters
[in]parentEditable entity in which the new one is being created

Implemented in SCR_EditableCharacterComponent.

◆ ForceVehicleCompartments()

void SCR_EditableEntityComponent.ForceVehicleCompartments ( notnull array< ECompartmentType >  forceVehicleCompartments)

Authority Only, forces entities such as Character and Group to place characters into a specific vehicle position.

Parameters
[in]forceVehicleCompartmentscompartment types to force for entity

Implemented in SCR_EditableCharacterComponent, and SCR_EditableGroupComponent.

◆ GetAccessKey()

EEditableEntityAccessKey SCR_EditableEntityComponent.GetAccessKey ( )

Get entity's access key.

Returns
Access key

◆ GetAIEntity()

SCR_EditableEntityComponent SCR_EditableEntityComponent.GetAIEntity ( )

Get entity which represents this entity as AI.

Returns
Editable entity

Implemented in SCR_EditableCharacterComponent, SCR_EditableGroupComponent, and SCR_EditableVehicleComponent.

◆ GetAIGroup()

SCR_EditableEntityComponent SCR_EditableEntityComponent.GetAIGroup ( )

◆ GetAttachedEntities()

set< SCR_EditableEntityComponent > SCR_EditableEntityComponent.GetAttachedEntities ( )

Returns attached entities of self.

Returns
set containing the attached entities

◆ GetAttachedTo()

SCR_EditableEntityComponent SCR_EditableEntityComponent.GetAttachedTo ( )

Returns current entity which this editable task is attached to.

Returns
current entity which this editable task is attached to

Implemented in SCR_EditableTaskComponent, and SCR_EditableWaypointComponent.

◆ GetAutoRegister()

EEditableEntityRegister SCR_EditableEntityComponent.GetAutoRegister ( )
protected

◆ GetChild()

SCR_EditableEntityComponent SCR_EditableEntityComponent.GetChild ( int  index)

Get child on given index.

Parameters
[in]indexChild index
Returns
Editable entity

Implemented in SCR_EditableGroupComponent.

◆ GetChildren() [1/2]

void SCR_EditableEntityComponent.GetChildren ( out notnull set< SCR_EditableEntityComponent entities,
bool  onlyDirect,
EEditableEntityAccessKey  accessKey 
)

Get child entities with compatible key.

Parameters
[out]entitiesArray to be filled with child entities
[in]onlyDirectWhen true, only the direct descendants are returned, otherwise all children, children of children etc. are returned.
[in]accessKeyReturn only entities with at least one key matching this value

◆ GetChildren() [2/2]

void SCR_EditableEntityComponent.GetChildren ( out notnull set< SCR_EditableEntityComponent entities,
bool  onlyDirect = false,
bool  skipIgnored = false 
)

Get child entities.

Parameters
[out]entitiesArray to be filled with child entities (NOT cleared before filling)
[in]onlyDirectWhen true, only the direct descendants are returned, otherwise all children, children of children etc. are returned.
[in]skipIgnoredWhen true, entities flagged by IGNORE_LAYERS will not be included in the list

◆ GetChildrenCount()

int SCR_EditableEntityComponent.GetChildrenCount ( bool  onlyDirect = false)

Get number of child entities.

Parameters
[in]onlyDirectWhen true, return only direct children, othwise count recursively in their children as well
Returns
number of child entities

◆ GetChildrenRef()

set< SCR_EditableEntityComponent > SCR_EditableEntityComponent.GetChildrenRef ( )

Get direct reference to entity's immediate children.

Use when performance is important. DO NOT MODIFY THE LIST!

Returns
Set of child entities, or null when the entity has no children

◆ GetCrew()

int SCR_EditableEntityComponent.GetCrew ( out notnull array< CompartmentAccessComponent crewCompartmentAccess,
bool  ignorePlayers = true 
)

Get crew of vehicle or if in a vehicle get self.

Parameters
[out]crewCompartmentAccessan array of CompartmentAccessComponent of all crew memebers
[in]ignorePlayerswill never return player CompartmentAccessComponent if true
Returns
count of crew members

Implemented in SCR_EditableCharacterComponent, and SCR_EditableVehicleComponent.

◆ GetDisplayName()

string SCR_EditableEntityComponent.GetDisplayName ( )

Get entity name from info component.

When info is undefined, use entity's variable name, or, if that one is also undefined, its class name.

Returns
Type

◆ GetEditableEntity()

static SCR_EditableEntityComponent SCR_EditableEntityComponent.GetEditableEntity ( IEntity  owner)
static

Get editable entity component on given entity.

Parameters
[in]entity
Returns
Editable entity component (if the entity has one)

◆ GetEditableEntityData()

SCR_EditableEntityComponentClass SCR_EditableEntityComponent.GetEditableEntityData ( IEntity  owner = null)

Get prefab data of this editable entity.

Parameters
[in]Ownerentity of this component, used when m_Owner==null, after deletion
Returns
Component prefab data

◆ GetEntityAndChildrenBudgetCost()

bool SCR_EditableEntityComponent.GetEntityAndChildrenBudgetCost ( out notnull array< ref SCR_EntityBudgetValue outBudgets,
IEntity  owner = null 
)

Get budgets for both, entity and it's children.

Parameters
[out]outBudgetsArray to be filled with budget values

◆ GetEntityBudgetCost()

bool SCR_EditableEntityComponent.GetEntityBudgetCost ( out notnull array< ref SCR_EntityBudgetValue outBudgets,
IEntity  owner = null 
)

Get entity budget costs.

Parameters
[out]outBudgetsArray to be filled with budget values
[in]owner
Returns
true if the entity cost should be based on outBudgets array, return false to fallback on entityType cost, return true with an empty array to avoid fallback entityType cost

Implemented in SCR_EditableFactionComponent, SCR_EditableGroupComponent, and SCR_EditablePlayerDelegateComponent.

◆ GetEntityChildrenBudgetCost()

bool SCR_EditableEntityComponent.GetEntityChildrenBudgetCost ( out notnull array< ref SCR_EntityBudgetValue outBudgets,
IEntity  owner = null 
)

Get entity budget costs including cost of children (for groups/compositions)

Parameters
[out]outBudgetsArray to be filled with budget values
[in]owner
Returns
true if the entity cost should be based on outBudgets, return false to fallback on entityType cost, return true with an empty array to avoid fallback entityType cost

◆ GetEntityFlags()

EEditableEntityFlag SCR_EditableEntityComponent.GetEntityFlags ( )

Get entity flags.

Returns
Entity flags

◆ GetEntityInteraction()

SCR_EditableEntityInteraction SCR_EditableEntityComponent.GetEntityInteraction ( IEntity  owner = null)

Get entity interaction rules of this entity.

If it doesn't contain any custom rules, those for its type will be used.

Returns
Interaction rules

◆ GetEntityStates()

EEditableEntityState SCR_EditableEntityComponent.GetEntityStates ( )

Check bit array with all currently active states.

Returns
Bit array

◆ GetEntityType()

EEditableEntityType SCR_EditableEntityComponent.GetEntityType ( IEntity  owner = null)

Get entity type.

Avoid basing your functionality on specific entity types! If everyone checked for specific types, adding a new type would mean all conditions have to be revised. Instead, base your system on a function inside this class. Such function can be overrided by inherited classes to give desired result.

Parameters
[in]Ownerentity of this component
Returns
Type

Implemented in SCR_EditablePlayerDelegateComponent, and SCR_EditablePreviewComponent.

◆ GetFaction()

Faction SCR_EditableEntityComponent.GetFaction ( )

◆ GetHealth()

float SCR_EditableEntityComponent.GetHealth ( )

Get entity health.

Returns
Health value in range 0-1

Implemented in SCR_EditablePlayerDelegateComponent.

◆ GetIconPos()

vector SCR_EditableEntityComponent.GetIconPos ( )

Get icon offset.

Parameters
[in]Offset

◆ GetInfo()

SCR_UIInfo SCR_EditableEntityComponent.GetInfo ( IEntity  owner = null)

Get information about the entity.

When none exist, create a dummy one.

Returns
Info class

Implemented in SCR_EditablePlayerDelegateComponent, and SCR_EditablePreviewComponent.

◆ GetLocalTransform()

bool SCR_EditableEntityComponent.GetLocalTransform ( out vector  outTransform[4])

Get local transformation matrix of editable entity.

Parameters
[out]outTransformTransformation matrix

◆ GetLogText()

string SCR_EditableEntityComponent.GetLogText ( string  prefix = "")
Parameters
[in]prefix
Returns

Implemented in SCR_EditablePlayerDelegateComponent.

◆ GetMaxDrawDistanceSq()

float SCR_EditableEntityComponent.GetMaxDrawDistanceSq ( )

Get squared maximum distance in which this entity is drawn in editor (e.g., with an icon).

Returns
Squared distance in metres

Implemented in SCR_EditableCharacterComponent.

Examples
d:/jenkins/workspace/ar_data_branches_stable_1.2.0/A4Data/scripts/Game/Editor/Containers/EditableEntityFilters/SCR_RenderedEditableEntityFilter.c.

◆ GetOnDeleted()

ScriptInvokerEntity SCR_EditableEntityComponent.GetOnDeleted ( )

Get event called when entity is deleted.

Returns
Script invoker

◆ GetOnUIRefresh()

ScriptInvoker SCR_EditableEntityComponent.GetOnUIRefresh ( )

Get event called when GUI should refresh entity's GUI, i.e., update faction color and call events in GUI widgets.

To be overridden by inherited classes.

Returns
Script invoker

Implemented in SCR_EditableCharacterComponent, SCR_EditableGroupComponent, SCR_EditableSpawnPointComponent, SCR_EditableSystemComponent, SCR_EditableTaskComponent, and SCR_EditableVehicleComponent.

◆ GetOnUIReset()

ScriptInvoker SCR_EditableEntityComponent.GetOnUIReset ( )

Get event called when GUI should reset widgets that are used for entity visualization.

To be overridden by inherited classes.

Returns
Script invoker

Implemented in SCR_EditablePlayerDelegateComponent.

◆ GetOwnerRplId()

RplId SCR_EditableEntityComponent.GetOwnerRplId ( )
Returns

◆ GetOwnerScripted()

GenericEntity SCR_EditableEntityComponent.GetOwnerScripted ( )
Returns
Owner entity.

Implemented in SCR_EditableWorldEntityComponent.

◆ GetParentEntities()

void SCR_EditableEntityComponent.GetParentEntities ( out notnull array< SCR_EditableEntityComponent entities)

Get hierarchy of all parent entities, all the way to the root.

Parameters
[out]entitiesArray to be filled with parent entities

◆ GetParentEntity()

SCR_EditableEntityComponent SCR_EditableEntityComponent.GetParentEntity ( )

◆ GetPlayerID()

int SCR_EditableEntityComponent.GetPlayerID ( )

Get player controlling this entity.

Returns
Player ID

Implemented in SCR_EditableCharacterComponent, SCR_EditablePlayerDelegateComponent, and SCR_EditableVehicleComponent.

◆ GetPos()

bool SCR_EditableEntityComponent.GetPos ( out vector  pos)

◆ GetPrefab()

ResourceName SCR_EditableEntityComponent.GetPrefab ( bool  shorten = false)

Get entity prefab.

Parameters
[in]shortenTrue to include only GUID, not file path
Returns
Prefab path

◆ GetRplComponent()

RplComponent SCR_EditableEntityComponent.GetRplComponent ( )
protected

◆ GetStatic()

bool SCR_EditableEntityComponent.GetStatic ( )

Check if the entity is marked as static.

Returns
true if static

◆ GetTransform()

bool SCR_EditableEntityComponent.GetTransform ( out vector  outTransform[4])

Get world transformation matrix of editable entity.

Parameters
[out]outTransformTransformation matrix

◆ GetVehicle()

SCR_EditableEntityComponent SCR_EditableEntityComponent.GetVehicle ( )

Get vehicle the entity's in.

Returns
Editable entity of the vehicle

Implemented in SCR_EditableCharacterComponent, and SCR_EditablePlayerDelegateComponent.

◆ GetVisibleInHierarchy()

bool SCR_EditableEntityComponent.GetVisibleInHierarchy ( )

Check visibility setting of the entity in hierarchy (e.g., if an entity is set as visible, but its parent is not, false will be returned).

Returns
true if the entity is visible in hierarchy

◆ GetVisibleSelf()

bool SCR_EditableEntityComponent.GetVisibleSelf ( )

Check visibility setting of the entity.

Returns
true if the entity is set as visible

◆ HasAccessInHierarchy() [1/2]

bool SCR_EditableEntityComponent.HasAccessInHierarchy ( )

Check access key of the entity in hierarchy (e.g., if an entity is compatible, but its parent is not, false will be returned).

Compared with the key defined in SCR_AccessKeysEditorComponent.

Returns
true if given access key and entity's access key are compatible

◆ HasAccessInHierarchy() [2/2]

bool SCR_EditableEntityComponent.HasAccessInHierarchy ( EEditableEntityAccessKey  accessKey)

Check acces keys of the entity in hierarchy (e.g., if an entity is compatible, but its parent is not, false will be returned).

Parameters
[in]accessKeyAccess key which be checked in entity's access key
Returns
true if given access key and entity's access key is compatible

◆ HasAccessSelf() [1/2]

bool SCR_EditableEntityComponent.HasAccessSelf ( )

Check access key of the entity compared to those defined in SCR_AccessKeysEditorComponent.

Returns
true if given access key and entity's access key are compatible

◆ HasAccessSelf() [2/2]

bool SCR_EditableEntityComponent.HasAccessSelf ( EEditableEntityAccessKey  accessKey)

Check access key of the entity.

Parameters
[in]accessKeyAccess key which be checked in entity's access key
Returns
true if given access key and entity's access key is compatible

◆ HasEntityFlag()

bool SCR_EditableEntityComponent.HasEntityFlag ( EEditableEntityFlag  flag)

Check if a flag is active.

Parameters
[in]flag
Returns
true if the flag is active

◆ HasEntityState()

bool SCR_EditableEntityComponent.HasEntityState ( EEditableEntityState  state)

Check if given entity state is active.

Parameters
[in]state
Returns
true if the state is active
Examples
d:/jenkins/workspace/ar_data_branches_stable_1.2.0/A4Data/scripts/Game/Editor/Containers/EditableEntityFilters/SCR_RenderedEditableEntityFilter.c.

◆ IsAttachable()

bool SCR_EditableEntityComponent.IsAttachable ( )

Returns if current entity is attachable.

Returns
bool

Implemented in SCR_EditableTaskComponent, and SCR_EditableWaypointComponent.

◆ IsAttached()

bool SCR_EditableEntityComponent.IsAttached ( )

Returns if current entity is attached.

Returns
bool

Implemented in SCR_EditableTaskComponent, and SCR_EditableWaypointComponent.

◆ IsChildOf()

bool SCR_EditableEntityComponent.IsChildOf ( SCR_EditableEntityComponent  entity)

Check if the entity is in hierarchy of given entity.

Parameters
[in]entityQueried entity
Returns
true if it's in entity's hierarchy.

◆ IsDestroyed()

bool SCR_EditableEntityComponent.IsDestroyed ( )

Check if the entity is destroyed.

Returns
true when destroyed

Implemented in SCR_EditableExplosiveChargeComponent, SCR_EditableGroupComponent, and SCR_EditableMineComponent.

◆ IsLayer()

bool SCR_EditableEntityComponent.IsLayer ( )

Check if the entity is also a layer, i.e., has some child entities.

Returns
true when layer.

◆ IsRegistered()

bool SCR_EditableEntityComponent.IsRegistered ( )

Check if the entity is registered.

Registered entity is a child of either root in SCR_EditableEntityCore or one of already registered entities.

Returns
true when registered

◆ IsReplicated()

bool SCR_EditableEntityComponent.IsReplicated ( out RplId  replicationID = -1)

Check component's replication.

Show an error when it's not registered for replication (e.g., RplComponent is missing)

Parameters
[out]replicationIDID used by Replication.FindItem()
Returns
true if replicated

◆ IsServer()

bool SCR_EditableEntityComponent.IsServer ( )
protected

◆ Log() [1/2]

void SCR_EditableEntityComponent.Log ( string  prefix,
EEditableEntityAccessKey  accessKey 
)

Print out the entity and all its descendants which are compatible with given key.

Parameters
[in]prefixText added before the printed text
[in]accessKeyAccess key which be checked in entity's access key

◆ Log() [2/2]

void SCR_EditableEntityComponent.Log ( string  prefix = "",
bool  onlyDirect = false,
LogLevel  logLevel = LogLevel::DEBUG 
)

Print out entity information.

Parameters
[in]prefixText added before the printed text
[in]onlyDirectWhen true, only the direct descendants are logged, otherwise all children, children of children etc. are logged.
[in]logLevelLog level type

◆ LogAccessKey()

void SCR_EditableEntityComponent.LogAccessKey ( )

Print out entity's access key.

◆ OnAccessKeyChanged()

void SCR_EditableEntityComponent.OnAccessKeyChanged ( EEditableEntityAccessKey  accessKey)
protected

◆ OnChildEntityChanged()

void SCR_EditableEntityComponent.OnChildEntityChanged ( SCR_EditableEntityComponent  child,
bool  isAdded 
)
protected

Implemented in SCR_EditableGroupComponent.

◆ OnCreatedServer()

void SCR_EditableEntityComponent.OnCreatedServer ( notnull SCR_PlacingEditorComponent  placedEditorComponent)
Parameters
[in]placedEditorComponent

Implemented in SCR_EditableGroupComponent.

◆ OnDelete()

override void SCR_EditableEntityComponent.OnDelete ( IEntity  owner)

◆ OnParentEntityChanged()

void SCR_EditableEntityComponent.OnParentEntityChanged ( SCR_EditableEntityComponent  parentEntity,
SCR_EditableEntityComponent  parentEntityPrev,
bool  changedByUser 
)
protected

◆ OnPostInit()

override void SCR_EditableEntityComponent.OnPostInit ( IEntity  owner)

◆ OnRegistrationChanged()

void SCR_EditableEntityComponent.OnRegistrationChanged ( bool  toRegister)
protected

◆ OnRplVisibilityChanged()

void SCR_EditableEntityComponent.OnRplVisibilityChanged ( )

◆ OnVisibilityChanged()

void SCR_EditableEntityComponent.OnVisibilityChanged ( )
protected

◆ Refresh()

void SCR_EditableEntityComponent.Refresh ( )
protected

◆ Register()

void SCR_EditableEntityComponent.Register ( )
protected

◆ RemoveAccessKey()

void SCR_EditableEntityComponent.RemoveAccessKey ( EEditableEntityAccessKey  accessKey)

Remove access key.

Available only on server!

Parameters
[in]accessKeyKey to be removed

◆ RemoveChild()

void SCR_EditableEntityComponent.RemoveChild ( SCR_EditableEntityComponent  entity)
protected

◆ RemoveFromParent()

void SCR_EditableEntityComponent.RemoveFromParent ( SCR_EditableEntityComponent  parentEntity,
bool  changedByUser 
)
protected

◆ RemoveParentEntity()

void SCR_EditableEntityComponent.RemoveParentEntity ( )

Remove entity from its parent.

This will unregister the entity from the system, making it not editable. Later, it can be enabled again by adding it to editable parent.

◆ ResetEntityStates()

void SCR_EditableEntityComponent.ResetEntityStates ( )

Reset all entity states.

◆ RestoreParentEntity()

void SCR_EditableEntityComponent.RestoreParentEntity ( )

Add the entity to its previous parent after it was unregistered using RemoveParentEntity() Allowed only on server.

◆ RplLoad()

override bool SCR_EditableEntityComponent.RplLoad ( ScriptBitReader  reader)

◆ RplSave()

override bool SCR_EditableEntityComponent.RplSave ( ScriptBitWriter  writer)

◆ Serialize()

bool SCR_EditableEntityComponent.Serialize ( out SCR_EditableEntityComponent  outTarget = null,
out int  outTargetIndex = -1,
out EEditableEntitySaveFlag  outSaveFlags = 0 
)

Check if the entity can be serialized during session saving managed by SCR_EditableEntityStruct.

Parameters
[out]targetEntity to which this entity is attached to outside of hierarchy structure, e.g., character in a vehicle or waypoint on a target
[out]targetIndexFurther specification of the target, e.g., crew position index in a vehicle
[out]isDestroyedVariable to be set to true if the entity is destroyed
Returns
true if it can be serialized

Implemented in SCR_EditableCharacterComponent, and SCR_EditableTaskComponent.

◆ SetEntityFlag()

void SCR_EditableEntityComponent.SetEntityFlag ( EEditableEntityFlag  flag,
bool  toSet 
)

Set entity flag.

Parameters
[in]flagFlag type
Returns
toSet True to set the flag

◆ SetEntityState()

void SCR_EditableEntityComponent.SetEntityState ( EEditableEntityState  state,
bool  toSet 
)

Set value of an entity state.

Multiple states can exist at the same time (e.g., HOVER and SELECTED).

State has only informational value! For example setting it to SELECTED will not actually select the entity.

Parameters
[in]stateTarget state
[in]toSetTrue to activate the state, false to deactivate

◆ SetEntityStateInChildren()

void SCR_EditableEntityComponent.SetEntityStateInChildren ( IEntity  owner,
EEditableEntityState  state,
bool  toSet,
out array< Managed >  components = null 
)
protected

◆ SetHierarchyAsDirty()

void SCR_EditableEntityComponent.SetHierarchyAsDirty ( )

Mark entity hierarchy as dirty, i.e., modified by user.

Used for example to evaluate if the entity should be saved into a save file in its entirety.

◆ SetHierarchyAsDirtyInParents()

void SCR_EditableEntityComponent.SetHierarchyAsDirtyInParents ( )

Mark hierarchy in all parents of the entity as dirty, i.e., modified by user.

Used for example to evaluate if the entity should be saved into a save file in its entirety.

◆ SetInfoInstance()

void SCR_EditableEntityComponent.SetInfoInstance ( SCR_UIInfo  info)

Set information about the entity on entity instance, locally on this machine.

This is a weak ref! The info needs to be held somewhere else, the entity will merely link to it.

Parameters
[in]infoInfo class

◆ SetMaxDrawDistance()

void SCR_EditableEntityComponent.SetMaxDrawDistance ( float  maxDrawDistance)

Set maximum distance in which this entity is drawn in editor (e.g., with an icon).

Parameters
[in]maxDrawDistanceDistance in metres

◆ SetParentEntity()

SCR_EditableEntityComponent SCR_EditableEntityComponent.SetParentEntity ( SCR_EditableEntityComponent  parentEntity,
bool  changedByUser = false 
)

Set parent of the entity.

When placed inside a parent, the entity will inherit some of its settings, like access key or visibility settings. Changing it is allowed only on server.

Parameters
[in]parentEntityNew parent. When null, the entity will be moved to the root.
[in]changedByUserTrue when the change was initiated by user
Returns
New parent (in case it changes inside)

Implemented in SCR_EditableCharacterComponent.

◆ SetParentEntityBroadcast()

void SCR_EditableEntityComponent.SetParentEntityBroadcast ( SCR_EditableEntityComponent  parentEntity,
SCR_EditableEntityComponent  parentEntityPrev,
bool  changedByUser = false,
bool  isAutoRegistration = false 
)
protected

◆ SetParentEntityBroadcastReceive()

void SCR_EditableEntityComponent.SetParentEntityBroadcastReceive ( RplId  parentEntityID,
RplId  parentEntityPrevID,
bool  changedByUser 
)
protected

◆ SetStatic()

void SCR_EditableEntityComponent.SetStatic ( bool  isStatic)

Set entity as static.

When static, entity's position is not calculated each frame. Instead, cached position is used. Calling this function with isStatic=true refreshes cached position based on the current position. Use only for entities that are not expected to move! Certain entity types cannot be set as static, and this command will ignore them. Ignored types are GROUP, CHARACTER and VEHICLE.

Parameters
[in]isStaticTrue to set as static

◆ SetTransform()

void SCR_EditableEntityComponent.SetTransform ( vector  transform[4],
bool  changedByUser = false 
)

Update entity's transformation and broadcast the changes to all clients.

Parameters
[in]transformTarget transformation
[in]changedByUserTrue when the change was initiated by user

Implemented in SCR_EditableCharacterComponent, SCR_EditableSpawnPointComponent, SCR_EditableTaskComponent, SCR_EditableVehicleComponent, and SCR_EditableWaypointComponent.

◆ SetTransformBroadcast()

void SCR_EditableEntityComponent.SetTransformBroadcast ( vector  transform[4])
protected

◆ SetTransformOwner()

void SCR_EditableEntityComponent.SetTransformOwner ( vector  transform[4])
protected

◆ SetTransformWithChildren()

void SCR_EditableEntityComponent.SetTransformWithChildren ( vector  transform[4])

Update transformation of the entity and all its editor children and broadcast the changes to all clients.

Parameters
[in]transformTarget transformation

◆ SetVisible()

void SCR_EditableEntityComponent.SetVisible ( bool  show)

Set entity visibility.

When set to false, the entity will not be shown to the user. Visibility is local to editor user.

Parameters
[in]showtrue to show, false to hide

◆ Unregister()

void SCR_EditableEntityComponent.Unregister ( IEntity  owner = null)
protected

◆ UpdateGameHierarchy()

void SCR_EditableEntityComponent.UpdateGameHierarchy ( IEntity  parent,
IEntity  child,
bool  toAdd 
)
protected

◆ UpdateStaticPos()

void SCR_EditableEntityComponent.UpdateStaticPos ( )

Update static cached position.

Doesn't do anything when the entity is not marked as static.

◆ ValidateType()

bool SCR_EditableEntityComponent.ValidateType ( )
protected

Member Data Documentation

◆ m_aAttachedEntities

ref set<SCR_EditableEntityComponent> SCR_EditableEntityComponent.m_aAttachedEntities
protected

◆ m_AccessKey

EEditableEntityAccessKey SCR_EditableEntityComponent.m_AccessKey
protected

◆ m_bAutoRegister

EEditableEntityRegister SCR_EditableEntityComponent.m_bAutoRegister
protected

◆ m_bEnabledVisibilityReplication

bool SCR_EditableEntityComponent.m_bEnabledVisibilityReplication
protected

◆ m_bStatic

bool SCR_EditableEntityComponent.m_bStatic
protected

◆ m_bVisible

bool SCR_EditableEntityComponent.m_bVisible
protected

◆ m_Entities

ref set<SCR_EditableEntityComponent> SCR_EditableEntityComponent.m_Entities
protected

◆ m_EntityState

EEditableEntityState SCR_EditableEntityComponent.m_EntityState
protected

◆ m_Flags

EEditableEntityFlag SCR_EditableEntityComponent.m_Flags
protected

◆ m_fMaxDrawDistance

float SCR_EditableEntityComponent.m_fMaxDrawDistance
protected

◆ m_iIconBoneIndex

int SCR_EditableEntityComponent.m_iIconBoneIndex = -1
protected

◆ m_OnDeleted

ref ScriptInvokerEntity SCR_EditableEntityComponent.m_OnDeleted
protected

◆ m_Owner

GenericEntity SCR_EditableEntityComponent.m_Owner
protected

◆ m_ParentEntity

SCR_EditableEntityComponent SCR_EditableEntityComponent.m_ParentEntity
protected

◆ m_UIInfoInstance

SCR_UIInfo SCR_EditableEntityComponent.m_UIInfoInstance
protected

◆ m_vIconPos

vector SCR_EditableEntityComponent.m_vIconPos
protected

◆ m_vStaticPos

vector SCR_EditableEntityComponent.m_vStaticPos
protected

The documentation for this interface was generated from the following file: