Arma Reforger Script API
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SCR_CampaignBuildingPlacingEditorComponent Interface Reference
Inheritance diagram for SCR_CampaignBuildingPlacingEditorComponent:
[legend]

Public Member Functions

override void OnBeforeEntityCreatedServer (ResourceName prefab)
 Function called right before entities are created on server.
 
override void OnEntityCreatedServer (array< SCR_EditableEntityComponent > entities)
 Function called when entities are created on server.
 
int GetEntityBudgetValue (notnull SCR_EditableEntityComponent entity, EEditableEntityBudget budget)
 Get value of given budget for given entity.
 
void InitGroup (SCR_AIGroup aiGroup)
 Init spawned AI group (set events and flags)
 
void SetAiFlag (SCR_EditableEntityComponent component)
 
bool IsPreviewOutOfRange ()
 
ResourceName GetOutlineToSpawn (notnull SCR_EditableEntityComponent entity)
 Search for the outline that is assigned to this composition to be spawned.
 
override bool CanCreateEntity (out ENotification outNotification=-1, inout SCR_EPreviewState previewStateToShow=SCR_EPreviewState.PLACEABLE)
 Check if the entity can be created.
 
bool UseCooldown ()
 Check if the cooldown is set with this provider.
 
void SetCooldownTimer (int cooldownTime)
 
void SetAIBudget (int value)
 
- Public Member Functions inherited from SCR_PlacingEditorComponent
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 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.
 
- Public Member Functions inherited from SCR_BaseEditorComponent
sealed void OnInitBase ()
 
sealed void OnDeleteBase ()
 
sealed void OnRequestBase (bool isOpen)
 
sealed void OnOpenedBase ()
 
sealed void OnClosedBase ()
 
sealed void OnPreActivateBase ()
 
sealed void OnActivateBase ()
 
sealed bool OnActivateAsyncBase (int attempt)
 
sealed void OnPostActivateBase ()
 
sealed void OnDeactivateBase ()
 
sealed void OnPostDeactivateBase ()
 
sealed bool OnDeactivateAsyncBase (int attempt)
 
sealed 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 ()
 

Protected Member Functions

bool GetProviderBase (out SCR_MilitaryBaseComponent base)
 Return the base which belongs to a provider (if any)
 
void OnPreviewCreated (SCR_EditablePreviewEntity previewEnt)
 Method called when the preview of prefab to build is created.
 
void SetInitialCanBeCreatedState (notnull SCR_EditablePreviewEntity previewEnt)
 Set the initial state of the preview can / can't be created (based on the place where player place the preview into the world.)
 
void GetCooldownTimeClient (int prefabID, SCR_EditableEntityComponent entity)
 The placement is driven by a cooldown set on server. However for a client needs (to show him a remaining time) the cooldown has to be set as well. The difference in time between server and client is acceptable.
 
void GetAIBudgetClient (int prefabID, SCR_EditableEntityComponent entity)
 
void SetProviderAndBuilder (notnull SCR_CampaignBuildingCompositionComponent compositionComponent)
 Set the provider and builder entity to composition. Provider is the entity to which a composition belong to. For example a base, supply truck... Builder is a player who build it.
 
void OnPlaceEntityServer (int prefabID, SCR_EditableEntityComponent entity)
 
void PlaySoundEvent (vector pos, string soundEvent)
 
override void CreateEntityServer (SCR_EditorPreviewParams params, RplId prefabID, int playerID, int entityIndex, bool isQueue, array< RplId > recipientIds, bool canBePlayer, RplId holderId)
 
override void EOnEditorActivate ()
 When the component is activated.
 
override void EOnEditorActivateServer ()
 When the component is activated (called on server)
 
override void EOnEditorOpen ()
 When the editor is opened.
 
override void EOnEditorClose ()
 When the editor is closed.
 
override void EOnEditorOpenServer ()
 When the editor is opened (called on server)
 
override void EOnEditorDeactivateServer ()
 When the component is deactivated (called on server)
 
- Protected Member Functions inherited from SCR_PlacingEditorComponent
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.
 
void SetCycleWaypointsServer (array< RplId > selectedGroups, bool value)
 
- Protected Member Functions inherited from SCR_BaseEditorComponent
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 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 EOnEditorInitServer ()
 When the entity is created (called on server)
 
void EOnEditorDeleteServer ()
 When the entity is destroyed (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)
 

Protected Attributes

ResourceName m_sSoundFile
 
ResourceName m_sDefaultAIWP
 
bool m_bCanBeCreated = true
 
SCR_CampaignBuildingEditorComponent m_CampaignBuildingComponent
 
SCR_FreeRoamBuildingClientTriggerEntity m_AreaTrigger
 
IEntity m_Provider
 
ECantBuildNotificationType m_eBlockingReason
 
SCR_EditablePreviewEntity m_PreviewEnt
 
- Protected Attributes inherited from SCR_PlacingEditorComponent
float m_fSpacing
 
SCR_PreviewEntityEditorComponent m_PreviewManager
 
SCR_BudgetEditorComponent m_BudgetManager
 
bool m_bBlockPlacing
 
- Protected Attributes inherited from SCR_BaseEditorComponent
SCR_EditorBaseEntity m_Owner
 
SCR_EditorManagerEntity m_Manager
 
SCR_BaseEditorComponent m_Parent
 
RplComponent m_RplComponent
 

Additional Inherited Members

- Static Public Member Functions inherited from SCR_PlacingEditorComponent
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 Public Member Functions inherited from SCR_BaseEditorComponent
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 Protected Member Functions inherited from SCR_PlacingEditorComponent
static void OnAIGroupAllEntitiesSpawned (SCR_AIGroup group)
 Callback reacting to all delayed spawned entities being created.
 
static EEditorPlacingFlags GetCompatiblePlacingFlags (Resource prefabResource)
 
- Static Protected Attributes inherited from SCR_PlacingEditorComponent
static SCR_EditableEntityComponent m_DelayedSpawnEntity
 
static ref SCR_EditorPreviewParams m_DelayedSpawnPreviewParams
 

Member Function Documentation

◆ CanCreateEntity()

override bool SCR_CampaignBuildingPlacingEditorComponent.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.

Parameters
[out]outNotificationNotification to be sent when attempting to place the entity
Returns
True to allow placing, false to prevent it

Implements SCR_PlacingEditorComponent.

◆ CreateEntityServer()

override void SCR_CampaignBuildingPlacingEditorComponent.CreateEntityServer ( SCR_EditorPreviewParams  params,
RplId  prefabID,
int  playerID,
int  entityIndex,
bool  isQueue,
array< RplId >  recipientIds,
bool  canBePlayer,
RplId  holderId 
)
protected

◆ EOnEditorActivate()

override void SCR_CampaignBuildingPlacingEditorComponent.EOnEditorActivate ( )
protected

When the component is activated.

Implements SCR_PlacingEditorComponent.

◆ EOnEditorActivateServer()

override void SCR_CampaignBuildingPlacingEditorComponent.EOnEditorActivateServer ( )
protected

When the component is activated (called on server)

Implements SCR_BaseEditorComponent.

◆ EOnEditorClose()

override void SCR_CampaignBuildingPlacingEditorComponent.EOnEditorClose ( )
protected

When the editor is closed.

Implements SCR_BaseEditorComponent.

◆ EOnEditorDeactivateServer()

override void SCR_CampaignBuildingPlacingEditorComponent.EOnEditorDeactivateServer ( )
protected

When the component is deactivated (called on server)

Implements SCR_BaseEditorComponent.

◆ EOnEditorOpen()

override void SCR_CampaignBuildingPlacingEditorComponent.EOnEditorOpen ( )
protected

When the editor is opened.

Implements SCR_BaseEditorComponent.

◆ EOnEditorOpenServer()

override void SCR_CampaignBuildingPlacingEditorComponent.EOnEditorOpenServer ( )
protected

When the editor is opened (called on server)

Implements SCR_BaseEditorComponent.

◆ GetAIBudgetClient()

void SCR_CampaignBuildingPlacingEditorComponent.GetAIBudgetClient ( int  prefabID,
SCR_EditableEntityComponent  entity 
)
protected

◆ GetCooldownTimeClient()

void SCR_CampaignBuildingPlacingEditorComponent.GetCooldownTimeClient ( int  prefabID,
SCR_EditableEntityComponent  entity 
)
protected

The placement is driven by a cooldown set on server. However for a client needs (to show him a remaining time) the cooldown has to be set as well. The difference in time between server and client is acceptable.

◆ GetEntityBudgetValue()

int SCR_CampaignBuildingPlacingEditorComponent.GetEntityBudgetValue ( notnull SCR_EditableEntityComponent  entity,
EEditableEntityBudget  budget 
)

Get value of given budget for given entity.

◆ GetOutlineToSpawn()

ResourceName SCR_CampaignBuildingPlacingEditorComponent.GetOutlineToSpawn ( notnull SCR_EditableEntityComponent  entity)

Search for the outline that is assigned to this composition to be spawned.

◆ GetProviderBase()

bool SCR_CampaignBuildingPlacingEditorComponent.GetProviderBase ( out SCR_MilitaryBaseComponent  base)
protected

Return the base which belongs to a provider (if any)

◆ InitGroup()

void SCR_CampaignBuildingPlacingEditorComponent.InitGroup ( SCR_AIGroup  aiGroup)

Init spawned AI group (set events and flags)

◆ IsPreviewOutOfRange()

bool SCR_CampaignBuildingPlacingEditorComponent.IsPreviewOutOfRange ( )

◆ OnBeforeEntityCreatedServer()

override void SCR_CampaignBuildingPlacingEditorComponent.OnBeforeEntityCreatedServer ( ResourceName  prefab)

Function called right before entities are created on server.

To be overloaded by inherited classes.

Parameters
prefabPrefab that entities to be created will use

Implements SCR_PlacingEditorComponent.

◆ OnEntityCreatedServer()

override void SCR_CampaignBuildingPlacingEditorComponent.OnEntityCreatedServer ( array< SCR_EditableEntityComponent entities)

Function called when entities are created on server.

To be overloaded by inherited classes.

Parameters
entitiesArray of created entities

Implements SCR_PlacingEditorComponent.

◆ OnPlaceEntityServer()

void SCR_CampaignBuildingPlacingEditorComponent.OnPlaceEntityServer ( int  prefabID,
SCR_EditableEntityComponent  entity 
)
protected

◆ OnPreviewCreated()

void SCR_CampaignBuildingPlacingEditorComponent.OnPreviewCreated ( SCR_EditablePreviewEntity  previewEnt)
protected

Method called when the preview of prefab to build is created.

◆ PlaySoundEvent()

void SCR_CampaignBuildingPlacingEditorComponent.PlaySoundEvent ( vector  pos,
string  soundEvent 
)
protected

◆ SetAIBudget()

void SCR_CampaignBuildingPlacingEditorComponent.SetAIBudget ( int  value)

◆ SetAiFlag()

void SCR_CampaignBuildingPlacingEditorComponent.SetAiFlag ( SCR_EditableEntityComponent  component)

◆ SetCooldownTimer()

void SCR_CampaignBuildingPlacingEditorComponent.SetCooldownTimer ( int  cooldownTime)

◆ SetInitialCanBeCreatedState()

void SCR_CampaignBuildingPlacingEditorComponent.SetInitialCanBeCreatedState ( notnull SCR_EditablePreviewEntity  previewEnt)
protected

Set the initial state of the preview can / can't be created (based on the place where player place the preview into the world.)

◆ SetProviderAndBuilder()

void SCR_CampaignBuildingPlacingEditorComponent.SetProviderAndBuilder ( notnull SCR_CampaignBuildingCompositionComponent  compositionComponent)
protected

Set the provider and builder entity to composition. Provider is the entity to which a composition belong to. For example a base, supply truck... Builder is a player who build it.

◆ UseCooldown()

bool SCR_CampaignBuildingPlacingEditorComponent.UseCooldown ( )

Check if the cooldown is set with this provider.

Member Data Documentation

◆ m_AreaTrigger

SCR_FreeRoamBuildingClientTriggerEntity SCR_CampaignBuildingPlacingEditorComponent.m_AreaTrigger
protected

◆ m_bCanBeCreated

bool SCR_CampaignBuildingPlacingEditorComponent.m_bCanBeCreated = true
protected

◆ m_CampaignBuildingComponent

SCR_CampaignBuildingEditorComponent SCR_CampaignBuildingPlacingEditorComponent.m_CampaignBuildingComponent
protected

◆ m_eBlockingReason

ECantBuildNotificationType SCR_CampaignBuildingPlacingEditorComponent.m_eBlockingReason
protected

◆ m_PreviewEnt

SCR_EditablePreviewEntity SCR_CampaignBuildingPlacingEditorComponent.m_PreviewEnt
protected

◆ m_Provider

IEntity SCR_CampaignBuildingPlacingEditorComponent.m_Provider
protected

◆ m_sDefaultAIWP

ResourceName SCR_CampaignBuildingPlacingEditorComponent.m_sDefaultAIWP
protected

◆ m_sSoundFile

ResourceName SCR_CampaignBuildingPlacingEditorComponent.m_sSoundFile
protected

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