This object is in archive! 
Turrets shoot ghost targets
Solved
Turrets often start shooting nonexisting targets, wasting ammo indefinitely. Or not shoot missiles, when there are missiles flying.
That's how to reproduce: https://www.youtube.com/watch?v=yabgroA_OzI&feature=youtu.be
Here's the script, that fixes the problem with shooting ghost targets:
List<TurretWatchdog> Watchdogs; IEnumerator<TurretWatchdog> WatchdogEnumerator = null; Program() { List<IMyLargeTurretBase> Turrets = new List<IMyLargeTurretBase>(); GridTerminalSystem.GetBlocksOfType<IMyLargeTurretBase>(Turrets); Watchdogs = Turrets.Select(t => new TurretWatchdog(t)).ToList(); if (Watchdogs.Any()) Runtime.UpdateFrequency = UpdateFrequency.Update1; else Echo("No turrets found"); } class TurretWatchdog { IMyLargeTurretBase Turret; MyDetectedEntityInfo PreviousEntity; public TurretWatchdog(IMyLargeTurretBase turret) { Turret = turret; PreviousEntity = turret.GetTargetedEntity(); } public void Check() { var entity = Turret.GetTargetedEntity(); if (entity.TimeStamp == PreviousEntity.TimeStamp) return; if (entity.BoundingBox == PreviousEntity.BoundingBox && entity.Velocity == PreviousEntity.Velocity && !Vector3D.IsZero(entity.Velocity)) { var idleRotation = Turret.EnableIdleRotation; Turret.ResetTargetingToDefault(); Turret.EnableIdleRotation = idleRotation; } PreviousEntity = entity; } } void Main() { if (WatchdogEnumerator == null || !WatchdogEnumerator.MoveNext()) { WatchdogEnumerator = Watchdogs.GetEnumerator(); WatchdogEnumerator.MoveNext(); } WatchdogEnumerator.Current.Check(); }
Hello, Mikhail,
thanks for reaching us with you issue. However, when I tested it, everything was working fine. Turrets are firing to the missiles fired from not-my faction rocket launcher when "Target Missiles" is turned on. They are obviously not firing to the missiles that were fired from rocket launcher that belongs to me/my faction.
Can I ask where you played it? In single player Empty world? Or some other game mode? Online/Offline?
Can I please have the BP you are using on the video to check you settings of rocker launcher and turrets and try to fiddle around with it on my own? That would be great help!
Even on the video, it seems like the turrets are firing on the rocket. But not all of them... is that what you think? If I understand it correctly, you want ALL the turrets to fire on single missile fired from the rocket launcher at the same time?
Thanks in advance for more info (if you can provide any) and providing the BP.
Kind Regards
Keen Software House: QA Department
Hello, Mikhail,
thanks for reaching us with you issue. However, when I tested it, everything was working fine. Turrets are firing to the missiles fired from not-my faction rocket launcher when "Target Missiles" is turned on. They are obviously not firing to the missiles that were fired from rocket launcher that belongs to me/my faction.
Can I ask where you played it? In single player Empty world? Or some other game mode? Online/Offline?
Can I please have the BP you are using on the video to check you settings of rocker launcher and turrets and try to fiddle around with it on my own? That would be great help!
Even on the video, it seems like the turrets are firing on the rocket. But not all of them... is that what you think? If I understand it correctly, you want ALL the turrets to fire on single missile fired from the rocket launcher at the same time?
Thanks in advance for more info (if you can provide any) and providing the BP.
Kind Regards
Keen Software House: QA Department
Hello, Engineer!
The fix for this is in v200
Thank you.
Kind Regards,
Keen Software House: QA Department
Hello, Engineer!
The fix for this is in v200
Thank you.
Kind Regards,
Keen Software House: QA Department
Replies have been locked on this page!