Jump to content

Sigma Binary


Sigma88

Recommended Posts

  • 1 month later...
Ive just noticed something: whenever I make a binary system that has two large objects the rotation period of the primary object is messed up. Any help?

could you send me the stuff I need to reproduce the error? the cfgs for the two large objects and the template.cfg you are using :)

that way I can check if there's an error in my mod or in how you are using it

Link to comment
Share on other sites

I was trying to make a barycentre for Tylo and Duna from Alternis Kerbol mod. Ill give you the code for the cfgs, but they have not been changed:

Tylo:

// Apply this patch after the Kopernicus mod is loaded
@Kopernicus:FOR[AlternisKerbol]
{
// We want to make Tylo occupy the point in space that Duna usually occupies.
@Body[Tylo]
{
flightGlobalsIndex = 9288

@Template
{
@name = Duna
}
@Template
{
removePQSMods = VertexColorMapBlend,PQSLandControl
}
@Properties
{
biomeMap = AlternisKerbol/Tylo/PluginData/TyloBiomes.png

@Biomes
{
Biome
{
name = Lowlands
value = 1.0
color = 1,1,1,1
}
Biome
{
name = Highlands
value = 1.1
color = 0,0,0,1
}
}

radius = 1103000
geeASL = 4.035
description = Tylo is an insanely massive so-called "Superkerbin" planet. With four gees of surface gravity and a thin atmosphere, aerospace engineers fear it. Its atmosphere is so thin that it won't slow you down, but it is so thick that it will burn you up on re-entry. Some kerbals have even suggested that landing on Tylo is impossible, let alone returning. The Kerbal Astronomical Society claims to give three golden stars to the first kerbal to make the trip.

@ScienceValues
{
landedDataValue = 18
splashedDataValue = 1
flyingLowDataValue = 9
flyingHighDataValue = 8
flyingAltitudeThreshold = 25000
inSpaceLowDataValue = 5
inSpaceHighDataValue = 4
}
}
@ScaledVersion
{
Material
{
texture = AlternisKerbol/Tylo/Textures/Tylo_Color
normals = AlternisKerbol/Tylo/Textures/Tylo_Normal
rimColorRamp = AlternisKerbol/Rims/ramp_red
rimPower = 1.06
rimBlend = 0.3
}
}
@PQS
{
Mods
{
VoronoiCraters
{
name = 1
deformation = 900
voronoiSeed = 986
voronoiDisplacement = 0.1
voronoiFrequency = 24
simplexSeed = 123123
simplexOctaves = 9
simplexPersistence = 0.5
simplexFrequency = 120
jitter = 0.1
jitterHeight = 3
rFactor = 1
rOffset = 1
colorOpacity = 0.2
DebugColorMapping = false
enabled = true
order = 101
}
VertexSimplexNoiseColor
{
seed = 45
blend = 0.5
colorStart = 0,0,0,0
//colorEnd = 1,1,1,1
colorEnd = 0,0,0,0
octaves = 12.0
persistence = 0.7
frequency = 2.0
enabled = true
order = 9999994
}
VertexColorSolid
{
//Thanks Probus.
blend = 0.0
//color = 0.01, 0.01, 0.01, 1.0
color = 0.1, 0.01, 0.01, 0.0
order = 19
}
VertexColorMap
{
map = AlternisKerbol/Tylo/PluginData/tylo_newcolor.png
enabled = true
}
VertexHeightMap
{
map = AlternisKerbol/Tylo/PluginData/Tylo_Height.png
deformity = 21500
enabled = true
}
}
}
Atmosphere
{
// effectively the ambient lighting color for all objects on the ground of this body (provides a slight tint)
ambientColor = 0.175,0.15,0.15,1


// sets the waveLength property in the AtmosphereFromGround component of the scaled version
// From my picking around in the KSP assemblies, it seems this is fed to the shader in this way:
//
// shader.invWaveLength = Color( 1 / r^4, 1 / g^4, 1 / b^4, 0.5);
//
// Obviously the code for the shader is not available, and I don't feel like picking through ARB shader IL so we'll need
// to figure this out experiementally.
lightColor = 0.4632503906, 0.52200625, 0.55200625, 0.5

AtmosphereFromGround
{
outerRadiusMult = 1.032
innerRadiusMult = 0.958
}


// General atmosphere settings
enabled = true
oxygen = False
altitude = 80000.0


// Atmosphere Pressure
// Values for pressure and temperature created with the handy-dandy Atmosphere Calculator by KillAshley
// pressure (in atm) = multipler * e ^ -(altitude / (scaleHeight * 1000))
pressureCurve
{
key = 0 56.13405 -5.90216365E-03 -5.90216365E-03
key = 4000 32.5253954 -4.803547025E-03 -4.803547025E-03
key = 8000 17.7056738 -2.9398841E-03 -2.9398841E-03
key = 12000 9.0063226 -1.6466819E-03 -1.6466819E-03
key = 16000 4.5322186 -8.40161775E-04 -8.40161775E-04
key = 20000 2.2850284 -4.206522E-04 -4.206522E-04
key = 24000 1.167001 -2.10499225E-04 -2.10499225E-04
key = 28000 0.6010346 -1.061464E-04 -1.061464E-04
key = 32000 0.3178298 -5.36272E-05 -5.36272E-05
key = 36000 0.172017 -2.76446E-05 -2.76446E-05
key = 40000 0.096673 -1.4632525E-05 -1.4632525E-05
key = 44000 0.0549568 -8.039925E-06 -8.039925E-06
key = 48000 0.0323536 -4.5705E-06 -4.5705E-06
key = 52000 0.0183928 -2.763075E-06 -2.763075E-06
key = 56000 0.010249 -1.613525E-06 -1.613525E-06
key = 60000 0.0054846 -9.21025E-07 -9.21025E-07
key = 64000 0.0028808 -5.05525E-07 -5.05525E-07
key = 68000 0.0014404 -2.70075E-07 -2.70075E-07
key = 72000 0.0007202 -1.5235E-07 -1.5235E-07
key = 76000 0.0002216 -9.0025E-08 -9.0025E-08
key = 80000 0 -5.54E-08 -5.54E-08
}
temperatureCurve
{
key = 0 279.19 -0.00802083375 -0.00802083375
key = 9600 205.8567917 -0.0011360735 -0.0011325715
key = 16800 205.8567917 0.0011325715 0.0011325715
key = 24800 258.2376548 0.000619018 0.000619018
key = 44800 258.2376548 -0.000853660375 -0.000853660375
key = 64000 178.2377912 -0.0011360735 -0.0011360735
key = 72000 178.2377912 0.000592218125 0.000592218125
key = 80000 219.1901023 0.000868255125 0.000868255125
key = 120000 0 -0.000562011375 -0.000562011375
}


// Atmosphere Temperature
temperatureMultiplier = 1.0
atmosphereMolarMass = 0.022
}
@Orbit
{
// Moves Tylo to Duna's position in space.
// -- Note the "@" on the front of referenceBody. This means edit an existing attribute
@referenceBody = Sun


// Other orbit stuff
inclination = 1.22
eccentricity = 0.03
semiMajorAxis = 24708887045
longitudeOfAscendingNode = 0
argumentOfPeriapsis = 0
meanAnomalyAtEpoch = 3.14
epoch = 0
color = RGBA(102, 63.75, 38.25, 255)
}
}
}
@Kopernicus:FOR[AlternisKerbol]:NEEDS[GalacticNeighborhood]
{
@Body[Tylo]
{
@Properties
{
description = Stumbos is one of the largest rocky planets on record. With a very thin atmosphere and a very high gravity, it would be quite the challenge to land on. Not enough air to slow you down, and so much air that you have to worry about re-entry heating. Luckily engineers won't have to worry about landing on it, because it is a distant planet lightyears away.
}
}
}

And Duna:

// Apply this patch after the Kopernicus mod is loaded
@Kopernicus:FOR[AlternisKerbol]
{
// We want to make Duna orbit Tylo
@Body[Duna]
{

@Properties
{
tidallyLocked = true
description = Also known as The Butterscotch Dot Next To Tylo, Duna has been a wonder to Kerbalkind for quite some time after its discovery. It was the first secondary planet to be discovered around a primary planet other than Jool. If it does have life on it, it is probably butterscotch flavoured.
}
Debug
{
exportBin = false
}
@Template
{
removePQSMods = VertexColorMapBlend,PQSLandControl
}
@ScaledVersion
{
Material
{
texture = AlternisKerbol/Duna/Textures/Duna_Color
normals = AlternisKerbol/Duna/Textures/Duna_Normal
}
}

@PQS
{
Mods
{
VertexColorSolid
{
//Thanks Probus
blend = 0.0
//color = 0.01, 0.01, 0.01, 1.0
color = 0.1, 0.01, 0.01, 0.0
order = 19
}
VertexSimplexNoiseColor
{
seed = 45
blend = 0.5
colorStart = 0,0,0,0
//colorEnd = 1,1,1,1
colorEnd = 0,0,0,0
octaves = 12.0
persistence = 0.7
frequency = 2.0
enabled = true
order = 9999994
}
VertexColorMap
{
map = AlternisKerbol/Duna/Textures/Duna_Color.png
enabled = true
}
VertexHeightMap
{
map = AlternisKerbol/Duna/PluginData/Duna_Height.png
deformity = 11000
enabled = true
}
}
}
@Orbit
{
@referenceBody = Tylo
semiMajorAxis = 34598850
inclination = 0.7
eccentricity = 0.05
longitudeOfAscendingNode = 135.5
argumentOfPeriapsis = 0
meanAnomalyAtEpoch = 3.14
epoch = 0
color = RGBA(255, 185, 123, 255)
}
}
}


@Kopernicus:FOR[AlternisKerbol]:NEEDS[GalacticNeighborhood]
{
@Body[Duna]
{
@Properties
{
%description = Egar is a medium-sized moon orbiting Stumbos. It is colored a nice butterscotch color. It may very well hold life on its surface somewhere, because there's definitely some canalis. Maybe. It looks decently canal-like for sure. Hard to tell at this distance.
}
}
}

And the template:

                      //////////////////////////////////
// Requires SigmaBinary 1.1.1 //
//////////////////////////////////


//////////////////////////////////////////////////////////////////////
// Forum Thread: http://forum.kerbalspaceprogram.com/threads/127820 //
//////////////////////////////////////////////////////////////////////



@Kopernicus:NEEDS[SigmaBinary]:AFTER[SigmaBinary]
{

// INSTRUCTIONS:
// Copy this cfg anywhere into the GameData folder
// Set the name of the two bodies you want to turn into a binary system plus the reference body

@Body[Tylo] // Put here the name of the heavies body (eg: Pluto)
{
SigmaBinary = Primary // Don't change this line
}
@Body[Duna] // Put here the name of the lightest body (eg: Charon)
{
SigmaBinary = Secondary // Don't change this line
}
@Body[PARENT_NAME_HERE] // Put here the name of the body around which your binary system orbits (eg: Sun)
{
SigmaBinary = Reference // Don't change this line
}

}


// Now sit back and enjoy your binary system


// Sigma






////////////////////////////////////////////
// You don't need to read past this point //
////////////////////////////////////////////






// This part checks for a Finalize node inside Kopernicus


@Kopernicus:HAS[@Finalize]:NEEDS[SigmaBinary]:AFTER[SigmaBinary]
{
@Finalize:HAS[#finalizeOrbits[?rue]]
{
SigmaFinalize = True
}
@Finalize:HAS[~finalizeOrbits[?rue]]
{
SigmaFinalize = False
}
}
@Kopernicus:HAS[!Finalize]:NEEDS[SigmaBinary]:AFTER[SigmaBinary]
{
Finalize
{
SigmaFinalize = False
removeFinalize = True
}
}


// This part creates the barycenter


@Kopernicus:NEEDS[SigmaBinary]:AFTER[SigmaBinary]
{
+Body[SigmaBarycenter]
{
SigmaBinary = Barycenter
@name = #$/Body:HAS[#SigmaBinary[Primary]]/name$$/Body:HAS[#SigmaBinary[Secondary]]/name$
#/Body:HAS[#SigmaBinary[Primary]]/Orbit {}
@Properties
{
SigmaFinalize = #$/Finalize/SigmaFinalize$
}
}

// This part sets the Primary body

@Body:HAS[#SigmaBinary[Primary]]
{
@Properties
{
%solarRotationPeriod = false
SigmaFinalize = #$/Finalize/SigmaFinalize$
}


// Calculate the temporary SoI (only if it's not already explicitly set)


@Properties:HAS[~sphereOfInfluence
[*]]
{
sphereOfInfluence = #$mass$
@sphereOfInfluence /= #$/Body:HAS[#SigmaBinary[Reference]]/Properties/mass$
@sphereOfInfluence != 0.4
@sphereOfInfluence *= #$../Orbit/semiMajorAxis$
minSoI = 1
}

// Fixes the SoI if it's too small

@Properties:HAS[#minSoI[1]]
{
@minSoI = #$radius$
@minSoI *= 2
@minSoI -= #$radius$
@minSoI -= 40000
}
@Properties:[#minSoI[>0]|#minSoI[0]]
{
@minSoI += #$radius$
@minSoI += 40000
}
@Properties:HAS[#minSoI[<0]]
{
%minSoI = #$radius$
@minSoI *= 2
}
@Properties
{
@minSoI -= #$sphereOfInfluence$
}
@Properties:HAS[#minSoI[>0]]
{
@sphereOfInfluence += #$minSoI$
}

// Set orbital parameters

!Orbit {}
#/Body:HAS[#SigmaBinary[Secondary]]/Orbit {}
@Orbit
{
@color = #$/Body:HAS[#SigmaBinary[Barycenter]]/Orbit/color$
@referenceBody = #$/Body:HAS[#SigmaBinary[Barycenter]]/name$
@argumentOfPeriapsis += 180

// Set new semiMajorAxis

%semiMajorAxis = #$/Body:HAS[#SigmaBinary[Secondary]]/Properties/mass$
@semiMajorAxis += #$../Properties/mass$
@semiMajorAxis != -1
@semiMajorAxis *= #$/Body:HAS[#SigmaBinary[Secondary]]/Properties/mass$
@semiMajorAxis *= #$/Body:HAS[#SigmaBinary[Secondary]]/Orbit/semiMajorAxis$
}
}

// This part changes the SoI of the Secondary body when it's too small or too big
// If the original body have the SoI already explicitly set, this part won't change anything

@Body:HAS[#SigmaBinary[Secondary]]
{
@Properties:HAS[~sphereOfInfluence
[*]]
{
%sphereOfInfluence = #$mass$
@sphereOfInfluence /= #$/Body:HAS[#SigmaBinary[Primary]]/Properties/mass$
@sphereOfInfluence != 0.4
@sphereOfInfluence *= #$../Orbit/semiMajorAxis$
%maxSoI = 1
%minSoI = 1
}
@Properties:HAS[#minSoI[1]]
{
@minSoI = #$radius$
@minSoI *= 2
@minSoI -= #$radius$
@minSoI -= 40000
}
@Properties:[#minSoI[>0]|#minSoI[0]]
{
@minSoI += #$radius$
@minSoI += 40000
}
@Properties:HAS[#minSoI[<0]]
{
%minSoI = #$radius$
@minSoI *= 2
}
@Properties
{
@minSoI -= #$sphereOfInfluence$
}
@Properties:HAS[#minSoI[>0]]
{
@sphereOfInfluence += #$minSoI$
}
@Properties:HAS[#maxSoI[1]]
{
@maxSoI -= #$../Orbit/eccentricity$
@maxSoI *= #$../Orbit/semiMajorAxis$
@maxSoI -= #$radius$
@maxSoI -= #$/Body:HAS[#SigmaBinary[Primary]]/Properties/radius$
@maxSoI /= 2
@maxSoI += #$radius$
@maxSoI -= #$sphereOfInfluence$
}
@Properties:HAS[#maxSoI[<0]]
{
@sphereOfInfluence += #$maxSoI$
}
}

// This part sets Barycenter's mass, description and SoI

@Body:HAS[#SigmaBinary[Barycenter]]
{
@Properties:HAS[#SigmaFinalize[?rue]]
{
@mass += #$/Body:HAS[#SigmaBinary[Secondary]]/Properties/mass$
}
@Properties
{

// Set description

description = #This is the Barycenter of the $/Body:HAS[#SigmaBinary[Primary]]/name$-$/Body:HAS[#SigmaBinary[Secondary]]/name$ System.

// Set mass

@mass += #$/Body:HAS[#SigmaBinary[Primary]]/Properties/mass$
@mass *= #$/Body:HAS[#SigmaBinary[Primary]]/Orbit/semiMajorAxis$
@mass *= #$/Body:HAS[#SigmaBinary[Primary]]/Orbit/semiMajorAxis$
@mass *= #$/Body:HAS[#SigmaBinary[Primary]]/Orbit/semiMajorAxis$
@mass /= #$/Body:HAS[#SigmaBinary[Secondary]]/Orbit/semiMajorAxis$
@mass /= #$/Body:HAS[#SigmaBinary[Secondary]]/Orbit/semiMajorAxis$
@mass /= #$/Body:HAS[#SigmaBinary[Secondary]]/Orbit/semiMajorAxis$

// Set Sphere of Influence

%sphereOfInfluence = #$/Body:HAS[#SigmaBinary[Primary]]/Properties/sphereOfInfluence$
}
@Properties:HAS[#SigmaFinalize[?rue]]
{
@mass -= #$/Body:HAS[#SigmaBinary[Primary]]/Properties/mass$
}
}

// This part:
// Sets the final SoI value for the Primary Body
// Calculates the correct rotation period if the body is tidallyLocked

@Body:HAS[#SigmaBinary[Primary]]
{

// Set final SoI value

@Properties
{
%sphereOfInfluence = #$../Orbit/eccentricity$
@sphereOfInfluence += 1
@sphereOfInfluence *= #$../Orbit/semiMajorAxis$
@sphereOfInfluence += #$/Body:HAS[#SigmaBinary[Barycenter]]/Properties/sphereOfInfluence$
}

// If tidallyLocked fix the rotationPeriod

@Properties:HAS[#tidallyLocked[?rue]]
{
%rotationPeriod = 0
}
@Properties:HAS[#tidallyLocked[?rue],#SigmaFinalize[?rue]]
{
@rotationPeriod += #$/Body:HAS[#SigmaBinary[Barycenter]]/Properties/mass$
}
@Properties:HAS[#tidallyLocked[?rue]]
{
!tidallyLocked = DEL
%rotates = true
@rotationPeriod += #$/Body:HAS[#SigmaBinary[Reference]]/Properties/mass$
@rotationPeriod /= #$../Orbit/semiMajorAxis$
@rotationPeriod /= #$../Orbit/semiMajorAxis$
@rotationPeriod /= #$../Orbit/semiMajorAxis$
@rotationPeriod /= 5.91525585920849e11 // divide by (4*pi^2)/G
@rotationPeriod != -0.5
}
}
}


// This part adds an exception for ISRU contracts on the barycenter


@Contracts:NEEDS[SigmaBinary]:AFTER[SigmaBinary]
{
@ISRU
{
@RESOURCE_REQUEST[Ore]
{
Forbidden = #$@Kopernicus/Body:HAS[#SigmaBinary[Barycenter]]/name$
}
}
}


// This part clears temporary stuff


@Kopernicus:NEEDS[SigmaBinary]:AFTER[SigmaBinary]
{
@Body:HAS[#SigmaBinary
[*]]
{
!SigmaBinary = DEL
@Properties
{
!minSoI = DEL
!maxSoI = DEL
!SigmaFinalize = DEL
}
}
@Finalize:HAS[#SigmaFinalize
[*]]
{
!SigmaFinalize = DEL
}
!Finalize:HAS[#removeFinalize
[*]] {}
}

EDIT: Okay, now it is working... Could there be any reason??

EDIT2: Wait, SOI and Rotation aren't working for Tylo: Soi is set to 87 quadrillion km and rotation is more than 233 years...

Edited by RA3236
Link to comment
Share on other sites

EDIT: Okay, now it is working... Could there be any reason??

EDIT2: Wait, SOI and Rotation aren't working for Tylo: Soi is set to 87 quadrillion km and rotation is more than 233 years...

I was trying to make a barycentre for Tylo and Duna from Alternis Kerbol mod. Ill give you the code for the cfgs, but they have not been changed:

Tylo:


@Kopernicus:FOR[AlternisKerbol]
{
// We want to make Tylo occupy the point in space that Duna usually occupies.
@Body[Tylo]
{
flightGlobalsIndex = 9288

@Template
{
@name = Duna
}
@Template
{
removePQSMods = VertexColorMapBlend,PQSLandControl
}
@Properties
{
biomeMap = AlternisKerbol/Tylo/PluginData/TyloBiomes.png

@Biomes
{
Biome
{
name = Lowlands
value = 1.0
color = 1,1,1,1
}
Biome
{
name = Highlands
value = 1.1
color = 0,0,0,1
}
}

radius = 1103000
geeASL = 4.035
description = Tylo is an insanely massive so-called "Superkerbin" planet. With four gees of surface gravity and a thin atmosphere, aerospace engineers fear it. Its atmosphere is so thin that it won't slow you down, but it is so thick that it will burn you up on re-entry. Some kerbals have even suggested that landing on Tylo is impossible, let alone returning. The Kerbal Astronomical Society claims to give three golden stars to the first kerbal to make the trip.

@ScienceValues
{
landedDataValue = 18
splashedDataValue = 1
flyingLowDataValue = 9
flyingHighDataValue = 8
flyingAltitudeThreshold = 25000
inSpaceLowDataValue = 5
inSpaceHighDataValue = 4
}
}
@ScaledVersion
{
Material
{
texture = AlternisKerbol/Tylo/Textures/Tylo_Color
normals = AlternisKerbol/Tylo/Textures/Tylo_Normal
rimColorRamp = AlternisKerbol/Rims/ramp_red
rimPower = 1.06
rimBlend = 0.3
}
}
@PQS
{
Mods
{
VoronoiCraters
{
name = 1
deformation = 900
voronoiSeed = 986
voronoiDisplacement = 0.1
voronoiFrequency = 24
simplexSeed = 123123
simplexOctaves = 9
simplexPersistence = 0.5
simplexFrequency = 120
jitter = 0.1
jitterHeight = 3
rFactor = 1
rOffset = 1
colorOpacity = 0.2
DebugColorMapping = false
enabled = true
order = 101
}
VertexSimplexNoiseColor
{
seed = 45
blend = 0.5
colorStart = 0,0,0,0
//colorEnd = 1,1,1,1
colorEnd = 0,0,0,0
octaves = 12.0
persistence = 0.7
frequency = 2.0
enabled = true
order = 9999994
}
VertexColorSolid
{
//Thanks Probus.
blend = 0.0
//color = 0.01, 0.01, 0.01, 1.0
color = 0.1, 0.01, 0.01, 0.0
order = 19
}
VertexColorMap
{
map = AlternisKerbol/Tylo/PluginData/tylo_newcolor.png
enabled = true
}
VertexHeightMap
{
map = AlternisKerbol/Tylo/PluginData/Tylo_Height.png
deformity = 21500
enabled = true
}
}
}
Atmosphere
{
// effectively the ambient lighting color for all objects on the ground of this body (provides a slight tint)
ambientColor = 0.175,0.15,0.15,1


// sets the waveLength property in the AtmosphereFromGround component of the scaled version
// From my picking around in the KSP assemblies, it seems this is fed to the shader in this way:
//
// shader.invWaveLength = Color( 1 / r^4, 1 / g^4, 1 / b^4, 0.5);
//
// Obviously the code for the shader is not available, and I don't feel like picking through ARB shader IL so we'll need
// to figure this out experiementally.
lightColor = 0.4632503906, 0.52200625, 0.55200625, 0.5

AtmosphereFromGround
{
outerRadiusMult = 1.032
innerRadiusMult = 0.958
}


// General atmosphere settings
enabled = true
oxygen = False
altitude = 80000.0


// Atmosphere Pressure
// Values for pressure and temperature created with the handy-dandy Atmosphere Calculator by KillAshley
// pressure (in atm) = multipler * e ^ -(altitude / (scaleHeight * 1000))
pressureCurve
{
key = 0 56.13405 -5.90216365E-03 -5.90216365E-03
key = 4000 32.5253954 -4.803547025E-03 -4.803547025E-03
key = 8000 17.7056738 -2.9398841E-03 -2.9398841E-03
key = 12000 9.0063226 -1.6466819E-03 -1.6466819E-03
key = 16000 4.5322186 -8.40161775E-04 -8.40161775E-04
key = 20000 2.2850284 -4.206522E-04 -4.206522E-04
key = 24000 1.167001 -2.10499225E-04 -2.10499225E-04
key = 28000 0.6010346 -1.061464E-04 -1.061464E-04
key = 32000 0.3178298 -5.36272E-05 -5.36272E-05
key = 36000 0.172017 -2.76446E-05 -2.76446E-05
key = 40000 0.096673 -1.4632525E-05 -1.4632525E-05
key = 44000 0.0549568 -8.039925E-06 -8.039925E-06
key = 48000 0.0323536 -4.5705E-06 -4.5705E-06
key = 52000 0.0183928 -2.763075E-06 -2.763075E-06
key = 56000 0.010249 -1.613525E-06 -1.613525E-06
key = 60000 0.0054846 -9.21025E-07 -9.21025E-07
key = 64000 0.0028808 -5.05525E-07 -5.05525E-07
key = 68000 0.0014404 -2.70075E-07 -2.70075E-07
key = 72000 0.0007202 -1.5235E-07 -1.5235E-07
key = 76000 0.0002216 -9.0025E-08 -9.0025E-08
key = 80000 0 -5.54E-08 -5.54E-08
}
temperatureCurve
{
key = 0 279.19 -0.00802083375 -0.00802083375
key = 9600 205.8567917 -0.0011360735 -0.0011325715
key = 16800 205.8567917 0.0011325715 0.0011325715
key = 24800 258.2376548 0.000619018 0.000619018
key = 44800 258.2376548 -0.000853660375 -0.000853660375
key = 64000 178.2377912 -0.0011360735 -0.0011360735
key = 72000 178.2377912 0.000592218125 0.000592218125
key = 80000 219.1901023 0.000868255125 0.000868255125
key = 120000 0 -0.000562011375 -0.000562011375
}


// Atmosphere Temperature
temperatureMultiplier = 1.0
atmosphereMolarMass = 0.022
}
@Orbit
{
// Moves Tylo to Duna's position in space.
// -- Note the "@" on the front of referenceBody. This means edit an existing attribute
@referenceBody = Sun


// Other orbit stuff
inclination = 1.22
eccentricity = 0.03
semiMajorAxis = 24708887045
longitudeOfAscendingNode = 0
argumentOfPeriapsis = 0
meanAnomalyAtEpoch = 3.14
epoch = 0
color = RGBA(102, 63.75, 38.25, 255)
}
}
}
@Kopernicus:FOR[AlternisKerbol]:NEEDS[GalacticNeighborhood]
{
@Body[Tylo]
{
@Properties
{
description = Stumbos is one of the largest rocky planets on record. With a very thin atmosphere and a very high gravity, it would be quite the challenge to land on. Not enough air to slow you down, and so much air that you have to worry about re-entry heating. Luckily engineers won't have to worry about landing on it, because it is a distant planet lightyears away.
}
}
}
// Apply this patch after the Kopernicus mod is loaded

And Duna:


@Kopernicus:FOR[AlternisKerbol]
{
// We want to make Duna orbit Tylo
@Body[Duna]
{

@Properties
{
tidallyLocked = true
description = Also known as The Butterscotch Dot Next To Tylo, Duna has been a wonder to Kerbalkind for quite some time after its discovery. It was the first secondary planet to be discovered around a primary planet other than Jool. If it does have life on it, it is probably butterscotch flavoured.
}
Debug
{
exportBin = false
}
@Template
{
removePQSMods = VertexColorMapBlend,PQSLandControl
}
@ScaledVersion
{
Material
{
texture = AlternisKerbol/Duna/Textures/Duna_Color
normals = AlternisKerbol/Duna/Textures/Duna_Normal
}
}

@PQS
{
Mods
{
VertexColorSolid
{
//Thanks Probus
blend = 0.0
//color = 0.01, 0.01, 0.01, 1.0
color = 0.1, 0.01, 0.01, 0.0
order = 19
}
VertexSimplexNoiseColor
{
seed = 45
blend = 0.5
colorStart = 0,0,0,0
//colorEnd = 1,1,1,1
colorEnd = 0,0,0,0
octaves = 12.0
persistence = 0.7
frequency = 2.0
enabled = true
order = 9999994
}
VertexColorMap
{
map = AlternisKerbol/Duna/Textures/Duna_Color.png
enabled = true
}
VertexHeightMap
{
map = AlternisKerbol/Duna/PluginData/Duna_Height.png
deformity = 11000
enabled = true
}
}
}
@Orbit
{
@referenceBody = Tylo
semiMajorAxis = 34598850
inclination = 0.7
eccentricity = 0.05
longitudeOfAscendingNode = 135.5
argumentOfPeriapsis = 0
meanAnomalyAtEpoch = 3.14
epoch = 0
color = RGBA(255, 185, 123, 255)
}
}
}


@Kopernicus:FOR[AlternisKerbol]:NEEDS[GalacticNeighborhood]
{
@Body[Duna]
{
@Properties
{
%description = Egar is a medium-sized moon orbiting Stumbos. It is colored a nice butterscotch color. It may very well hold life on its surface somewhere, because there's definitely some canalis. Maybe. It looks decently canal-like for sure. Hard to tell at this distance.
}
}
}
// Apply this patch after the Kopernicus mod is loaded

And the template:


// Requires SigmaBinary 1.1.1 //
//////////////////////////////////


//////////////////////////////////////////////////////////////////////
// Forum Thread: http://forum.kerbalspaceprogram.com/threads/127820 //
//////////////////////////////////////////////////////////////////////



@Kopernicus:NEEDS[SigmaBinary]:AFTER[SigmaBinary]
{

// INSTRUCTIONS:
// Copy this cfg anywhere into the GameData folder
// Set the name of the two bodies you want to turn into a binary system plus the reference body

@Body[Tylo] // Put here the name of the heavies body (eg: Pluto)
{
SigmaBinary = Primary // Don't change this line
}
@Body[Duna] // Put here the name of the lightest body (eg: Charon)
{
SigmaBinary = Secondary // Don't change this line
}
@Body[PARENT_NAME_HERE] // Put here the name of the body around which your binary system orbits (eg: Sun)
{
SigmaBinary = Reference // Don't change this line
}

}


// Now sit back and enjoy your binary system


// Sigma






////////////////////////////////////////////
// You don't need to read past this point //
////////////////////////////////////////////






// This part checks for a Finalize node inside Kopernicus


@Kopernicus:HAS[@Finalize]:NEEDS[SigmaBinary]:AFTER[SigmaBinary]
{
@Finalize:HAS[#finalizeOrbits[?rue]]
{
SigmaFinalize = True
}
@Finalize:HAS[~finalizeOrbits[?rue]]
{
SigmaFinalize = False
}
}
@Kopernicus:HAS[!Finalize]:NEEDS[SigmaBinary]:AFTER[SigmaBinary]
{
Finalize
{
SigmaFinalize = False
removeFinalize = True
}
}


// This part creates the barycenter


@Kopernicus:NEEDS[SigmaBinary]:AFTER[SigmaBinary]
{
+Body[SigmaBarycenter]
{
SigmaBinary = Barycenter
@name = #$/Body:HAS[#SigmaBinary[Primary]]/name$$/Body:HAS[#SigmaBinary[Secondary]]/name$
#/Body:HAS[#SigmaBinary[Primary]]/Orbit {}
@Properties
{
SigmaFinalize = #$/Finalize/SigmaFinalize$
}
}

// This part sets the Primary body

@Body:HAS[#SigmaBinary[Primary]]
{
@Properties
{
%solarRotationPeriod = false
SigmaFinalize = #$/Finalize/SigmaFinalize$
}


// Calculate the temporary SoI (only if it's not already explicitly set)


@Properties:HAS[~sphereOfInfluence
[*]]
{
sphereOfInfluence = #$mass$
@sphereOfInfluence /= #$/Body:HAS[#SigmaBinary[Reference]]/Properties/mass$
@sphereOfInfluence != 0.4
@sphereOfInfluence *= #$../Orbit/semiMajorAxis$
minSoI = 1
}

// Fixes the SoI if it's too small

@Properties:HAS[#minSoI[1]]
{
@minSoI = #$radius$
@minSoI *= 2
@minSoI -= #$radius$
@minSoI -= 40000
}
@Properties:[#minSoI[>0]|#minSoI[0]]
{
@minSoI += #$radius$
@minSoI += 40000
}
@Properties:HAS[#minSoI[<0]]
{
%minSoI = #$radius$
@minSoI *= 2
}
@Properties
{
@minSoI -= #$sphereOfInfluence$
}
@Properties:HAS[#minSoI[>0]]
{
@sphereOfInfluence += #$minSoI$
}

// Set orbital parameters

!Orbit {}
#/Body:HAS[#SigmaBinary[Secondary]]/Orbit {}
@Orbit
{
@color = #$/Body:HAS[#SigmaBinary[Barycenter]]/Orbit/color$
@referenceBody = #$/Body:HAS[#SigmaBinary[Barycenter]]/name$
@argumentOfPeriapsis += 180

// Set new semiMajorAxis

%semiMajorAxis = #$/Body:HAS[#SigmaBinary[Secondary]]/Properties/mass$
@semiMajorAxis += #$../Properties/mass$
@semiMajorAxis != -1
@semiMajorAxis *= #$/Body:HAS[#SigmaBinary[Secondary]]/Properties/mass$
@semiMajorAxis *= #$/Body:HAS[#SigmaBinary[Secondary]]/Orbit/semiMajorAxis$
}
}

// This part changes the SoI of the Secondary body when it's too small or too big
// If the original body have the SoI already explicitly set, this part won't change anything

@Body:HAS[#SigmaBinary[Secondary]]
{
@Properties:HAS[~sphereOfInfluence
[*]]
{
%sphereOfInfluence = #$mass$
@sphereOfInfluence /= #$/Body:HAS[#SigmaBinary[Primary]]/Properties/mass$
@sphereOfInfluence != 0.4
@sphereOfInfluence *= #$../Orbit/semiMajorAxis$
%maxSoI = 1
%minSoI = 1
}
@Properties:HAS[#minSoI[1]]
{
@minSoI = #$radius$
@minSoI *= 2
@minSoI -= #$radius$
@minSoI -= 40000
}
@Properties:[#minSoI[>0]|#minSoI[0]]
{
@minSoI += #$radius$
@minSoI += 40000
}
@Properties:HAS[#minSoI[<0]]
{
%minSoI = #$radius$
@minSoI *= 2
}
@Properties
{
@minSoI -= #$sphereOfInfluence$
}
@Properties:HAS[#minSoI[>0]]
{
@sphereOfInfluence += #$minSoI$
}
@Properties:HAS[#maxSoI[1]]
{
@maxSoI -= #$../Orbit/eccentricity$
@maxSoI *= #$../Orbit/semiMajorAxis$
@maxSoI -= #$radius$
@maxSoI -= #$/Body:HAS[#SigmaBinary[Primary]]/Properties/radius$
@maxSoI /= 2
@maxSoI += #$radius$
@maxSoI -= #$sphereOfInfluence$
}
@Properties:HAS[#maxSoI[<0]]
{
@sphereOfInfluence += #$maxSoI$
}
}

// This part sets Barycenter's mass, description and SoI

@Body:HAS[#SigmaBinary[Barycenter]]
{
@Properties:HAS[#SigmaFinalize[?rue]]
{
@mass += #$/Body:HAS[#SigmaBinary[Secondary]]/Properties/mass$
}
@Properties
{

// Set description

description = #This is the Barycenter of the $/Body:HAS[#SigmaBinary[Primary]]/name$-$/Body:HAS[#SigmaBinary[Secondary]]/name$ System.

// Set mass

@mass += #$/Body:HAS[#SigmaBinary[Primary]]/Properties/mass$
@mass *= #$/Body:HAS[#SigmaBinary[Primary]]/Orbit/semiMajorAxis$
@mass *= #$/Body:HAS[#SigmaBinary[Primary]]/Orbit/semiMajorAxis$
@mass *= #$/Body:HAS[#SigmaBinary[Primary]]/Orbit/semiMajorAxis$
@mass /= #$/Body:HAS[#SigmaBinary[Secondary]]/Orbit/semiMajorAxis$
@mass /= #$/Body:HAS[#SigmaBinary[Secondary]]/Orbit/semiMajorAxis$
@mass /= #$/Body:HAS[#SigmaBinary[Secondary]]/Orbit/semiMajorAxis$

// Set Sphere of Influence

%sphereOfInfluence = #$/Body:HAS[#SigmaBinary[Primary]]/Properties/sphereOfInfluence$
}
@Properties:HAS[#SigmaFinalize[?rue]]
{
@mass -= #$/Body:HAS[#SigmaBinary[Primary]]/Properties/mass$
}
}

// This part:
// Sets the final SoI value for the Primary Body
// Calculates the correct rotation period if the body is tidallyLocked

@Body:HAS[#SigmaBinary[Primary]]
{

// Set final SoI value

@Properties
{
%sphereOfInfluence = #$../Orbit/eccentricity$
@sphereOfInfluence += 1
@sphereOfInfluence *= #$../Orbit/semiMajorAxis$
@sphereOfInfluence += #$/Body:HAS[#SigmaBinary[Barycenter]]/Properties/sphereOfInfluence$
}

// If tidallyLocked fix the rotationPeriod

@Properties:HAS[#tidallyLocked[?rue]]
{
%rotationPeriod = 0
}
@Properties:HAS[#tidallyLocked[?rue],#SigmaFinalize[?rue]]
{
@rotationPeriod += #$/Body:HAS[#SigmaBinary[Barycenter]]/Properties/mass$
}
@Properties:HAS[#tidallyLocked[?rue]]
{
!tidallyLocked = DEL
%rotates = true
@rotationPeriod += #$/Body:HAS[#SigmaBinary[Reference]]/Properties/mass$
@rotationPeriod /= #$../Orbit/semiMajorAxis$
@rotationPeriod /= #$../Orbit/semiMajorAxis$
@rotationPeriod /= #$../Orbit/semiMajorAxis$
@rotationPeriod /= 5.91525585920849e11 // divide by (4*pi^2)/G
@rotationPeriod != -0.5
}
}
}


// This part adds an exception for ISRU contracts on the barycenter


@Contracts:NEEDS[SigmaBinary]:AFTER[SigmaBinary]
{
@ISRU
{
@RESOURCE_REQUEST[Ore]
{
Forbidden = #$@Kopernicus/Body:HAS[#SigmaBinary[Barycenter]]/name$
}
}
}


// This part clears temporary stuff


@Kopernicus:NEEDS[SigmaBinary]:AFTER[SigmaBinary]
{
@Body:HAS[#SigmaBinary
[*]]
{
!SigmaBinary = DEL
@Properties
{
!minSoI = DEL
!maxSoI = DEL
!SigmaFinalize = DEL
}
}
@Finalize:HAS[#SigmaFinalize
[*]]
{
!SigmaFinalize = DEL
}
!Finalize:HAS[#removeFinalize
[*]] {}
}
                      //////////////////////////////////

you don't have a PARENT_BODY set, you should put there the name of the body around which tylo rotates

Edited by Sigma88
Link to comment
Share on other sites

Ok oops My bad :)

- - - Updated - - -

Actually looking at that is it possible to make the Sun binary with Jool without setting PARENT_BODY?

nope, the sun is a special body and cannot be moved easily. that's a KSP limitation.

It is actually possible to do a Sun-Jool binary, but using SigmaBinary is not enough :)

Link to comment
Share on other sites

Ok good to know.

- - - Updated - - -

And by the way the binary system is fixed when putting @Kopernicus:NEEDS[sigmaBinary]:AFTER[sigmaBinary&AlternisKerbol] in the binary cfg.

the standard :AFTER[sigmaBinary] should be fine since AlternisKerbol comes before than SigmaBinary

Link to comment
Share on other sites

the standard :AFTER[sigmaBinary] should be fine since AlternisKerbol comes before than SigmaBinary

It might be because of where I put the files... template.cfg comes before AlternisKerbol/Tylo (folder). And template2.cfg comes after AlternisKerbol/Eeloo. Both were in the AlternisKerbol folder. AlternisKerbol also only had :FOR[AlternisKerbol] so it's definatly bad MM coding on my behalf :)

Link to comment
Share on other sites

Just saying, I have contracts showing up for the barycenters... Fix?

I can't do anything about that. the current contract system doesn't allow you to exclude bodies from getting contracts

or at least I was told it won't.

If anyone knows a way to remove contracts I'll be happy to implement it :)

Link to comment
Share on other sites

In the template.cfg you disabled ISRU contracts for the barycentre. I think it was something like this:




@Contracts:NEEDS[SigmaBinary]:AFTER[SigmaBinary]
{
@ISRU
{
@RESOURCE_REQUEST[Ore]
{
Forbidden = #$@Kopernicus/Body:HAS[#SigmaBinary[Barycenter]]/name$
}
}
}
// This part adds an exception for ISRU contracts on the barycenter

EDIT: Couldn't you:




@Contracts:NEEDS[SigmaBinary]:AFTER[SigmaBinary]
{
@Whatever contract you need
{
Forbidden = #$@Kopernicus/Body:HAS[#SigmaBinary[Barycenter]]/name$
}
}
// This part adds an exception for ISRU contracts on the barycenter

Edited by RA3236
Link to comment
Share on other sites

In the template.cfg you disabled ISRU contracts for the barycentre. I think it was something like this:




@Contracts:NEEDS[SigmaBinary]:AFTER[SigmaBinary]
{
@ISRU
{
@RESOURCE_REQUEST[Ore]
{
Forbidden = #$@Kopernicus/Body:HAS[#SigmaBinary[Barycenter]]/name$
}
}
}
// This part adds an exception for ISRU contracts on the barycenter

EDIT: Couldn't you:




@Contracts:NEEDS[SigmaBinary]:AFTER[SigmaBinary]
{
@Whatever contract you need
{
Forbidden = #$@Kopernicus/Body:HAS[#SigmaBinary[Barycenter]]/name$
}
}
// This part adds an exception for ISRU contracts on the barycenter

I could add that line, but I don't think ksp will look for that when generating contracts

Link to comment
Share on other sites

I need some help with kopernicus binary. I typed up the code for it, and it seems like it should work. But I don't know where to put the config file. Should it be put next to the system file for the mod or combined with the coding for the two orbiting bodies?

It doesn't matter where you put the .cfg file, it should work as long as you put it anywhere in the GameData folder.

if you are having troubles pm me the .cfg you are using and I may be able to help

Link to comment
Share on other sites

It doesn't matter where you put the .cfg file, it should work as long as you put it anywhere in the GameData folder.

if you are having troubles pm me the .cfg you are using and I may be able to help

For MM issues make it load before your planets to avoid issues. It was the one issue I found with MM and is easily fixed by doing so.

Link to comment
Share on other sites

For MM issues make it load before your planets to avoid issues. It was the one issue I found with MM and is easily fixed by doing so.

Actually this is not correct.

the patch contained in the template.cfg needs to be applied after the planet is defined, otherwise it would not be able to read the parameters of that planet :)

for this reason I made the patch apply at:

:AFTER[sigmaBinary]

This means that your planet needs to be created before that checkpoint.

usually planet packs use :AFTER[Kopernicus] which is fine.

the position of the file inside GameData has almost nothing to do with when the patch is applied.

of course if there are other configs that apply at the checkpoint :AFTER[sigmaBinary] the position will define which one is applied first.

But that should not affect the result, unless you are trying to nest binaries one into another.

Link to comment
Share on other sites

Sigma Binary[v1.2.1] is now available

Download

[TABLE=width: 145]

[TR]

[TD=align: center]

Latest Release

[TABLE=width: 90]

[TR]

[TD]a7Abccw.png

@GitHub

[/TD]

[/TR]

[/TABLE]

[/TD]

[/TR]

[/TABLE]

ChangeLog

[TABLE=width: 700]

[TR]

[TD]

[B]v1.2.1
[/B]
- Bug Hotfix


[B]v1.2.0[/B]

- Improved definition of template parameters
- Improved calculation of mass for planets
- Improved compatibility with [URL="http://forum.kerbalspaceprogram.com/threads/128856"][B]GalacticNeighborhood[/B][/URL]

[/TD]

[/TR]

[/TABLE]

Edited by Sigma88
hotfixed
Link to comment
Share on other sites

Could you please send me the KSP.log file (found in the ksp installation folder)

And the module manager cache (found in the GameData folder)

Thanks for reporting :)

---edit---

HOTFIXED

Edited by Sigma88
Link to comment
Share on other sites

  • 3 weeks later...

Hey, Sigma88, when will this plugin be updated for KSP 1.0.5? I'm stuck with 0.90 for now, but I will be getting 1.0.5 off of Steam soon and I would LOVE to use Sigma Binary in some of my planet packs. I will probably use it for the Titan-like planet Anthe in my Othrys Planet Pack, which will eventually have a large moon based off of Enceladus. They would look really cool as a binary. Right now, though, Anthe is very buggy and that moon won't come until at least version 0.6.

Edited by ProtoJeb21
Forgot to put something
Link to comment
Share on other sites

[quote name='ProtoJeb21']Hey, Sigma88, when will this plugin be updated for KSP 1.0.5? I'm stuck with 0.90 for now, but I will be getting 1.0.5 off of Steam soon and I would LOVE to use Sigma Binary in some of my planet packs. I will probably use it for the Titan-like planet Anthe in my Othrys Planet Pack, which will eventually have a large moon based off of Enceladus. They would look really cool as a binary. Right now, though, Anthe is very buggy and that moon won't come until at least version 0.6.[/QUOTE]
I'm waiting for kopernicus 0.5 to be released, plus I have some irl stuff to sort out that will keep me busy this week
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...