I'm currently making a tourist planner for KSP which reads in the persistent.sfs which tourist want to do what on which planet . Here's a preview.
The problem is that although science has the whole body name, tourist contracts use a targetBody
to tell which planet
For example here is a tourist contract in the savefile
PARAM
{
name = KerbalTourParameter
state = Incomplete
disableOnStateChange = False
allowPartialFailure = True
values = 219375,0,0,0,0
kerbalName = Ludves Kerman
kerbalGender = Male
PARAM
{
name = KerbalDestinationParameter
state = Incomplete
values = 24375,0,0,0,0
targetBody = 5
targetType = Orbit
kerbalName = Ludves Kerman
}
PARAM
{
name = KerbalDestinationParameter
state = Incomplete
values = 24375,0,0,0,0
targetBody = 0
targetType = Orbit
kerbalName = Ludves Kerman
}
PARAM
{
name = KerbalDestinationParameter
state = Incomplete
values = 24375,0,0,0,0
targetBody = 2
targetType = Flyby
kerbalName = Ludves Kerman
}
}
(as you can see on my screenshot, Ludves wants to Orbit the Sun (0), Orbit Eve (5) and flyby the Mun (2))
And here is a science found
Science
{
id = mysteryGoo@KerbinSrfLandedLaunchPad
title = Observation de la glairine™ mystérieuse d’Aire de lancement
dsc = 1
scv = 0.0122894989
sbv = 0.300000012
sci = 3.85207105
cap = 3.9000001
}
- Do you know where I can find the IDs of all bodies in KSP instead of just doing every single mission?
- Are they the same between each save game?
For the moment I have found :
Sun : 0
Kerbin : 1
Mun : 2
Minmus : 3
Duna : 6 (you see the number begin to become unsorted...)
Ike : 7
Eve : 5
Thanks!