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

[Feature Request] Expose IDiscoverable properties of vessels to detect asteroid classes #2669

Closed
JonnyOThan opened this issue Feb 11, 2020 · 3 comments

Comments

@JonnyOThan
Copy link
Contributor

https://kerbalspaceprogram.com/api/interface_i_discoverable.html

In "twitch plays ksp" we have no way to know the class of an asteroid. That's a pretty niche usage, but any kind of automated system that wants to go out and grab an asteroid will probably want to know its class first!

@Dunbaratu
Copy link
Member

Hmm. I never worked with Asteroids in kOS. Does the normal Vessel interface work for them? Because IDiscoverable does not appear to say anything other than the name, type, and mass. (i.e it doesn't say the thing's orbital or positional information?).

If I could say "an asteroid is a vessel, but it has a few additional suffixes beyond the standard ones vessels have" that would work fine. But if the game won't let you get your "hands on" the vessel object for an asteroid, such that I have to treat asteroids as their own separate class, it gets uglier.

@JonnyOThan
Copy link
Contributor Author

Yes, adding a few extra suffixes to asteroids would be great. You can set them as targets and they appear to work just like other vessels except querying their mass returns 0.

The IDiscoverable has a property named DiscoveryInfo that has the info that I want. In particular the size property which seems to indicate the asteroid’s class.

@Dunbaratu
Copy link
Member

In that case I think the simplest solution to present to scripts would be to NOT make a new class for asteroids, and instead say that an asteroid is a vessel, and all vessels have a class field you can query, and if it's a non-asteroid vessel then querying its class will return something like "VESSEL" instead of "A", "B", "C", "D", "E", or "F".

PiezPiedPy pushed a commit to PiezPiedPy/KOS that referenced this issue Nov 22, 2020
add STOPTRACKING and SIZECLASS suffixes to Vessel
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

No branches or pull requests

2 participants