4 [
Attribute(defvalue:
"-1",
desc:
"This value defines length of a trace for placement obstruction check in meters. This value will be used for all entities in composition that has it's center bellow terrain level. Mainly composition foundations.")]
11 componentSource.Get(
"m_fCustomObstructionValue", val);
18 int componentsCount = entitySource.GetComponentCount();
19 for (
int i = 0; i < componentsCount; i++)
22 if (componentSource.GetClassName().ToType().IsInherited(SCR_CampaignBuildingCompositionComponent))
23 return componentSource;
32 protected ref SCR_AudioSourceConfiguration m_AudioSourceConfigurationSpawn;
49 [
RplProp(onRplName:
"OnCompositionSpawned")]
57 protected static const int INVALID_PLAYER_ID = 0;
64 SCR_EditorLinkComponent linkComponent = SCR_EditorLinkComponent.Cast(owner.
FindComponent(SCR_EditorLinkComponent));
65 if (!linkComponent || !linkComponent.IsSpawningIgnored())
74 BaseGameMode gameMode =
GetGame().GetGameMode();
78 SCR_CampaignBuildingManagerComponent buildingManagerComponent = SCR_CampaignBuildingManagerComponent.Cast(gameMode.FindComponent(SCR_CampaignBuildingManagerComponent));
79 if (!buildingManagerComponent)
87 if (resName.IsEmpty())
90 int prefabId = buildingManagerComponent.GetCompositionId(resName);
107 if (!compositionOutlineResource.IsValid())
111 spawnParams.TransformMode = ETransformMode.WORLD;
112 spawnParams.Parent = entity.GetOwner();
114 IEntity compositionLayout =
GetGame().SpawnEntityPrefab(compositionOutlineResource,
GetGame().GetWorld(), spawnParams);
115 if (!compositionLayout)
122 SCR_CampaignBuildingCompositionComponent compositionComponent = SCR_CampaignBuildingCompositionComponent.Cast(entity.GetOwner().FindComponent(SCR_CampaignBuildingCompositionComponent));
123 if (!compositionComponent)
127 SCR_ServicePointComponent serviceComponent = SCR_ServicePointComponent.Cast(entity.GetOwner().FindComponent(SCR_ServicePointComponent));
128 if (serviceComponent)
129 serviceComponent.SetServiceState(SCR_EServicePointStatus.UNDER_CONSTRUCTION);
132 compositionComponent.SetPrefabId(prefabId);
139 BaseGameMode gameMode =
GetGame().GetGameMode();
143 SCR_CampaignBuildingManagerComponent buildingManagerComponent = SCR_CampaignBuildingManagerComponent.Cast(gameMode.FindComponent(SCR_CampaignBuildingManagerComponent));
144 if (!buildingManagerComponent)
167 BaseGameMode gameMode =
GetGame().GetGameMode();
171 SCR_EditorLinkComponent linkComponent = SCR_EditorLinkComponent.Cast(owner.
FindComponent(SCR_EditorLinkComponent));
187 SCR_CampaignBuildingManagerComponent buildingManagerComponent = SCR_CampaignBuildingManagerComponent.Cast(gameMode.FindComponent(SCR_CampaignBuildingManagerComponent));
188 if (!buildingManagerComponent)
191 buildingManagerComponent.RegisterComposition(
this);
213 SCR_CampaignBuildingLayoutComponent layoutComponent = SCR_CampaignBuildingLayoutComponent.Cast(child.
FindComponent(SCR_CampaignBuildingLayoutComponent));
221 SCR_DestructionMultiPhaseComponent destructionComponent = SCR_DestructionMultiPhaseComponent.Cast(child.
FindComponent(SCR_DestructionMultiPhaseComponent));
222 if (!destructionComponent)
296 array<ref SCR_EntityBudgetValue> outBudgets = {};
297 editableEnt.GetEntityBudgetCost(outBudgets,
GetOwner());
302 m_iCost = budgetEnt.GetBudgetValue();
445 SCR_CampaignBuildingTransformingEditorComponent transformComponent = SCR_CampaignBuildingTransformingEditorComponent.Cast(modeEntity.FindComponent(SCR_CampaignBuildingTransformingEditorComponent));
446 if (!transformComponent)
449 transformComponent.ReleaseLastRejectedPivot();
462 RplComponent comp = RplComponent.Cast(newOwner.
FindComponent(RplComponent));
475 if (m_EditorModeEntity)
485 m_EditorModeEntity = ent;
511 RplComponent rplComponent = RplComponent.Cast(
GetOwner().FindComponent(RplComponent));
512 return (rplComponent && rplComponent.IsProxy());
534 RplComponent rplComp = RplComponent.Cast(
Replication.FindItem(rplCompId));
536 newOwner = rplComp.GetEntity();
559 RplComponent rplComp = RplComponent.Cast(
m_ProviderEntity.FindComponent(RplComponent));
567 writer.WriteRplId(rplComp.Id());
578 reader.ReadBool(providerExist);
599 BaseGameMode gameMode =
GetGame().GetGameMode();
602 SCR_CampaignBuildingManagerComponent buildingManagerComponent = SCR_CampaignBuildingManagerComponent.Cast(gameMode.FindComponent(SCR_CampaignBuildingManagerComponent));
603 if (buildingManagerComponent)
604 buildingManagerComponent.UnregisterComposition(
this);
ArmaReforgerScripted GetGame()
override bool RplLoad(ScriptBitReader reader)
SCR_CacheNoteComponentClass ScriptComponentClass RplProp()] protected ref array< string > m_aLines
override bool RplSave(ScriptBitWriter writer)
bool m_bPlaySoundOnDeletion
void RpcDo_SetCompositionLock(bool lockState)
bool IsInteractionLocked()
bool m_bCompositionIsSpawned
SCR_CampaignBuildingLayoutComponent GetCompositionLayout()
void RemoveProviderEntityServer()
Remove provider entity when the provider is not a base and the building mode was terminated....
ref ScriptInvokerBool m_OnCompositionSpawned
void SetClearProviderEvent(notnull SCR_EditorModeEntity ent)
void AfterLockChanged(bool lockState)
void DestructibleEntityDestroyed(SCR_DestructionMultiPhaseComponent component)
ref ScriptInvokerVoid m_OnBuilderSet
IEntity GetProviderEntity()
ScriptInvokerBool GetOnCompositionSpawned()
void SetProviderEntity(IEntity newOwner)
ScriptInvokerVoid GetOnBuilderSet()
void SetProviderFromRplID()
Set a provider, loaded from RPL ID.
SCR_CampaignBuildingLayoutComponent m_CompositionLayout
void SetCanPlaySoundOnDeletion(bool val)
void SetBuilderId(int id)
void SetProviderEntityServer(IEntity newOwner)
void OnCompositionSpawned()
An event called on proxi when composition is spawned.
void SetInteractionLock(bool lockState)
void SetInteractionLockServer(bool lockState)
void CompositionBuildSound()
Play the sound when the composition is fully spawned.
void SpawnCompositionLayout(int prefabId, SCR_EditableEntityComponent entity)
void RpcDo_SetProviderEntity(RplId rplCompId)
void SetPrefabId(int prefabId)
ref SCR_AudioSourceConfiguration m_AudioSourceConfigurationDespawn
void RemoveProviderEntity()
Remove provider entity when the provider is not a base and the building mode was terminated.
void RpcDo_RemoveProviderEntity()
SCR_CampaignBuildingCompositionComponentClass ScriptComponentClass Attribute()] protected ref SCR_AudioSourceConfiguration m_AudioSourceConfigurationSpawn
void CheckExistingChild()
Check if this entity doesn't have any child. If so, delete it.
void SetCompositionCost(notnull SCR_EditableEntityComponent editableEnt)
void SetDestroyEvents()
Set the destroy event to root entity, when all direct child are destructible.
ResourceName GetOutlineToSpawn(notnull SCR_EditableEntityComponent entity)
Search for the outline that is assigned to this composition to be spawned.
void SetIsCompositionSpawned()
bool IsCompositionSpawned()
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
void SCR_EditorManagerEntity(IEntitySource src, IEntity parent)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
ScriptInvokerBase< ScriptInvokerVoidMethod > ScriptInvokerVoid
ScriptInvokerBase< ScriptInvokerBoolMethod > ScriptInvokerBool
proto external int SetEventMask(notnull IEntity owner, int mask)
proto external GenericComponent FindComponent(typename typeName)
proto external Managed FindComponent(typename typeName)
proto external IEntity GetChildren()
proto external IEntity GetSibling()
Object holding reference to resource. In destructor release the resource.
Replication item identifier.
static SCR_BaseEditableEntityFilter GetInstance(EEditableEntityState state, bool showError=false)
bool Validate(SCR_EditableEntityComponent entity)
float m_fCustomObstructionValue
static IEntityComponentSource GetCampaignBuildingCompositionSource(notnull IEntitySource entitySource)
static float GetProtectionRadius(notnull IEntityComponentSource componentSource)
ResourceName GetCompositionOutline(notnull SCR_EditableEntityComponent entity)
Search all SCR_CampaignBuildingCompositionLayoutManager entry and try to find a matching composition....
ResourceName GetPrefab(bool shorten=false)
void SetAuthor(int playerID)
void SetEntityFlag(EEditableEntityFlag flag, bool toSet)
Core component to manage SCR_EditorManagerEntity.
SCR_EditorManagerEntity GetEditorManager()
static IEntity GetMainParent(IEntity entity, bool self=false)
proto external GenericEntity GetOwner()
Get owner entity.
IEntity GetOwner()
Owner entity of the fuel tank.
override void EOnInit(IEntity owner)
EEditableEntityFlag
Unique flags of the entity.
SCR_FieldOfViewSettings Attribute
EEditorMode
Editor mode that defines overall functionality.
EntityEvent
Various entity events.
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.