-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stock construction part too heavy handling #147
Comments
I can't reproduce the behavior you describe in KSP 1.12 At least in the cases I tried, attempting to detach a part that exceed the current mass limit has no effect outside of the If you can reproduce this, please provide exact reproduction setup and steps (and ideally upload a non-modded save that I can load to reproduce it). |
Thank you for investigating. I suspect the issue, perhaps mod caused, is the lack of cancellation. I get the message, but Esc doesn't cancel and it does not auto cancel on exceeding weight while placing. I'm determining the "spurious accelerations" by watching KER apoapsis, periapsis, eccentricity etc, fwiw. No RCS or throttle involved. I will get a testbed save going as soon as I get my game machine working again (pwr supp issue) |
I think I've found this one. Picking up a part sets its mass equal to the prefab mass AFTER you've picked it up. This ignores any mass modifiers like the stock ModulePartVariants, b9ps, tweakscale, etc. I made a small transpiler patch here, but maybe this should also be in KSPCF: JonnyOThan/TweakScale@b5f8bde |
Ugh, noticed another possible culprit: when you store a part in an inventory, it uses the prefab's mass and resource mass to update the amount occupied in the inventory. |
ugggh and there's also ModuleCargoPart.MakePartSettle which messes with the part's prefabMass. What a mess. I suspect MakePartSettle changes the mass so that it can move other things out of the way, or would be less likely to get punted by something else moving. Ohhhh! What if PickupPart was supposed to set selectedPart.prefabMass instead of selectedPart.mass? That would make WAY more sense. |
There are indeed a whole bunch of issues with the inventory system using the part prefab mass values, instead of the protopart values. I know at some point I tackled a bunch of them in a KSPCF branch, which I then decided to put in a separate mod, which I then forgot about. This being said, the way EVA construction works, attaching a part involves instantiating a brand new part out of the held part protopart (which is then destroyed), so those modifications to the held part mass / prefabMass shouldn't matter once the part is attached. However, the IDK, as you pointed out, EVA construction is one of the worst spaghetti mess in the KSP codebase, and it introduce tons of weird hacks that completely break some otherwise invariant behaviors and lifecyles on which mods and even stock code are relying. |
Just recording this here for posterity: I’m pretty sure that MassForWeightTesting does not work properly. While I was investigating all this stuff I often hit cases where I could drop a part and then couldn’t immediately pick it up again, getting the “part too heavy” message. Once it settled I could pick it up again. |
Someone may have a repro here: https://discord.com/channels/132478131490521089/454043306800840714/1218002887490142229 |
Currently KSP allows an engineer to click and remove a part that is too heavy and only warns of the problem when trying to reattach. This is an issue because no matter how the operation is "canceled" that I can deduce ends up leaving the craft with spurious accelerations requiring a quickload.
If there is a better way to "cancel" than boarding the craft, please let me know.
Ideally, clicking on a too heavy part would not detach it from the craft in the first place and "canceling" should not induce spurious accelerations
The text was updated successfully, but these errors were encountered: