Difference between revisions of "Tutorial:Making a planet"

From Kerbal Space Program Wiki
Jump to: navigation, search
(Added first entry to code bible.)
(3. Adding the essential modules: Added extra variables to Properties)
Line 34: Line 34:
 
  radius = half of the diameter of the planet - used to define size of sphere with texture
 
  radius = half of the diameter of the planet - used to define size of sphere with texture
 
  geeASL = planet's gravity in Kerbin gravities
 
  geeASL = planet's gravity in Kerbin gravities
 +
rotationPeriod = day in seconds
 +
rotates = whether it rotates | true or false
 +
tidallyLocked = is one side of the planet locked towards it's parent | true or false
 +
initialRotation = distance in degrees from the rotation point of origin
 +
isHomeWorld = is the space centre on this planet | true or false
 +
timewarpAltitudeLevels = set the altitude for 1, 5, 10, 50, 100, 1,000, 10,000 and 100,000x timewarps | example for allowing every level at sea level: 0 0 0 0 0 0 0 0
 +
ScienceValues
 +
{
 +
  landedDataValue = multiplier for science points provided by surface samples or ground EVA reports
 +
  spashedDataValue = same as ^, but for oceans
 +
  flyingLowDataValue = same as ^, but for EVA and crew reports whilst flying below the flyingAltitudeThreshold
 +
  flyingHighDataValue = same as ^, but for flying above the flyingAltitudeThreshold but below the spaceAltitudeThreshold
 +
  inSpaceLowDataValue = same as ^, but for flying just above the spaceAltitudeThreshold
 +
  inSpaceHighDataValue = same as ^, but for flying high above the spaceAltitudeThreshold
 +
  recoverValue = multiplier for all science transmitted back
 +
  flyingAltitudeThreshold = < in metres from sea level
 +
  spaceAltitudeThreshold = < in metres from sea levels
 +
}
 
}
 
}
 
Orbit
 
Orbit
 
{
 
{
 +
referenceBody = body the planet is orbiting, Kerbol is Sun
 
  inclination = distance at ascending node from horizontal in degrees, relative to the parent's equator
 
  inclination = distance at ascending node from horizontal in degrees, relative to the parent's equator
 
  eccentricity = unknown, perhaps the ratio of pe:ap and vice versa after 0.5
 
  eccentricity = unknown, perhaps the ratio of pe:ap and vice versa after 0.5
Line 44: Line 63:
 
  meanAnomalyAtEpoch = ^
 
  meanAnomalyAtEpoch = ^
 
  epoch = ^
 
  epoch = ^
  referenceBody = body the planet is orbiting, Kerbol is Sun
+
  color = use rgb, but change values to 1/255*value
 
}
 
}
 
</pre>
 
</pre>
 +
 
===4. Choosing what to do===
 
===4. Choosing what to do===
 
Use the code bible below to help you find what you want to do.
 
Use the code bible below to help you find what you want to do.

Revision as of 00:59, 19 July 2015

It was never very easy to create planets in KSP - it often required decompiling, which is against the EULA. After a long time looking, a mod called Kopernicus was released and found, making it easy to make planets.

Specifications

  • Length: 15-30 minutes
  • Difficulty: Medium
  • For version: 1.0.x

Steps

1. Obtaining the prequisites

You will need:

  • A text editor
  • An image editor
  • Kopernicus 0.1

Many developers prefer text editors like Notepad++, a rather advanced program. Image editors usually are advanced, but even Paint would work. You can find Kopernicus here.

2. Setting up the basic file

Create a file, and name it: PLANET.cfg Change PLANET to your planet or moon's name. Inside the file, write this in:

@Kopernicus:AFTER[Kopernicus]
{
 Body
 {
 }
}

This declares that the file is a Kopernicus configuration file and a celestial body.

3. Adding the essential modules

Kopernicus configs are broken up into different segments described as in this tutorial as modules. An @ symbol before a module overrides the existing module - allowing for Kerbin to turn orange or something. It is unknown whether children of modules are affected by the parent's overriding. The 2 required modules are Properties and Orbit. They require several parameters, listed here:

Properties
{
 description = in game description
 radius = half of the diameter of the planet - used to define size of sphere with texture
 geeASL = planet's gravity in Kerbin gravities
 rotationPeriod = day in seconds
 rotates = whether it rotates | true or false
 tidallyLocked = is one side of the planet locked towards it's parent | true or false
 initialRotation = distance in degrees from the rotation point of origin
 isHomeWorld = is the space centre on this planet | true or false
 timewarpAltitudeLevels = set the altitude for 1, 5, 10, 50, 100, 1,000, 10,000 and 100,000x timewarps | example for allowing every level at sea level: 0 0 0 0 0 0 0 0
 ScienceValues
 {
  landedDataValue = multiplier for science points provided by surface samples or ground EVA reports
  spashedDataValue = same as ^, but for oceans
  flyingLowDataValue = same as ^, but for EVA and crew reports whilst flying below the flyingAltitudeThreshold
  flyingHighDataValue = same as ^, but for flying above the flyingAltitudeThreshold but below the spaceAltitudeThreshold
  inSpaceLowDataValue = same as ^, but for flying just above the spaceAltitudeThreshold
  inSpaceHighDataValue = same as ^, but for flying high above the spaceAltitudeThreshold 
  recoverValue = multiplier for all science transmitted back 
  flyingAltitudeThreshold = < in metres from sea level
  spaceAltitudeThreshold = < in metres from sea levels
 }
}
Orbit
{
 referenceBody = body the planet is orbiting, Kerbol is Sun
 inclination = distance at ascending node from horizontal in degrees, relative to the parent's equator
 eccentricity = unknown, perhaps the ratio of pe:ap and vice versa after 0.5
 semiMajorAxis = average of pe and ap: pe + ap / 2 = this
 longitudeOfAscendingNode = unknown, perhaps distance from 12:00 in degrees relative to the parent | set to 0 for max safety
 argumentOfPeriapsis = unknown, set to 0
 meanAnomalyAtEpoch = ^
 epoch = ^
 color = use rgb, but change values to 1/255*value
}

4. Choosing what to do

Use the code bible below to help you find what you want to do.

Code bible

Contents:

  • Atmospheres
    • Adding an atmosphere
    • Adding an atmosphere effect NOT DONE

Adding an atmosphere

Add into the Body module and edit as necessary:

Atmosphere
{
 lightColor = tint of the light, in r,g,b format.
 enabled = true | you want one don't you?
 containsOxygen = true/false on oxygen in atmosphere
 altitude = height from sea level in metres
 PressureCurve
 {
  key = use altitude pressure format | simple example of Kerbin:
  key = 70000 0
  key = 0 1
 }
 TemperatureCurve
 {
  key = use altitude temperature-in-celcius forumat | simple example of Kerbin:
  key = 70000 -270
  key = 0 18
 }
}

Done!

At the moment, coding in Kopernicus is not completed, due to the enormity of the subject. It will be done soon.