Loading...
Searching...
No Matches
SCR_CampaignBuildingPlacingEditorComponent Interface Reference
Inheritance diagram for SCR_CampaignBuildingPlacingEditorComponent:
SCR_PlacingEditorComponent SCR_BaseEditorComponent

Public Member Functions

Faction GetProviderAffiliatedFaction ()
 
override void OnBeforeEntityCreatedServer (ResourceName prefab)
 Function called right before entities are created on server.
 
override bool IsThereEnoughBudgetToSpawn (IEntityComponentSource entitySource)
 
override bool CanCreateEntity (out ENotification outNotification=-1, inout SCR_EPreviewState previewStateToShow=SCR_EPreviewState.PLACEABLE, SCR_EditorPreviewParams params=null, int prefabID=-1)
 Checks if the prefab can be spawned Evaluated both on client an on server (notification is used only on client though) To be overridden by inherited classes.
 
- Public Member Functions inherited from SCR_PlacingEditorComponent
bool IsThereEnoughBudgetToSpawnVehicleOccupants (array< ResourceName > resources)
 
void SetPlacingBlocked (bool blocked)
 
bool IsPlacingBlocked ()
 
int GetPrefabID (ResourceName prefab)
 
bool CreateEntity (bool unselectPrefab=true, bool canBePlayer=false, SCR_EditableEntityComponent holder=null, SCR_BaseEditorAction sourceAction=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, SCR_BaseEditorAction sourceAction=null)
 Create entity with custom params.
 
bool IsActionValid (int prefabID, notnull SCR_EditorPreviewParams params)
 Checks if the requested prefab matches the action content.
 
void SetInstantPlacing (SCR_EditorPreviewParams param)
 Set instant placing parameters.
 
bool SetSelectedPrefab (ResourceName prefab="", bool onConfirm=false, bool showBudgetMaxNotification=true, set< SCR_EditableEntityComponent > recipients=null, SCR_BaseEditorAction sourceAction=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 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
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 ()
 

Public Attributes

ref map< EEditableEntityBudget, int > m_accumulatedCampaignBudgetChanges = new map<EEditableEntityBudget, int>
 

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.)
 
override void OnEntityCreatedServer (array< SCR_EditableEntityComponent > entities)
 Function called when entities are created on server.
 
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)
 
int GetEntityBudgetValue (notnull SCR_EditableEntityComponent entity, EEditableEntityBudget budget)
 Get value of given budget for given 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 InitGroup (SCR_AIGroup aiGroup)
 Init spawned AI group (set events and flags)
 
void SetAiFlag (SCR_EditableEntityComponent component)
 
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)
 
ResourceName GetOutlineToSpawn (notnull SCR_EditableEntityComponent entity)
 Search for the outline that is assigned to this composition to be spawned.
 
override bool CanPlaceEntityServer (IEntityComponentSource editableEntitySource, out EEditableEntityBudget blockingBudget, bool updatePreview, bool showNotification, int prefabID=-1, int playerID=-1, SCR_EditorPreviewParams params=null)
 Server side validation that checks if provided entity should be possible to spawn.
 
bool AreLabelsMatching (notnull array< EEditableEntityLabel > entityLabels)
 Method used by the server to validate if labels from entity that was requested to spawn are matching with labels that are available with current building mode provider.
 
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)
 
bool UseCooldown ()
 Check if the cooldown is set with this provider.
 
void SetCooldownTimer (int cooldownTime)
 
void SetAIBudget (int value)
 
- Protected Member Functions inherited from SCR_PlacingEditorComponent
string GetEditorModeLogInfo ()
 Fetches the name of the mode that this editor represents.
 
void CreateEntityOwner (int prefabID, array< RplId > entityIds, int entityIndex, int isQueue, bool hasRecipients, RplId currentLayerID, int attempt)
 
void CheckBudgetOwner ()
 
void OnBudgetMaxReached (EEditableEntityBudget entityBudget, bool maxReached)
 
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)
 
- 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 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
 
ScriptedGameTriggerEntity 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
 
SCR_EditableEntityCore m_editableEntityCore
 
int m_iActionInfo
 
ref SCR_EditorPreviewParams m_InstantPlacingParam
 
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 Public Attributes inherited from SCR_PlacingEditorComponent
static SCR_PlacingEditorComponent serverPlacingEditorComponent
 
static bool m_accumulatedBudgetChangesClearQueued = false
 
- Static Protected Member Functions inherited from SCR_PlacingEditorComponent
static void ClearAccumulatedBudgetChanges ()
 
static void UpdatePlayerFactionFromEditableEntity (Faction editableEntityFaction, int playerID)
 helper function to avoid nesting
 
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
 
static ref map< EEditableEntityBudget, int > m_accumulatedBudgetChanges = new map<EEditableEntityBudget, int>
 
const float MAX_HEIGHT_ABOVE_TERRAIN = 2
 the height above the terrain [m], that is a margin of error when player is trying to spawn something while not having permision to adjust the vertical position
 

Member Function Documentation

◆ AreLabelsMatching()

bool SCR_CampaignBuildingPlacingEditorComponent.AreLabelsMatching ( notnull array< EEditableEntityLabel > entityLabels)
protected

Method used by the server to validate if labels from entity that was requested to spawn are matching with labels that are available with current building mode provider.

Parameters
[in]entityLabelslist of labels which should be validated
Returns
true if validation was successful, otherwise false

◆ CanCreateEntity()

override bool SCR_CampaignBuildingPlacingEditorComponent.CanCreateEntity ( out ENotification outNotification = -1,
inout SCR_EPreviewState previewStateToShow = SCR_EPreviewState::PLACEABLE,
SCR_EditorPreviewParams params = null,
int prefabID = -1 )

Checks if the prefab can be spawned Evaluated both on client an on server (notification is used only on client though) To be overridden by inherited classes.

Parameters
[out]outNotificationid of the notification that will be used locally
[in,out]previewStateToShowstate of the preview
[in]paramswhich are going to be used for spawning the prefab
[in]prefabIDid of the prefab that is going to be spawned. Since only client has the necessary data to validate the prefabID, server always uses default value here
Returns
true to allow placing, otherwise false

Implements SCR_PlacingEditorComponent.

◆ CanPlaceEntityServer()

override bool SCR_CampaignBuildingPlacingEditorComponent.CanPlaceEntityServer ( IEntityComponentSource editableEntitySource,
out EEditableEntityBudget blockingBudget,
bool updatePreview,
bool showNotification,
int prefabID = -1,
int playerID = -1,
SCR_EditorPreviewParams params = null )
protected

Server side validation that checks if provided entity should be possible to spawn.

Parameters
[in]editableEntitySourceof the prefab which is going to be spawned
[out]blockingBudget
[in]updatePreview
[in]showNotification
[in]playerIDof the user who requested this prefab to be spawned
[in]paramswhich were used to define how this prefab should be spawned
Returns
true to allow spawning, otherwise false

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 )
protected

Get value of given budget for given entity.

◆ GetOutlineToSpawn()

ResourceName SCR_CampaignBuildingPlacingEditorComponent.GetOutlineToSpawn ( notnull SCR_EditableEntityComponent entity)
protected

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

◆ GetProviderAffiliatedFaction()

Faction SCR_CampaignBuildingPlacingEditorComponent.GetProviderAffiliatedFaction ( )

◆ 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)
protected

Init spawned AI group (set events and flags)

◆ IsThereEnoughBudgetToSpawn()

override bool SCR_CampaignBuildingPlacingEditorComponent.IsThereEnoughBudgetToSpawn ( IEntityComponentSource entitySource)

◆ 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)
protected

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)
protected

◆ SetAiFlag()

void SCR_CampaignBuildingPlacingEditorComponent.SetAiFlag ( SCR_EditableEntityComponent component)
protected

◆ SetCooldownTimer()

void SCR_CampaignBuildingPlacingEditorComponent.SetCooldownTimer ( int cooldownTime)
protected

◆ 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 ( )
protected

Check if the cooldown is set with this provider.

Member Data Documentation

◆ m_accumulatedCampaignBudgetChanges

ref map<EEditableEntityBudget, int> SCR_CampaignBuildingPlacingEditorComponent.m_accumulatedCampaignBudgetChanges = new map<EEditableEntityBudget, int>

◆ m_AreaTrigger

ScriptedGameTriggerEntity 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: