diff --git a/addons/trenches/Configs/Systems/ChimeraSystemsConfig.conf b/addons/trenches/Configs/Systems/ChimeraSystemsConfig.conf new file mode 100644 index 00000000..7a7cce92 --- /dev/null +++ b/addons/trenches/Configs/Systems/ChimeraSystemsConfig.conf @@ -0,0 +1,14 @@ +SystemSettings : "{45C53F06BA17238D}configs/Systems/SystemsConfig.conf" { + Systems { + SCR_GarbageSystem "{5F10E7EA29B0EDEC}" { + Rules { + ComponentClassGarbageRule "{626E356A67F1AC10}" { + Filter "ACE_Trenches_OutlineGarbageComponent" + Lifetime 300 + PlayerDistance 3.5 + LifetimeResetPercentage 2 + } + } + } + } +} \ No newline at end of file diff --git a/addons/trenches/Configs/Systems/ChimeraSystemsConfig.conf.meta b/addons/trenches/Configs/Systems/ChimeraSystemsConfig.conf.meta new file mode 100644 index 00000000..06c5eb99 --- /dev/null +++ b/addons/trenches/Configs/Systems/ChimeraSystemsConfig.conf.meta @@ -0,0 +1,17 @@ +MetaFileClass { + Name "{86E953538A28A98D}Configs/Systems/ChimeraSystemsConfig.conf" + Configurations { + CONFResourceClass PC { + } + CONFResourceClass XBOX_ONE : PC { + } + CONFResourceClass XBOX_SERIES : PC { + } + CONFResourceClass PS4 : PC { + } + CONFResourceClass PS5 : PC { + } + CONFResourceClass HEADLESS : PC { + } + } +} \ No newline at end of file diff --git a/addons/trenches/PrefabsEditable/Auto/Compositions/Misc/FreeRoamBuilding/E_ACE_DirtCover_01_long_v1.et b/addons/trenches/PrefabsEditable/Auto/Compositions/Misc/FreeRoamBuilding/E_ACE_DirtCover_01_long_v1.et index 15d5cab5..dc86b033 100644 --- a/addons/trenches/PrefabsEditable/Auto/Compositions/Misc/FreeRoamBuilding/E_ACE_DirtCover_01_long_v1.et +++ b/addons/trenches/PrefabsEditable/Auto/Compositions/Misc/FreeRoamBuilding/E_ACE_DirtCover_01_long_v1.et @@ -1,6 +1,8 @@ GenericEntity : "{AE4206993ACBAE48}Prefabs/Compositions/Misc/FreeRoamBuilding/ACE_DirtCover_01_long_v1.et" { ID "5282DCB5DFC8538F" components { + ACE_Trenches_OutlineGarbageComponent "{626E298C73057C81}" { + } SCR_EditableEntityComponent "{5E50727929EC2547}" : "{8B8F72167C615EAA}Prefabs/Editor/Components/Compositions_SCR_EditableEntityComponent.ct" { m_UIInfo SCR_EditableEntityUIInfo "{5298E609432D192D}" { Name "#AR-EditableEntity_DirtCover_01_long_v1_Name" diff --git a/addons/trenches/PrefabsEditable/Auto/Compositions/Misc/FreeRoamBuilding/E_ACE_DirtCover_01_short.et b/addons/trenches/PrefabsEditable/Auto/Compositions/Misc/FreeRoamBuilding/E_ACE_DirtCover_01_short.et index 129eec16..c86432f0 100644 --- a/addons/trenches/PrefabsEditable/Auto/Compositions/Misc/FreeRoamBuilding/E_ACE_DirtCover_01_short.et +++ b/addons/trenches/PrefabsEditable/Auto/Compositions/Misc/FreeRoamBuilding/E_ACE_DirtCover_01_short.et @@ -1,6 +1,8 @@ GenericEntity : "{C81B764F6C5B4064}Prefabs/Compositions/Misc/FreeRoamBuilding/ACE_DirtCover_01_short.et" { ID "5282DCB5DFC8538F" components { + ACE_Trenches_OutlineGarbageComponent "{626E298C69997233}" { + } SCR_EditableEntityComponent "{5E50727929EC2547}" : "{8B8F72167C615EAA}Prefabs/Editor/Components/Compositions_SCR_EditableEntityComponent.ct" { m_UIInfo SCR_EditableEntityUIInfo "{5298E609432D192D}" { Name "#AR-EditableEntity_DirtCover_01_short_Name" diff --git a/addons/trenches/scripts/Game/ACE_Trenches/Components/ACE_Trenches_OutlineGarbageComponent.c b/addons/trenches/scripts/Game/ACE_Trenches/Components/ACE_Trenches_OutlineGarbageComponent.c new file mode 100644 index 00000000..1978cc88 --- /dev/null +++ b/addons/trenches/scripts/Game/ACE_Trenches/Components/ACE_Trenches_OutlineGarbageComponent.c @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------------------------ +class ACE_Trenches_OutlineGarbageComponentClass : ScriptComponentClass +{ +} + +//------------------------------------------------------------------------------------------------ +//! Unbuilt structures with this component get handled by the garbage system +//! It gets dropped from the queue once built +class ACE_Trenches_OutlineGarbageComponent : ScriptComponent +{ + //------------------------------------------------------------------------------------------------ + //! Add to garbage system queue on init + override protected void OnPostInit(IEntity owner) + { + super.OnPostInit(owner); + + if (!GetGame().InPlayMode() || !Replication.IsServer()) + return; + + SCR_GarbageSystem garbageSystem = SCR_GarbageSystem.GetByEntityWorld(owner); + if (!garbageSystem) + return; + + SCR_CampaignBuildingCompositionComponent compositionComponent = SCR_CampaignBuildingCompositionComponent.Cast(owner.FindComponent(SCR_CampaignBuildingCompositionComponent)); + if (!compositionComponent) + return; + + garbageSystem.Insert(owner); + compositionComponent.GetOnCompositionSpawned().Insert(OnCompositionSpawned); + } + + //------------------------------------------------------------------------------------------------ + //! Remove from garbage system queue when built + protected void OnCompositionSpawned(bool compositionSpawned) + { + SCR_CampaignBuildingCompositionComponent compositionComponent = SCR_CampaignBuildingCompositionComponent.Cast(GetOwner().FindComponent(SCR_CampaignBuildingCompositionComponent)); + if (!compositionComponent) + return; + + compositionComponent.GetOnCompositionSpawned().Remove(OnCompositionSpawned); + + SCR_GarbageSystem garbageSystem = SCR_GarbageSystem.GetByEntityWorld(GetOwner()); + if (!garbageSystem) + return; + + garbageSystem.Withdraw(GetOwner()); + } +}