Nivekk / KOS

Fully programmable autopilot mod for KSP.
Other
80 stars 30 forks source link

Enhancement Request: Ability to query current Volume name. #153

Open Dunbaratu opened 10 years ago

Dunbaratu commented 10 years ago

I'd like to be able to write small utility programs that do things like this:

set curVol to SelectedVolName.
switch to archive.
run someArchiveThing.
switch to curVol.

(switch to the archive, run a thing on it, then switch back to whatever the volume originally was.)

The problem is I don't see a way to get the selected volume name in a KOS script.

The purpose: I'm trying to build a database of the wiki-able data about planets and moons (mass, radius, orbital inclination, etc), with the premise that you'd store that back at mission control on the archive, rather than storing all that data on the vessel. The vessel would just run a small program that radios back to the archive to get the data it needs. (i.e. runs a program on the archive that's just a big list of IF statements to set the global variables depending on the name of the body.). Since the database contains all the data of all the bodies, it can get rather larger so it's stored back at the archive instead of on the vessel.

Nivekk commented 10 years ago

This definitely is something we should have.

palaslet commented 10 years ago

What about introducing a DATABASE structure that would be available if you are in comms range of Kerbin?

Valid lookups could be: DATABASE:PLANETS:KERBIN:MASS -> Returns Kerbins mass. DATABASE:PLANETS:KERBIN:MOONS:MUN:MASS -> Returns Muns mass. DATABASE:PLANETS -> Returns a list of all planets in the Kerbol System.

Some shortcuts might be implemented to ease scripting: DATABASE:MUN:MASS -> Also returns Muns mass.

Dunbaratu commented 10 years ago

Is that DATABASE really part of this issue or should you make a separate one for it? The ability to query volume name came up because I was making such a database myself but the database wasn't really the subject of this issue - its just how I came to having a need for the selected volume feature.

palaslet commented 10 years ago

It was just a suggestion to an alternative way of solving the specific issue of your example. No problem making it a separate issue if it's something we want implemented.