Skip to content

TurretAxisManager + Bugfixes#787

Draft
BillNyeTheIE wants to merge 18 commits intoBrettRyland:devfrom
BillNyeTheIE:dev
Draft

TurretAxisManager + Bugfixes#787
BillNyeTheIE wants to merge 18 commits intoBrettRyland:devfrom
BillNyeTheIE:dev

Conversation

@BillNyeTheIE
Copy link

No description provided.

BillNyeTheIE and others added 18 commits February 15, 2026 17:01
TODO: Get all yaw offsets to agree and eliminate the unneeded sliders
- Deal with reload blocks
- Deal with deploy
- Fix laser missile PD behavior
- Set targetVessel to guardTarget if null in the None and Default -> Bomb cases
- Account for yawStandbyAngle
- Complete deploy mechanics
- Favor remaining on the current turret for equal priority cases (except when the new turret in question is the active turret)
- Fix bug in yawStandbyAngle implementation for parts with multiple turrets
- Set up functions to handle stowing turrets in edge case, though for now testing seems to indicate this is unnecessary
- Fix issues where turret audio would error into NaN
- MML MissileReferenceTransform was getting set to transforms that were likely dummies, resulting in incorrect MissileReferenceTransform readings
- MMR was using ammoCount for GetModuleMass and GetModuleCost resulting in double-counting the mass and cost of missiles in magazines, which already account for this.
- Previously this would be limited to MAX_GUARD_VISUAL_RANGE instead of being unlimited as reported in the menu, resulting in confusion
Time check should be >= rather than just >
- Use 2 * dataCount for MWS, launchWarnings and missileLockData
- Reduce missileLockData slot usage by reducing MissileLockLife by fixedDeltaTime
- Just use GetHeatTarget skipping the whole SearchForHeatTarget logic, *assume* we can somehow point the missile towards the target
- Because PD is separate from standard Guard functionalities, the various "SearchFor" functions don't actually work as intended when GMR is firing a PD missile
- Re-organize envelope checks
- Add more telemetry to RadarLOAL
- Fix missing coroutine calls
{
pingsData = new RWRSignatureData[dataCount];
MWSData = new RWRSignatureData[dataCount];
MWSData = new RWRSignatureData[2 *dataCount];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reasoning for these being 2 * dataCount as opposed to some other length?
(I don't really understand what you're using these for, but hard-coded array sizes are suspicious.)

[KSPField] public bool activeMissileOnly = false;

MissileFire WeaponManager
public MissileFire WeaponManager
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why public? This isn't getting called externally.

Ray ray = new Ray(transform.position, vectorToTarget);
bool pingRWR = Time.time - lastRWRPing > (0.5f * RadarUtils.ACTIVE_MISSILE_PING_PERSIST_TIME);
if (pingRWR) lastRWRPing = Time.time;
bool pingRWR = Time.fixedTime - lastRWRPing > (RadarUtils.ACTIVE_MISSILE_PING_PERISTS_TIME);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spelling for "PERSIST" was corrected in Josue's previous PR, which also added the 0.5f factor (it was previously 2f). Presumably the 0.5f factor is intentional, so it might be best to check with Josue for why it's there.

missileLauncher.reloadableRail = missileSpawner;
missileLauncher.hasAmmo = true;
missileLauncher.multiLauncher = this;
missileLauncher.MissileReferenceTransform = part.FindModelTransform("missileTransform");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this preference for "missileTransform" doesn't break any known existing parts does it?

@BillNyeTheIE BillNyeTheIE marked this pull request as draft March 2, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants