From dc5d03738e8ec613772c4b742aa7957bd522d71e Mon Sep 17 00:00:00 2001 From: Gauge Date: Mon, 1 Jul 2024 11:04:07 -0700 Subject: [PATCH 1/3] Ignore wheels and trash grids --- .../Data/Scripts/SkyPiratesCore/TargetLeadIndicator.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/SkyPiratesGunsDev/Data/Scripts/SkyPiratesCore/TargetLeadIndicator.cs b/SkyPiratesGunsDev/Data/Scripts/SkyPiratesCore/TargetLeadIndicator.cs index 2b4b791..e2b3d22 100644 --- a/SkyPiratesGunsDev/Data/Scripts/SkyPiratesCore/TargetLeadIndicator.cs +++ b/SkyPiratesGunsDev/Data/Scripts/SkyPiratesCore/TargetLeadIndicator.cs @@ -96,6 +96,13 @@ public override void UpdateBeforeSimulation() continue; } + // Ignores grids that are probalby just trash + if (((MyCubeGrid)grid).BlocksCount <= 3) + { + RemoveGPS(grid.EntityId); + continue; + } + Vector3D gridLoc = grid.WorldAABB.Center; if (grid.EntityId == CurrentData.EntityId From b4de9cd21b98df590df1038fa5a3b952d2a86840 Mon Sep 17 00:00:00 2001 From: Gauge Date: Mon, 1 Jul 2024 11:09:34 -0700 Subject: [PATCH 2/3] bumped up the trash size value to 7 --- .../Data/Scripts/SkyPiratesCore/TargetLeadIndicator.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SkyPiratesGunsDev/Data/Scripts/SkyPiratesCore/TargetLeadIndicator.cs b/SkyPiratesGunsDev/Data/Scripts/SkyPiratesCore/TargetLeadIndicator.cs index e2b3d22..cc94961 100644 --- a/SkyPiratesGunsDev/Data/Scripts/SkyPiratesCore/TargetLeadIndicator.cs +++ b/SkyPiratesGunsDev/Data/Scripts/SkyPiratesCore/TargetLeadIndicator.cs @@ -96,8 +96,8 @@ public override void UpdateBeforeSimulation() continue; } - // Ignores grids that are probalby just trash - if (((MyCubeGrid)grid).BlocksCount <= 3) + // Ignores grids that are probalby just trash or wheels + if (((MyCubeGrid)grid).BlocksCount <= 7) { RemoveGPS(grid.EntityId); continue; From e85610f51615f9cdc9e35ebeb550de867f3f3f77 Mon Sep 17 00:00:00 2001 From: Gauge Date: Mon, 1 Jul 2024 11:17:57 -0700 Subject: [PATCH 3/3] simplified anntena ranges --- .../Data/Scripts/AlwaysOn/Core.cs | 55 ++++++------------- 1 file changed, 18 insertions(+), 37 deletions(-) diff --git a/SkyPiratesAntennaAlwaysOn/Data/Scripts/AlwaysOn/Core.cs b/SkyPiratesAntennaAlwaysOn/Data/Scripts/AlwaysOn/Core.cs index fa49c31..761fa80 100644 --- a/SkyPiratesAntennaAlwaysOn/Data/Scripts/AlwaysOn/Core.cs +++ b/SkyPiratesAntennaAlwaysOn/Data/Scripts/AlwaysOn/Core.cs @@ -16,46 +16,11 @@ public class Core : MyGameLogicComponent public const float rangeLargeGrid = 100f; private IMyRadioAntenna beacon; - private bool waitframe = false; public override void Init(MyObjectBuilder_EntityBase objectBuilder) { - beacon = Entity as IMyRadioAntenna; - if (beacon.Radius < rangeSmallGrid) - beacon.Radius = rangeSmallGrid; - - NeedsUpdate = MyEntityUpdateEnum.EACH_100TH_FRAME | MyEntityUpdateEnum.BEFORE_NEXT_FRAME; - } - - - public override void UpdateOnceBeforeFrame() - { - if (waitframe) - { - waitframe = false; - NeedsUpdate |= MyEntityUpdateEnum.BEFORE_NEXT_FRAME; - return; - } - - List controls; - MyAPIGateway.TerminalControls.GetControls(out controls); - - foreach (IMyTerminalControl control in controls) - { - if (control.Id == "Radius") - { - if (beacon.CubeGrid.GridSizeEnum == VRage.Game.MyCubeSize.Small) - { - ((IMyTerminalControlSlider)control).SetLimits(rangeSmallGrid, 50000f); - } - else if (beacon.CubeGrid.GridSizeEnum == VRage.Game.MyCubeSize.Large) - { - ((IMyTerminalControlSlider)control).SetLimits(rangeLargeGrid, 50000f); - } - - break; - } - } + beacon = Entity as IMyRadioAntenna; + NeedsUpdate = MyEntityUpdateEnum.EACH_100TH_FRAME; } /// @@ -74,6 +39,22 @@ public override void UpdateBeforeSimulation100() { beacon.EnableBroadcasting = true; } + + if (beacon.CubeGrid.GridSizeEnum == VRage.Game.MyCubeSize.Large) + { + if (beacon.Radius < rangeSmallGrid) + { + beacon.Radius = rangeSmallGrid; + } + } + else if (beacon.CubeGrid.GridSizeEnum == VRage.Game.MyCubeSize.Large) + { + if (beacon.Radius < rangeLargeGrid) + { + beacon.Radius = rangeLargeGrid; + } + } + } } }