Arma Reforger Script API
|
Public Member Functions | |
void | SetPlacingBlocked (bool blocked) |
int | GetPrefabID (ResourceName prefab) |
bool | CreateEntity (bool unselectPrefab=true, bool canBePlayer=false, SCR_EditableEntityComponent holder=null) |
Create entity exactly where the preview entity is. | |
bool | CreateEntity (ResourceName prefab, SCR_EditorPreviewParams param, bool unselectPrefab=true, bool canBePlayer=false, set< SCR_EditableEntityComponent > recipients=null, SCR_EditableEntityComponent holder=null) |
Create entity with custom params. | |
bool | IsThereEnoughBudgetToSpawn (IEntityComponentSource entitySource) |
bool | CanCreateEntity (out ENotification outNotification=-1, inout SCR_EPreviewState previewStateToShow=SCR_EPreviewState.PLACEABLE) |
Check if the entity can be created. | |
void | SetInstantPlacing (SCR_EditorPreviewParams param) |
Set instant placing parameters. | |
bool | SetSelectedPrefab (ResourceName prefab="", bool onConfirm=false, bool showBudgetMaxNotification=true, set< SCR_EditableEntityComponent > recipients=null) |
Set currently placed prefab. | |
ResourceName | GetSelectedPrefab () |
Get currently placed prefab. | |
bool | IsPlacing () |
void | SetSlot (SCR_SiteSlotEntity slot) |
Attach plcing preview to a slot. | |
SCR_SiteSlotEntity | GetSlot () |
Get slot which placing preview is currently attached to. | |
void | SetPlacingFlag (EEditorPlacingFlags flag, bool toAdd) |
Set value of placing flag. | |
void | TogglePlacingFlag (EEditorPlacingFlags flag) |
Toggle value of placing flag. | |
bool | HasPlacingFlag (EEditorPlacingFlags flag) |
Check if placing flag is active. | |
bool | IsPlacingFlagCompatible (EEditorPlacingFlags flag) |
Check if placing flag is compatible with currently placed entity. | |
bool | IsPlacingFlagAllowed (EEditorPlacingFlags flag) |
Check if placing flag is allowed in placing manager settings. | |
ScriptInvoker | GetOnSelectedPrefabChange () |
Get invoker called when selected prefab changes. | |
ScriptInvoker | GetOnPlacingFlagsChange () |
Get event called when placing flags change. | |
ScriptInvoker | GetOnRequestEntity () |
Get event called when request for placing an entity is sent to server. | |
ScriptInvoker | GetOnPlaceEntity () |
Get event called when an entity is placed. | |
ScriptInvoker | GetOnPlaceEntityServer () |
override void | EOnEditorDebug (array< string > debugTexts) |
Every frame while the editor is opened and debug menu is shown. | |
override void | EOnEditorActivate () |
When the component is activated. | |
override void | EOnEditorDeactivate () |
When the component is deactivated. | |
void | SetCycleWaypoints (notnull set< SCR_EditableGroupComponent > selectedGroups, bool value) |
Sets the cycle waypoints to the given value on each group of the array. | |
![]() | |
void | OnInitBase () |
void | OnDeleteBase () |
void | OnRequestBase (bool isOpen) |
void | OnOpenedBase () |
void | OnClosedBase () |
void | OnPreActivateBase () |
void | OnActivateBase () |
bool | OnActivateAsyncBase (int attempt) |
void | OnPostActivateBase () |
void | OnDeactivateBase () |
void | OnPostDeactivateBase () |
bool | OnDeactivateAsyncBase (int attempt) |
void | OnEffectBase (SCR_BaseEditorEffect effect) |
SCR_EditorManagerEntity | GetManager () |
Get editor manager this component belongs to. | |
SCR_BaseEditorComponent | FindEditorComponent (TypeName type, bool showError=false, bool modeFirst=false) |
Get the editor manager to which this component belongs. | |
EntityComponentPrefabData | GetEditorComponentData () |
Get prefab data of this component. | |
bool | IsRemoved () |
Check if the component is being deleted. | |
void | ResetEditorComponent () |
Reset values controlled by the component. | |
ScriptInvoker | GetOnEffect () |
Get event called when an effect is activated. | |
void | InitServer () |
void | InitOwner () |
override void | OnPostInit (IEntity owner) |
void | SCR_BaseEditorComponent (IEntityComponentSource src, IEntity ent, IEntity parent) |
void | ~SCR_BaseEditorComponent () |
Static Public Member Functions | |
static SCR_EditableEntityComponent | SpawnEntityResource (ResourceName prefab, vector transform[4]) |
Create entity from prefab resource. | |
static SCR_EditableEntityComponent | SpawnEntityResource (SCR_EditorPreviewParams params, Resource prefabResource, int playerID=0, bool isQueue=false, SCR_EditableEntityComponent recipient=null, bool canBePlayer=false) |
Create entity with given params. | |
![]() | |
static Managed | GetInstance (TypeName type, bool showError=false, bool modeFirst=false) |
Get the local instance of a component attached on editor manager (SCR_EditorManagerEntity). | |
static Managed | GetInstance (SCR_EditorBaseEntity editorManager, TypeName type, bool showError=false) |
Get instance of a component attached on specific editor manager / mode (SCR_EditorBaseEntity). | |
static int | GetAllInstances (TypeName type, out notnull array< Managed > outComponents) |
Get component instances on editor manager (SCR_EditorBaseEntity) and all its modes (SCR_EditorModeEntity). | |
Static Public Attributes | |
static SCR_PlacingEditorComponent | serverPlacingEditorComponent |
static bool | m_accumulatedBudgetChangesClearQueued = false |
Protected Member Functions | |
void | CreateEntityServer (SCR_EditorPreviewParams params, RplId prefabID, int playerID, int entityIndex, bool isQueue, array< RplId > recipientIds, bool canBePlayer, RplId holderId) |
void | CreateEntityOwner (int prefabID, array< RplId > entityIds, int entityIndex, int isQueue, bool hasRecipients, RplId currentLayerID, int attempt) |
void | OnBeforeEntityCreatedServer (ResourceName prefab) |
Function called right before entities are created on server. | |
void | OnEntityCreatedServer (array< SCR_EditableEntityComponent > entities) |
Function called when entities are created on server. | |
void | CheckBudgetOwner () |
void | OnBudgetMaxReached (EEditableEntityBudget entityBudget, bool maxReached) |
bool | CanPlaceEntityServer (IEntityComponentSource editableEntitySource, out EEditableEntityBudget blockingBudget, bool updatePreview, bool showNotification) |
bool | CanSelectEntityPrefab (ResourceName prefab, out EEditableEntityBudget blockingBudget, bool updatePreview=true, bool showBudgetMaxNotification=true) |
array< vector > | GetOffsets (int count) |
void | OnEntityUnregistered (SCR_EditableEntityComponent entity) |
void | UpdatePlacingFlagBudget (ResourceName selectedPrefab, EEditorPlacingFlags flagChanged, EEditorPlacingFlags currentPlacingFlag, EEditorPlacingFlags prevPlacingFlag) |
Update budget with given placing flags. | |
override void | EOnEditorInitServer () |
When the entity is created (called on server) | |
override void | EOnEditorDeleteServer () |
When the entity is destroyed (called on server) | |
void | SetCycleWaypointsServer (array< RplId > selectedGroups, bool value) |
![]() | |
bool | IsOnEditorManager () |
bool | IsOwner () |
bool | IsProxy () |
bool | IsMaster () |
bool | IsAdmin () |
SCR_BaseEditorComponent | GetParentComponent () |
void | SetParentComponent (SCR_BaseEditorComponent parent) |
void | SendNotification (ENotification notificationID, int selfID=0, int targetID=0, vector position=vector.Zero) |
void | EOnEditorInit () |
When the entity is created. | |
void | EOnEditorDelete () |
When the entity is destroyed. | |
void | EOnEditorRequest (bool isOpen) |
When opening/closing request is sent to server. | |
void | EOnEditorOpen () |
When the editor is opened. | |
void | EOnEditorClose () |
When the editor is closed. | |
void | EOnEditorPreActivate () |
Before the component is activated. | |
bool | EOnEditorActivateAsync (int attempt) |
When the component is activated. | |
void | EOnEditorPostActivate () |
When the component is activated, but after EOnEditorActivate() function was called in all components. | |
bool | EOnEditorDeactivateAsync (int attempt) |
When the component is deactivated. | |
void | EOnEditorPostDeactivate () |
When the component is deactivated, but after the next mode is activated. | |
void | EOnEffect (SCR_BaseEditorEffect effect) |
When an effect is created in reaction an an event. | |
void | EOnEditorOpenServer () |
When the editor is opened (called on server) | |
void | EOnEditorOpenServerCallback () |
When the editor is opened (called on server after async loading finished on client) | |
void | EOnEditorCloseServer () |
When the editor is closed (called on server) | |
void | EOnEditorCloseServerCallback () |
When the editor is closed (called on server after async loading finished on client) | |
void | EOnEditorActivateServer () |
When the component is activated (called on server) | |
void | EOnEditorDeactivateServer () |
When the component is deactivated (called on server) | |
Static Protected Member Functions | |
static void | ClearAccumulatedBudgetChanges () |
static void | OnAIGroupAllEntitiesSpawned (SCR_AIGroup group) |
Callback reacting to all delayed spawned entities being created. | |
static EEditorPlacingFlags | GetCompatiblePlacingFlags (Resource prefabResource) |
Protected Attributes | |
float | m_fSpacing |
SCR_PreviewEntityEditorComponent | m_PreviewManager |
SCR_BudgetEditorComponent | m_BudgetManager |
SCR_EditableEntityCore | m_editableEntityCore |
ref SCR_EditorPreviewParams | m_InstantPlacingParam |
bool | m_bBlockPlacing |
![]() | |
SCR_EditorBaseEntity | m_Owner |
SCR_EditorManagerEntity | m_Manager |
SCR_BaseEditorComponent | m_Parent |
RplComponent | m_RplComponent |
Static Protected Attributes | |
static SCR_EditableEntityComponent | m_DelayedSpawnEntity |
static ref SCR_EditorPreviewParams | m_DelayedSpawnPreviewParams |
static ref map< EEditableEntityBudget, int > | m_accumulatedBudgetChanges = new map<EEditableEntityBudget, int> |
bool SCR_PlacingEditorComponent.CanCreateEntity | ( | out ENotification | outNotification = -1, |
inout SCR_EPreviewState | previewStateToShow = SCR_EPreviewState::PLACEABLE ) |
Check if the entity can be created.
Evaluated both on client an on server (notification is used only on client though) To be overridden by inherited classes.
[out] | outNotification | Notification to be sent when attempting to place the entity |
Implemented in SCR_CampaignBuildingPlacingEditorComponent.
|
protected |
|
protected |
|
protected |
|
staticprotected |
bool SCR_PlacingEditorComponent.CreateEntity | ( | bool | unselectPrefab = true, |
bool | canBePlayer = false, | ||
SCR_EditableEntityComponent | holder = null ) |
Create entity exactly where the preview entity is.
The entity is created from a prefab defined by SetSelectedPrefab().
unselectPrefab | True to unselect prefab after placing the entity |
canBePlayer | True if the entity should be spawned as player |
bool SCR_PlacingEditorComponent.CreateEntity | ( | ResourceName | prefab, |
SCR_EditorPreviewParams | param, | ||
bool | unselectPrefab = true, | ||
bool | canBePlayer = false, | ||
set< SCR_EditableEntityComponent > | recipients = null, | ||
SCR_EditableEntityComponent | holder = null ) |
Create entity with custom params.
prefab | Entity prefab | |
param | Preview param | |
unselectPrefab | True to unselect prefab after placing the entity | |
canBePlayer | True if the entity should be spawned as player | |
recipients | Array of entities for whom new entities will be created (e.g., waypoints for groups) | |
[in] | holder | Entity to which the spawned entity will be attached (used in waypoints and tasks) |
|
protected |
|
protected |
Implemented in SCR_CampaignBuildingPlacingEditorComponent.
override void SCR_PlacingEditorComponent.EOnEditorActivate | ( | ) |
When the component is activated.
Implements SCR_BaseEditorComponent.
Implemented in SCR_CampaignBuildingPlacingEditorComponent.
override void SCR_PlacingEditorComponent.EOnEditorDeactivate | ( | ) |
When the component is deactivated.
Implements SCR_BaseEditorComponent.
override void SCR_PlacingEditorComponent.EOnEditorDebug | ( | array< string > | debugTexts | ) |
Every frame while the editor is opened and debug menu is shown.
Implements SCR_BaseEditorComponent.
|
protected |
When the entity is destroyed (called on server)
Implements SCR_BaseEditorComponent.
|
protected |
When the entity is created (called on server)
Implements SCR_BaseEditorComponent.
|
staticprotected |
|
protected |
ScriptInvoker SCR_PlacingEditorComponent.GetOnPlaceEntity | ( | ) |
Get event called when an entity is placed.
Called only for editor user.
ScriptInvoker SCR_PlacingEditorComponent.GetOnPlaceEntityServer | ( | ) |
ScriptInvoker SCR_PlacingEditorComponent.GetOnPlacingFlagsChange | ( | ) |
Get event called when placing flags change.
Called only for editor user.
ScriptInvoker SCR_PlacingEditorComponent.GetOnRequestEntity | ( | ) |
Get event called when request for placing an entity is sent to server.
Called only for editor user.
ScriptInvoker SCR_PlacingEditorComponent.GetOnSelectedPrefabChange | ( | ) |
Get invoker called when selected prefab changes.
int SCR_PlacingEditorComponent.GetPrefabID | ( | ResourceName | prefab | ) |
ResourceName SCR_PlacingEditorComponent.GetSelectedPrefab | ( | ) |
Get currently placed prefab.
SCR_SiteSlotEntity SCR_PlacingEditorComponent.GetSlot | ( | ) |
Get slot which placing preview is currently attached to.
bool SCR_PlacingEditorComponent.HasPlacingFlag | ( | EEditorPlacingFlags | flag | ) |
Check if placing flag is active.
flag | Placing flag |
bool SCR_PlacingEditorComponent.IsPlacing | ( | ) |
bool SCR_PlacingEditorComponent.IsPlacingFlagAllowed | ( | EEditorPlacingFlags | flag | ) |
Check if placing flag is allowed in placing manager settings.
flag | Placing flag |
bool SCR_PlacingEditorComponent.IsPlacingFlagCompatible | ( | EEditorPlacingFlags | flag | ) |
Check if placing flag is compatible with currently placed entity.
flag | Placing flag |
bool SCR_PlacingEditorComponent.IsThereEnoughBudgetToSpawn | ( | IEntityComponentSource | entitySource | ) |
Implemented in SCR_CampaignBuildingPlacingEditorComponent.
|
staticprotected |
Callback reacting to all delayed spawned entities being created.
|
protected |
Function called right before entities are created on server.
To be overloaded by inherited classes.
prefab | Prefab that entities to be created will use |
Implemented in SCR_CampaignBuildingPlacingEditorComponent.
|
protected |
|
protected |
Function called when entities are created on server.
To be overloaded by inherited classes.
entities | Array of created entities |
Implemented in SCR_CampaignBuildingPlacingEditorComponent.
|
protected |
void SCR_PlacingEditorComponent.SetCycleWaypoints | ( | notnull set< SCR_EditableGroupComponent > | selectedGroups, |
bool | value ) |
Sets the cycle waypoints to the given value on each group of the array.
[in] | selectedGroups | array of groups not null |
[in] | value | of type bool |
|
protected |
void SCR_PlacingEditorComponent.SetInstantPlacing | ( | SCR_EditorPreviewParams | param | ) |
Set instant placing parameters.
When defined, selected entity will be placed immediatelly.
param | Placing param |
void SCR_PlacingEditorComponent.SetPlacingBlocked | ( | bool | blocked | ) |
void SCR_PlacingEditorComponent.SetPlacingFlag | ( | EEditorPlacingFlags | flag, |
bool | toAdd ) |
Set value of placing flag.
Placing | flag |
toAdd | True to set the flag, false to unset it |
bool SCR_PlacingEditorComponent.SetSelectedPrefab | ( | ResourceName | prefab = "", |
bool | onConfirm = false, | ||
bool | showBudgetMaxNotification = true, | ||
set< SCR_EditableEntityComponent > | recipients = null ) |
Set currently placed prefab.
prefab | Prefab. Must be registered! |
void SCR_PlacingEditorComponent.SetSlot | ( | SCR_SiteSlotEntity | slot | ) |
Attach plcing preview to a slot.
slot | Slot entity |
|
static |
Create entity from prefab resource.
prefab | Entity prefab |
transform | Spawning transformation matrix |
|
static |
Create entity with given params.
params | Spawning params \prefabResource Prefab which will be spawned \playerID Id of entity requested spawning. \recipient Currently selected entity for whom the new entity is added (e.g., new waypoint for a group) \canBePlayer When true, spawned entity will become the player |
void SCR_PlacingEditorComponent.TogglePlacingFlag | ( | EEditorPlacingFlags | flag | ) |
Toggle value of placing flag.
flag | Placing flag |
|
protected |
Update budget with given placing flags.
selectedPrefab | Current selected prefab resource |
flagChanged | Flag that was changed |
currentPlacingFlag | Current placing flags |
prevPlacingFlag | The placing flags that where active before new flags are set |
|
staticprotected |
|
static |
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |