Skip to content
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

Prevent incorrectly initialized Modules to be used #30

Closed
Lisias opened this issue Mar 16, 2019 · 5 comments
Closed

Prevent incorrectly initialized Modules to be used #30

Lisias opened this issue Mar 16, 2019 · 5 comments
Assignees
Labels
enhancement New feature or request Not My Fault Not my Fault! I'm innocent! :)
Milestone

Comments

@Lisias
Copy link

Lisias commented Mar 16, 2019

In uncertain and beyond TweakScale control, some parts end up with invalid (and unique) TweakScale Module node on the prefab.

This situation has multiple causes, all of them "foreign" to the project. While co-working is possible to minimize the incidence, preemptive detection and prevention is the only safe measure on the long run.

To the moment, the easiest reliable way to detect such misconfigured Nodes is to check if both tweakScale and tweakName fields are set or reset, as exactly one of them must be active in order to TweakScale work correctly - and this setup is done at runtime only.

TASK: Implement a Sanity Check on the prefab fase that detects when the above mentioned fields are both set or reset, hinting we have a misconfigured node.

— EDIT —

Failing to check these attributes is also a signal of a incorrectly initialized TweakScale Module.

@Lisias Lisias self-assigned this Mar 16, 2019
@Lisias Lisias added bug Something isn't working enhancement New feature or request Not My Fault Not my Fault! I'm innocent! :) and removed bug Something isn't working labels Mar 16, 2019
@Lisias
Copy link
Author

Lisias commented Mar 16, 2019

It's not a bug on TweakScale, but it's something that I need to cope. So I'm tagging it as enhancement and "not my fault" ;)

Lisias added a commit that referenced this issue Mar 16, 2019
@Lisias
Copy link
Author

Lisias commented Mar 16, 2019

Fixed on commit bfd7cc8

@Lisias Lisias closed this as completed Mar 16, 2019
@Lisias Lisias added this to the TweakScale 2.4.1.1 milestone Mar 16, 2019
Lisias added a commit that referenced this issue May 5, 2019
Lisias added a commit that referenced this issue May 5, 2019
Lisias added a commit that referenced this issue May 12, 2019
@Lisias
Copy link
Author

Lisias commented Aug 24, 2019

Found a new instance of this problem. Reopening for working on it.

@Lisias Lisias reopened this Aug 24, 2019
@Lisias Lisias added this to the 2.4.3.4 milestone Aug 24, 2019
@Lisias
Copy link
Author

Lisias commented Aug 24, 2019

It was found that by taking a NullReferencePointerException while trying to check for an attribute is also evidence that the Module wasn't correctly initialized by some reason (as a missing scaleDefault, type, etc.).

It's pretty obvious now that I look behind, but yet, I had missed it. This should explain that somewhat uncomfortable amount of Failed Checks I'm founding on the KSP.logs on the Forum.

Fixed (again) on commit: 6467cdc

@Lisias
Copy link
Author

Lisias commented Apr 3, 2021

The criteria for this Sanity Check was updated due changes on issue #170.

See commit 3ce6518

Lisias added a commit that referenced this issue Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Not My Fault Not my Fault! I'm innocent! :)
Projects
None yet
Development

No branches or pull requests

1 participant