Private Sub chkPlanet_Click() If chkPlanet.Value = 1 Then chanceText.Enabled = True If chkPlanet.Value = 0 Then chanceText.Enabled = False End Sub Private Sub cmdCancel_Click() breakFlag = True End Sub Private Sub cmdStar_Click() Dim i, j, k, cnt, planetClass, moonClass, planetChance As Integer Dim noMoons, noPlanets, moon, cntPlanet, custNo, custCount As Integer Dim noTextures, noRingTextures, noCloudTex, lumClass, lumSub, cstarCount As Integer Dim bit, rndStar, lrndStar, sepOrbit As Long Dim r, e, d, planetRadius, starMag, moonRadius, rndColor, varColor, albedo As Double Dim min, sec, ra, dec, mult, axis, axisCount, moonAxis, innerRing, outerRing As Double Dim redAt, greenAt, blueAt, semiAxis, period, rotation, mean, incline, ecc As Double Dim distance, distR, raDist, decDist, multPlanets, lastRadius, lastAxis As Double Dim lumStar, starRadius, starTemp, absMag, appMag, atHeight As Double Dim s As String * 1 Dim decAdd, planetTexture, planetBump, planetSpec, planetColor, errText As String Dim planetClouds, specColor, hazeColor, upColor, skyColor, planetType, lumStr As String Dim moonType, planetNight, stType, stSub, stClass, msgText As String Dim planetFlag As Boolean 'On Error GoTo errorGenerate 'loadLog breakFlag = False planetFlag = False starValue = Val(starText.Text) If starValue < 1 Or starValue > 100000 Then Exit Sub If Val(hipText.Text) < 110000 Or Val(hipText.Text) > 99999999 Then Exit Sub planetBuffer = "" starBuffer = "" planetScript = "" starScript = "" radiusValue = Val(radText.Text) * 2 prgReport.Max = starValue + 1 noTextures = 4 min = (Val(ramText.Text) / 60) sec = (Val(rasText.Text) / 3600) ra = (Val(rahText.Text) + min + sec) ra = ra * 15 min = (Val(decmText.Text) / 60) sec = (Val(decsText.Text) / 3600) dec = Val(dechText.Text) decAdd = Str(dec) & Str(min + sec) dec = Val(decAdd) magValue = Val(varText.Text) custCount = 0 custFlag = False staticFlag = False If aText.Text = "" Then aText.Text = "1.0" Randomize Timer If optForm.chkSeed.Value = True Then Randomize Val(optForm.seedText.Text) lrndStar = rndStar Debug.Print "~" For i = 0 To 50 custStarLabel(i) = 0 Next i For i = noCust To 50 custStar(i) = "0" Next i lrndStar = 0 For i = 0 To noCust - 1 Do rndStar = Int(Rnd(1) * starValue) + Val(hipText.Text) Loop While rndStar < lrndStar lrndStar = rndStar custStarLabel(i) = rndStar Next i For i = 1 To starValue DoEvents custFlag = False planetFlag = False If breakFlag = True Then breakFlag = False prgReport.Value = 0 prgPlanet.Value = 0 Exit Sub End If r = Rnd(1) e = Rnd(1) d = Rnd(1) r = r - Rnd(1) e = e - Rnd(1) d = d - Rnd(1) ' 100 / + (starValue - i) r = r / ((radiusValue / Val(cText.Text)) + (starValue - i) / Val(cText.Text)) e = e / ((radiusValue / Val(cText.Text)) + (starValue - i) / Val(cText.Text)) d = d / ((radiusValue / Val(cText.Text)) + (starValue - i) / Val(cText.Text)) r = r * (radiusValue / Val(aText.Text)) '2.75 & 0.65 e = e * (radiusValue / Val(rText.Text)) d = d * (radiusValue * (radiusValue * Val(dText.Text))) d = d * (Val(distText.Text) / (133 * radiusValue)) raValue = ra + r decValue = dec + e distValue = Val(distText.Text) + d specType = Int(100 * Rnd(1)) s = "G" If specType < 1 And specType > -1 Then s = "Q" If specType < 2 And specType > 0 Then s = "O" If specType < 3 And specType > 1 Then s = "B" If specType < 5 And specType > 2 Then s = "A" If specType < 20 And specType > 4 Then s = "F" If specType < 50 And specType > 19 Then s = "G" If specType < 60 And specType > 49 Then s = "K" If specType < 75 And specType > 59 Then s = "M" If specType < 101 And specType > 74 Then s = "R" lumClass = Int(Rnd(1) * 8) lumSub = Int(Rnd(1) * 8) lumStr = "V" If lumClass = 0 Then lumStr = "Ia-O" If lumClass = 1 Then lumStr = "Ia" If lumClass = 2 Then lumStr = "Ib" If lumClass = 3 Then lumStr = "II" If lumClass = 4 Then lumStr = "III" If lumClass = 5 Then lumStr = "IV" If lumClass = 6 Then lumStr = "V" If lumClass = 7 Then lumStr = "VI" starMag = Int(Val(magText.Text) + ((Rnd(1) * magValue) - (Rnd(1) * magValue))) If s = "S" And chkBlack.Value = 1 Then starMag = starMag + 25 If s = "S" And chkBlack.Value = 0 Then starMag = starMag - 10 If s = "Q" Then lumSub = 0 lumStr = "V" starMag = starMag + 15 End If If i = 1 And optForm.chkCenter.Value = 1 Then raValue = ra decValue = dec distValue = Val(distText.Text) s = "S" lumSub = 0 lumStr = "V" End If If chkPlanet.Value = 1 And custStarLabel(custCount) = Val(hipText.Text) + i Then s = Mid$(custStar(custCount), 1, 1) lumSub = Val(Mid$(custStar(custCount), 2, 1)) lumStr = Mid$(custStar(custCount), 3, Len(custStar(custCount))) starMag = Val(custSize(custCount)) If lumStr = "Ia-O" Then lumClass = 0 If lumStr = "Ia" Then lumClass = 1 If lumStr = "Ib" Then lumClass = 2 If lumStr = "II" Then lumClass = 3 If lumStr = "III" Then lumClass = 4 If lumStr = "IV" Then lumClass = 5 If lumStr = "V" Then lumClass = 6 If lumStr = "VI" Then lumClass = 7 End If prgReport.Value = i If Len(starScript) > 5000 Then starBuffer = starBuffer & starScript starScript = "" End If starScript = starScript & "# HIP " & (Val(hipText.Text) + i - 1) starScript = starScript & Chr$(13) & Chr$(10) & (Val(hipText.Text) + i - 1) & " {" starScript = starScript & Chr$(13) & Chr$(10) & Chr$(9) & "RA " & Format$(raValue, "0.00000000") starScript = starScript & Chr$(13) & Chr$(10) & Chr$(9) & "Dec " & Format$(decValue, "0.00000000") starScript = starScript & Chr$(13) & Chr$(10) & Chr$(9) & "Distance " & Format$(distValue, "0.0000") starScript = starScript & Chr$(13) & Chr$(10) & Chr$(9) & "SpectralType " & Chr$(34) & s & lumSub & lumStr & Chr$(34) ' find the luminosity and the radius appMag = starMag absMag = (appMag + 5 - 5 * Log10(distValue / LY_PER_PARSEC)) lumStar = Exp((SOLAR_ABSMAG - absMag) / LN_MAG) Select Case s Case "O" starTemp = oTemp(lumSub) Case "B" starTemp = bTemp(lumSub) Case "A" starTemp = aTemp(lumSub) Case "F" starTemp = fTemp(lumSub) Case "G" starTemp = gTemp(lumSub) Case "K" starTemp = kTemp(lumSub) Case "M" starTemp = mTemp(lumSub) Case "R" starTemp = mTemp(lumSub) Case "S" starTemp = mTemp(lumSub) Case Else starTemp = 10000 End Select starRadius = SOLAR_RADIUS starRadius = starRadius * Sqr(lumStar) starRadius = starRadius * (SOLAR_TEMP / starTemp) ^ 2 starRadius = starRadius / SOLAR_RADIUS starScript = starScript & Chr$(13) & Chr$(10) & Chr$(9) & "AppMag " & Format$(starMag, "0.00") & " # Radii: " & starRadius starScript = starScript & Chr$(13) & Chr$(10) & "}" & Chr$(13) & Chr$(10) If chkPulsar.Value = 1 Then If s = "Q" Then planetScript = planetScript & "# HIP " & (Val(hipText.Text) + i - 1) planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(34) & "PSR " & (Val(hipText.Text) + i - 1) & "+" & i & Chr$(34) planetScript = planetScript & " " & Chr$(34) & "HIP " & (Val(hipText.Text) + i - 1) & Chr$(34) planetScript = planetScript & Chr$(13) & Chr$(10) & "{" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Mesh " & Chr$(34) & "pulsar.3ds" & Chr$(34) planetRadius = (starRadius * 850000) * 36 planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Radius " & Format$(planetRadius, "0.00") planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Emissive true" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "EllipticalOrbit {" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Period 1000" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "SemiMajorAxis 0.0" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Eccentricity 0.0" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Inclination 0.0" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "}" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "RotationPeriod 0.001" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Albedo 1" planetScript = planetScript & Chr$(13) & Chr$(10) & "}" & Chr$(13) & Chr$(10) End If End If If chkBlack.Value = 1 And optForm.chkCenter.Value = 1 Then If i = 1 Then planetScript = planetScript & "# HIP " & (Val(hipText.Text) + i - 1) planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(34) & "X " & (Val(hipText.Text) + i - 1) & "+" & i & Chr$(34) planetScript = planetScript & " " & Chr$(34) & "HIP " & (Val(hipText.Text) + i - 1) & Chr$(34) planetScript = planetScript & Chr$(13) & Chr$(10) & "{" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Texture " & Chr$(34) & "gc_black.jpg" & Chr$(34) planetRadius = (starRadius * 850000) planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Radius " & Format$(planetRadius, "0.00") planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Emissive true" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Color [ 0.01 0 0 ]" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Atmosphere {" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Height " & Format$(planetRadius * 3, "0.00") planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Lower [ 0 0 0 ]" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Upper [ 0 0 0 ]" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "}" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "EllipticalOrbit {" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Period 1000" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "SemiMajorAxis 10e-" & Format$((starMag / 4), "0") planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Eccentricity 0.0" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Inclination 0.0" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "}" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "RotationPeriod 0.001" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Albedo 0.01" planetScript = planetScript & Chr$(13) & Chr$(10) & "}" & Chr$(13) & Chr$(10) End If End If If chkPlanet.Value = 1 Then planetChance = Int(Rnd(1) * 100) custFlag = False cstarCount = 1 If custStarLabel(custCount) = Val(hipText.Text) + i Then planetFlag = True custFlag = True End If If custStarLabel(custCount) <> Val(hipText.Text) + i Then custFlag = False If planetChance < Val(chanceText.Text) And lumClass > 3 And _ starRadius < 2.1 Then planetFlag = True End If End If End If ' Sun must be less than 2.1 times bigger than our sun to possess planets If planetFlag = True Then noPlanets = 0 cntPlanet = 0 raDist = (Abs(raValue - ra) / 0.0046) decDist = (Abs(decValue - dec) / 0.004) distance = Abs(distValue - Val(distText.Text)) distR = (raDist + decDist + distance) / 3 multPlanets = Val(radText.Text) / 1.5 'noPlanets = Int(Rnd(1) * (10 * starRadius)) If s = "G" Then noPlanets = Int(Rnd(1) * (10 * starRadius)) If optForm.chkExplicit.Value = 1 Then noPlanets = Int(Rnd(1) * ((20 / multPlanets) * starRadius * (distR / 2))) specColor = "[ 0.8 0.8 0.4 ]" End If 'noPlanets = Int(Rnd(1) * (10 * starRadius)) If s = "F" Then noPlanets = Int(Rnd(1) * (10 * starRadius)) If optForm.chkExplicit.Value = 1 Then noPlanets = Int(Rnd(1) * ((20 / multPlanets) * starRadius * (distR / 2))) specColor = "[ 0.8 0.8 0.4 ]" End If 'noPlanets = Int(Rnd(1) * (10 * starRadius)) If s = "K" Then noPlanets = Int(Rnd(1) * (10 * starRadius)) If optForm.chkExplicit.Value = 1 Then noPlanets = Int(Rnd(1) * ((20 / multPlanets) * starRadius * (distR / 2))) specColor = "[ 0.8 0.8 0.4 ]" End If 'noPlanets = Int(Rnd(1) * (6 * starRadius)) If s = "M" Then noPlanets = Int(Rnd(1) * (6 * starRadius)) If optForm.chkExplicit.Value = 1 Then noPlanets = Int(Rnd(1) * ((12 / multPlanets) * starRadius * (distR / 2))) specColor = "[ 0.8 0.4 0.4 ]" End If 'noPlanets = Int(Rnd(1) * (6 * starRadius)) If s = "R" Then noPlanets = Int(Rnd(1) * (6 * starRadius)) If optForm.chkExplicit.Value = 1 Then noPlanets = Int(Rnd(1) * ((12 / multPlanets) * starRadius * (distR / 2))) specColor = "[ 0.8 0.2 0.2 ]" End If 'noPlanets = Int(Rnd(1) * (3 * starRadius)) If s = "O" Then noPlanets = Int(Rnd(1) * (3 * starRadius)) If optForm.chkExplicit.Value = 1 Then noPlanets = Int(Rnd(1) * ((6 / multPlanets) * starRadius * (distR / 2))) specColor = "[ 0.5 0.5 1 ]" End If 'noPlanets = Int(Rnd(1) * (3 * starRadius)) If s = "B" Then noPlanets = Int(Rnd(1) * (3 * starRadius)) If optForm.chkExplicit.Value = 1 Then noPlanets = Int(Rnd(1) * ((6 / multPlanets) * starRadius * (distR / 2))) specColor = "[ 0.3 0.3 0.8 ]" End If If custFlag = True Then For k = custCount To noCust - 1 If custStar(k) = custStar(k + 1) Then cstarCount = cstarCount + 1 End If Next k noPlanets = cstarCount End If ' 0.5 will produce earthlike world If optForm.chkPlanet.Value = 0 And optForm.chkStar.Value = 0 Then GoTo skipPlanets If noPlanets > 0 Then If noPlanets > 20 Then noPlanets = 20 prgPlanet.Max = noPlanets + 1 lastRadius = 100 axis = (Rnd(1) * starRadius / 4) + starRadius / 4 lastAxis = axis / 2 semiAxis = axis For j = 1 To noPlanets DoEvents If breakFlag = True Then prgReport.Value = 0 prgPlanet.Value = 0 breakFlag = False Exit Sub End If ' CHOOSE PLANET CLASS prgPlanet.Value = j planetClass = 7 planetType = "Asteroid " noTextures = 4 noCloudTex = 4 sepOrbit = 5000 If custFlag = False Then planetChance = Int(Rnd(1) * 100) If planetChance < 40 And planetChance > -1 And optForm.chkPlanet.Value = 1 Then planetClass = 2 'moontype planetType = "Lunar Planet " noTextures = Val(optForm.texLunar.Text) End If If planetChance < 55 And planetChance > 39 And optForm.chkPlanet.Value = 1 Then planetClass = 1 'rocky planetType = "Rocky Planet " noTextures = Val(optForm.texRocky.Text) End If If planetChance < 85 And planetChance > 54 And optForm.chkPlanet.Value = 1 Then planetClass = 0 'jovan planetType = "Gas Giant " noTextures = Val(optForm.texGasgt.Text) noCloudTex = Val(optForm.texGasgtC.Text) End If If planetChance < 101 And planetChance > 84 And optForm.chkPlanet.Value = 1 Then planetClass = 7 'asteroid planetType = "Asteroid " noTextures = Val(optForm.texLunar.Text) End If planetChance = Int(Rnd(1) * 100) If planetChance < 10 And planetChance > -1 And optForm.chkStar.Value = 1 Then planetClass = 5 'star planetType = "Companion Star " noTextures = Val(optForm.texStar.Text) End If If planetChance < 20 And planetChance > 9 And optForm.chkStar.Value = 1 Then planetClass = 6 'brown dwarf planetType = "Substellar Obj " noTextures = Val(optForm.texGasgt.Text) noCloudTex = Val(optForm.texGasgtC.Text) End If End If If custFlag = True Then planetClass = Val(custClass(custCount)) planetType = custName(custCount) End If ' SEMI AXIS If planetClass = 0 Then sepOrbit = 50000 If planetClass = 1 Then sepOrbit = 10000 If planetClass = 2 Then sepOrbit = 5000 If planetClass = 3 Then sepOrbit = 5000 If planetClass = 4 Then sepOrbit = 5000 If planetClass = 5 Then sepOrbit = 1500000 If planetClass = 6 Then sepOrbit = 200000 If planetClass = 7 Then sepOrbit = 400 If planetClass = 8 Then sepOrbit = 50000 If planetClass = 9 Then sepOrbit = 6000 If planetClass = 10 Then sepOrbit = 5000 If planetClass = 11 Then sepOrbit = 10 semiAxis = lastAxis + (axis * ((starRadius / 4 * (j / 2)) * starRadius)) + _ (sepOrbit / 500000 + lastRadius / 500000) If lastAxis > starRadius * 1.5 Then semiAxis = lastAxis + (axis * ((starRadius / 3 * (j ^ 1.5)) * starRadius)) + _ (sepOrbit / 250000 + lastRadius / 250000) End If If custFlag = False Then Select Case planetClass Case 1, 2, 7 If semiAxis > (starRadius - 0.3) And semiAxis < starRadius And semiAxis > 0.7 _ And s <> "Q" And optForm.chkPlanet.Value = 1 And starTemp > 5000 And starTemp < 6500 Then planetClass = 3 'earthtype planetType = "Earthlike Planet " noTextures = Val(optForm.texEarth.Text) noCloudTex = Val(optForm.texEarthC.Text) End If If semiAxis > (starRadius - 0.6) And semiAxis < (starRadius - 0.3) And semiAxis > 0.5 _ And s <> "Q" And optForm.chkPlanet.Value = 1 And starTemp > 5500 And starTemp < 7000 Then planetClass = 10 'earthtype II planetType = "Desert Planet " noTextures = Val(optForm.texDeser.Text) noCloudTex = Val(optForm.texDeserC.Text) End If Case 0 planetChance = Int(Rnd(1) * 100) If planetChance < 34 And j = 1 And optForm.chkPlanet.Value = 1 And starTemp < 7000 Then planetClass = 8 planetType = "Epistellar Giant " semiAxis = starRadius / 20 End If End Select If j = 1 And starTemp < 7001 Then planetChance = Int(Rnd(1) * 100) If planetClass = 1 Or planetClass = 2 And planetChance < 34 And optForm.chkPlanet.Value = 1 Then planetClass = 9 planetType = "Vulcan Planet " semiAxis = starRadius / 10 noTextures = Val(optForm.texVulca.Text) End If End If If starTemp > 7000 Then If optForm.chkPlanet.Value = 1 And semiAxis < (0.0015 * starTemp) Then planetClass = 9 planetType = "Vulcan Planet " noTextures = Val(optForm.texVulca.Text) End If End If If planetClass = 1 Or planetClass = 2 Then If semiAxis > (0.005 * starTemp) And optForm.chkPlanet.Value = 1 Then planetClass = 4 'arctic planetType = "Arctic Planet " noTextures = Val(optForm.texFroze.Text) End If End If End If ' PLANET RADIUS If planetClass = 0 Then planetRadius = (Rnd(1) * 50000) + 50000 If planetClass = 1 Then planetRadius = (Rnd(1) * 10000) + 1000 If planetClass = 2 Then planetRadius = (Rnd(1) * 5000) + 1000 If planetClass = 3 Then planetRadius = (Rnd(1) * 5000) + 5000 If planetClass = 4 Then planetRadius = (Rnd(1) * 5000) + 1000 If planetClass = 5 Then planetRadius = (Rnd(1) * 1500000) + 500000 If planetClass = 6 Then planetRadius = (Rnd(1) * 200000) + 100000 If planetClass = 7 Then planetRadius = (Rnd(1) * 500) + 500 If planetClass = 8 Then planetRadius = (Rnd(1) * 50000) + 50000 If planetClass = 9 Then planetRadius = (Rnd(1) * 6000) + 6000 If planetClass = 10 Then planetRadius = (Rnd(1) * 5000) + 5000 If planetClass = 11 Then planetRadius = (Rnd(1) * 10) + 2 If custFlag = True And Val(custRings(custCount)) = 1 And planetRadius < 8001 Then cnt = Abs(8000 - planetRadius) planetRadius = cnt + 8000 End If ' SEMI AXIS lastRadius = planetRadius lastAxis = semiAxis ' MAIN BODY If optForm.chkPlanet.Value = 1 Or optForm.chkStar.Value = 1 Then cntPlanet = cntPlanet + 1 If custFlag = False Then planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(34) & _ planetType & Chr$(97 + cntPlanet) & Chr$(34) End If If custFlag = True Then planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(34) & _ planetType & Chr$(34) End If planetScript = planetScript & " " & Chr$(34) & "HIP " & (Val(hipText.Text) + i - 1) & Chr$(34) planetScript = planetScript & Chr$(13) & Chr$(10) & "{" ' TEXTURE planetChance = Int(Rnd(1) * noTextures) + 1 If planetClass < 5 Or planetClass = 10 Then planetTexture = dataList.List(planetClass) & Format$(planetChance, "00") & ".jpg" planetBump = dataList.List(planetClass) & Format$(planetChance, "00") & "-bump.jpg" cnt = Int(Rnd(1) * noCloudTex) + 1 planetClouds = dataList.List(planetClass) & Format$(cnt, "00") & "-clouds.png" planetSpec = "" If planetClass = 0 Or planetClass = 3 Or planetClass = 4 Then planetSpec = dataList.List(planetClass) & Format$(planetChance, "00") & "-spec.jpg" End If End If If planetClass = 5 Then If Val(optForm.texStar.Text) > 1 Then planetChance = Int(Rnd(1) * Val(optForm.texStar.Text)) + 1 planetTexture = "gc_star_" & Format$(planetChance, "00") & ".jpg" Else: planetTexture = "gc_star.jpg" End If planetBump = "" If planetClass = 5 Then planetClouds = "no-clouds.png" planetSpec = "" End If If planetClass = 6 Then planetTexture = "gc_gasgt_" & Format$(planetChance, "00") & ".jpg" planetBump = "" cnt = Int(Rnd(1) * noCloudTex) + 1 planetClouds = "gc_gasgt_" & Format$(cnt, "00") & "-clouds.png" planetSpec = "" End If If planetClass = 7 And custFlag = False Then planetTexture = dataList.List(2) & Format$(planetChance, "00") & ".jpg" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Mesh " & Chr$(34) & "roughsphere.cms" & Chr$(34) planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Class " & Chr$(34) & "asteroid" & Chr$(34) End If If planetClass = 8 Then planetTexture = "gc_epigt.jpg" planetBump = "gc_epigt-bump.jpg" planetClouds = "gc_epigt-clouds.png" planetSpec = "gc_epigt-spec.jpg" End If If planetClass = 9 Then planetTexture = dataList.List(planetClass) & Format$(planetChance, "00") & ".jpg" planetBump = dataList.List(planetClass) & Format$(planetChance, "00") & "-bump.jpg" planetNight = dataList.List(planetClass) & Format$(planetChance, "00") & "-night.jpg" planetSpec = dataList.List(planetClass) & Format$(planetChance, "00") & "-spec.jpg" End If ' CUSTOM PLANET If custFlag = True Then If custTex(custCount) <> "" Then planetTexture = custTex(custCount) & ".jpg" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Texture " & Chr$(34) & planetTexture & Chr$(34) End If If Val(custBump(custCount)) = 1 Then planetBump = custTex(custCount) & "-bump.jpg" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "BumpMap " & Chr$(34) & planetBump & Chr$(34) planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "BumpHeight 2" End If If Val(custNight(custCount)) = 1 Then planetNight = custTex(custCount) & "-night.jpg" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "NightTexture " & Chr$(34) & planetNight & Chr$(34) End If If Val(custSpec(custCount)) = 1 Then planetSpec = custTex(custCount) & "-spec.jpg" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "SpecularTexture " & Chr$(34) & planetSpec & Chr$(34) planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "SpecularColor " & specColor planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "SpecularPower 45.0" End If If Val(custClouds(custCount)) = 1 Then planetClouds = custTex(custCount) & "-clouds.png" End If If Val(custEmiss(custCount)) = 1 Then planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Emissive true" End If If custModel(custCount) <> "" Then planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Mesh " & Chr$(34) & custModel(custCount) & Chr$(34) End If End If If custFlag = False Then planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Texture " & Chr$(34) & planetTexture & Chr$(34) If planetClass = 9 Then planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "NightTexture " & Chr$(34) & planetNight & Chr$(34) End If If planetClass < 5 Or planetClass > 7 Then planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "BumpMap " & Chr$(34) & planetBump & Chr$(34) planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "BumpHeight 2" End If If planetClass = 0 Or planetClass = 3 Or planetClass = 4 Or _ planetClass = 8 Or planetClass = 9 Then planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "SpecularTexture " & Chr$(34) & planetSpec & Chr$(34) planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "SpecularColor " & specColor planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "SpecularPower 45.0" End If End If redAt = Rnd(1) * 0.8 greenAt = Rnd(1) * 0.8 blueAt = Rnd(1) * 0.8 albedo = (redAt + greenAt + blueAt) / 3 varColor = albedo / 2 planetColor = "Color [ " & Format$(redAt, "0.00") & " " & Format$(greenAt, "0.00") planetColor = planetColor & " " & Format$(blueAt, "0.00") & " ]" If planetClass = 4 Or planetClass = 7 Then planetColor = "Color [ " & Format$(((Rnd(1) * 0.2) + 0.5), "0.00") planetColor = planetColor & " " & Format$(((Rnd(1) * 0.2) + 0.5), "0.00") planetColor = planetColor & " " & Format$(((Rnd(1) * 0.2) + 0.5), "0.00") planetColor = planetColor & " ]" End If If planetClass = 5 Then planetColor = "Color [ " & Format$(redAt + 0.2, "0.00") & " " & Format$(greenAt + 0.2, "0.00") planetColor = planetColor & " " & Format$(blueAt + 0.2, "0.00") & " ]" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Emissive true" End If If planetClass = 6 Then planetColor = "Color [ " & Format$(redAt, "0.00") & " " & Format$(greenAt, "0.00") planetColor = planetColor & " " & Format$(blueAt, "0.00") & " ]" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Emissive true" 'varColor = varColor / 2 End If planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & planetColor planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "BlendTexture true" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Radius " & Format$(planetRadius, "0.00") ' ATMOSPHERE planetChance = Int(Rnd(1) * 100) atmosphere = False If planetChance < 50 Then atmosphere = True If semiAxis < starRadius / 3 Then atmosphere = False If planetRadius < 1001 Then atmosphere = False If s = "Q" And planetClass <> 0 Then atmosphere = False If planetClass = 4 Or planetClass = 7 Then atmosphere = False If planetClass = 0 Or planetClass = 3 Or planetClass = 5 Or _ planetClass = 6 Or planetClass = 8 Or planetClass = 10 Then atmosphere = True If custFlag = True And custAt(custCount) = 1 Then atmosphere = True If custFlag = True And custAt(custCount) = 0 Then atmosphere = False If atmosphere = True Then If planetClass < 5 Or planetClass > 7 Then hazeColor = "[ " & Format$((Rnd(1) * albedo + 0.1), "0.00") & " " & Format$((Rnd(1) * albedo + 0.1), "0.00") & _ " " & Format$((Rnd(1) * albedo + 0.1), "0.00") & " ]" upColor = "[ " & Format$((Rnd(1) * albedo + 0.1), "0.00") & " " & Format$((Rnd(1) * albedo + 0.1), "0.00") & _ " " & Format$((Rnd(1) * albedo + 0.1), "0.00") & " ]" skyColor = "[ " & Format$((Rnd(1) * albedo + 0.1), "0.00") & " " & Format$((Rnd(1) * albedo + 0.1), "0.00") & _ " " & Format$((Rnd(1) * albedo + 0.1), "0.00") & " ]" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "HazeColor " & hazeColor End If If planetClass < 5 Or planetClass > 8 Then planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "HazeDensity 0.5" End If If planetClass = 8 Then planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "HazeDensity 0.8" End If If planetClass = 5 Then hazeColor = "[ " & Format$(redAt + 0.2, "0.00") & " " & Format$(greenAt + 0.2, "0.00") & _ " " & Format$(blueAt + 0.2, "0.00") & " ]" upColor = "[ " & Format$(Rnd(1) * 1, "0.00") & " " & Format$(Rnd(1) * 1, "0.00") & _ " " & Format$(Rnd(1) * 1, "0.00") & " ]" skyColor = "[ " & Format$(Rnd(1) * 1, "0.00") & " " & Format$(Rnd(1) * 1, "0.00") & _ " " & Format$(Rnd(1) * 1, "0.00") & " ]" End If If planetClass = 6 Then hazeColor = "[ " & Format$(redAt, "0.00") & " " & Format$(greenAt, "0.00") & _ " " & Format$(blueAt, "0.00") & " ]" upColor = "[ " & Format$((Rnd(1) * 1) / 1.5, "0.00") & " " & Format$((Rnd(1) * 1) / 1.5, "0.00") & _ " " & Format$((Rnd(1) * 1) / 1.5, "0.00") & " ]" skyColor = "[ " & Format$((Rnd(1) * 1) / 1.5, "0.00") & " " & Format$((Rnd(1) * 1) / 1.5, "0.00") & _ " " & Format$((Rnd(1) * 1) / 1.5, "0.00") & " ]" End If planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Atmosphere {" If planetClass < 5 And planetClass > 0 Then atHeight = planetRadius / ((Rnd(1) + 0.5) * 80) If planetClass > 8 Then atHeight = planetRadius / ((Rnd(1) + 0.5) * 80) If planetClass = 5 Then atHeight = planetRadius * 3 If planetClass = 6 Then atHeight = planetRadius / ((Rnd(1) + 0.5) * 10) If planetClass = 0 Or planetClass = 8 Then atHeight = planetRadius / ((Rnd(1) + 0.5) * 35) planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Height " & Format$(atHeight, "0.00") planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Lower " & hazeColor planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Upper " & upColor planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Sky " & skyColor If planetClass <> 6 Then planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "CloudHeight " & Format$(atHeight / 10, "0.00") Else planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "CloudHeight " & Format$(atHeight / 20, "0.00") End If If planetClass < 8 Or planetClass > 8 Then planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "CloudSpeed " & Format$(planetRadius / 133, "0.00") Else planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "CloudSpeed 0" End If planetChance = Int(Rnd(1) * 100) If planetChance < 34 And custFlag = False Then If planetClass = 1 Or planetClass = 2 Or planetClass = 9 Then cnt = Int(Rnd(1) * Val(optForm.texGener.Text)) + 1 planetClouds = "gc_gener_" & Format$(cnt, "00") & "-clouds.png" End If End If planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "CloudMap " & Chr$(34) & planetClouds & Chr$(34) planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "}" End If ' ORBIT INFO period = Sqr(semiAxis * semiAxis * semiAxis) planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "EllipticalOrbit {" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Period " & Format$(period, "0.0000") planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "SemiMajorAxis " & Format$(semiAxis, "0.0000") If planetClass < 7 Or planetClass > 7 Then planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Eccentricity " & Format$(((Rnd(1) / 1000) * semiAxis), "0.0000") planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Inclination " & Format$(((Rnd(1) / 100) * semiAxis), "0.0000") End If If planetClass = 7 Then planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Eccentricity " & Format$(((Rnd(1) / 100) * semiAxis), "0.0000") planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Inclination " & Format$((Rnd(1) * (semiAxis / 10)), "0.0000") End If If planetClass <> 8 Then planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "MeanAnomaly " & Format$((Rnd(1) * 360), "0.00") End If planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "}" ' RINGS If planetClass = 0 Or planetClass = 3 Or planetClass = 6 Or planetClass > 8 Or Val(custRings(custCount)) = 1 Then If custFlag = False Then planetChance = Int(Rnd(1) * 100) Else: planetChance = 1 End If If planetChance < 34 And planetRadius > 8000 Then cnt = Int(Rnd(1) * Val(optForm.texRings.Text)) + 1 planetTexture = "gc_rings_" & Format$(cnt, "00") & ".png" innerRing = planetRadius * 1.2375 * ((Rnd(1) * 0.75) + 1) outerRing = planetRadius * 1.2375 * ((Rnd(1) * 2) + 1) planetColor = "[ " & Format$(varColor + redAt / 3.5, "0.00") & " " & Format$(varColor + greenAt / 3.5, "0.00") planetColor = planetColor & " " & Format$(varColor + blueAt / 3.5, "0.00") & " ]" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Rings {" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Inner " & Format$(innerRing, "0.00") planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Outer " & Format$(outerRing, "0.00") planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Texture " & Chr$(34) & planetTexture & Chr$(34) planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Color " & planetColor planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "}" End If End If If planetClass < 8 Or planetClass > 8 Then planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "RotationPeriod " & Format$((planetRadius / 250) * ((Rnd(1) * 2) + 1), "0.00") planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Obliquity " & Format$((Rnd(1) * 90) - (Rnd(1) * 90), "0.00") End If If planetClass = 9 And j > 1 Then planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "RotationPeriod " & Format$((planetRadius / 250) * ((Rnd(1) * 2) + 1), "0.00") planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Obliquity " & Format$((Rnd(1) * 90) - (Rnd(1) * 90), "0.00") End If planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Albedo " & Format$(albedo, "0.00") planetScript = planetScript & Chr$(13) & Chr$(10) & "}" & Chr$(13) & Chr$(10) If Len(planetScript) > 8000 Then planetBuffer = planetBuffer & planetScript planetScript = "" End If End If ' MOONS If semiAxis > starRadius / 1.5 And planetRadius > 2000 And optForm.chkPlanet.Value = 1 Then If planetClass = 0 Then noMoons = Int(Rnd(1) * ((0.0075 * semiAxis) * (planetRadius / 1000))) + 1 If planetClass = 1 Then noMoons = Int(Rnd(1) * (0.5 * (planetRadius / 1000))) + 1 If planetClass = 2 Then noMoons = Int(Rnd(1) * (1 * (planetRadius / 1000))) + 1 If planetClass = 3 Then noMoons = Int(Rnd(1) * (0.5 * (planetRadius / 1000))) + 1 If planetClass = 4 Then noMoons = Int(Rnd(1) * (0.5 * (planetRadius / 1000))) + 1 If planetClass = 5 Then noMoons = Int(Rnd(1) * ((0.0002 * semiAxis) * (planetRadius / 1000))) + 1 If planetClass = 6 Then noMoons = Int(Rnd(1) * ((0.002 * semiAxis) * (planetRadius / 1000))) + 1 If planetClass = 9 Then noMoons = Int(Rnd(1) * (0.5 * (planetRadius / 1000))) + 1 If planetClass = 10 Then noMoons = Int(Rnd(1) * (0.5 * (planetRadius / 1000))) + 1 If noMoons > 20 Then noMoons = 20 For moon = 1 To noMoons DoEvents noTextures = 4 noCloudTex = 4 If breakFlag = True Then prgReport.Value = 0 prgPlanet.Value = 0 breakFlag = False Exit Sub End If moonClass = 7 moonType = "Asteroid" If planetChance < 10 And planetChance > -1 And planetClass = 5 Then moonClass = 0 'jovan moonType = "Gas Giant" noTextures = Val(optForm.texGasgt.Text) noCloudTex = Val(optForm.texGasgtC.Text) End If If planetChance < 35 And planetChance > 9 Then moonClass = 1 'rocky moonType = "Rocky" noTextures = Val(optForm.texRocky.Text) End If If planetChance < 55 And planetChance > 34 Then moonClass = 2 'moontype moonType = "Lunar" noTextures = Val(optForm.texLunar.Text) End If If planetChance < 75 And planetChance > 54 Then moonClass = 7 'asteroid moonType = "Asteroid" noTextures = Val(optForm.texLunar.Text) End If If planetChance < 101 And planetChance > 74 And _ semiAxis > (0.005 * starTemp) And planetClass <> 5 And _ optForm.chkPlanet.Value = 1 Then moonClass = 4 'arctic moonType = "Arctic" noTextures = Val(optForm.texFroze.Text) End If If planetClass = 0 Or planetClass = 6 Then If semiAxis > (starRadius - 0.3) And semiAxis < starRadius And _ starTemp > 5000 And starTemp < 6500 Then moonClass = 3 'earthtype moonType = "Terrain" noTextures = Val(optForm.texEarth.Text) noCloudTex = Val(optForm.texEarthC.Text) End If If semiAxis > (starRadius - 0.6) And semiAxis < (starRadius - 0.3) And _ starTemp > 5500 And starTemp < 7000 Then moonClass = 10 'earthtype moonType = "Sub Terrain" noTextures = Val(optForm.texDeser.Text) noCloudTex = Val(optForm.texDeserC.Text) End If End If If planetClass = 5 Then planetChance = Int(Rnd(1) * 100) If moon = 3 And starTemp > 5500 And starTemp < 7000 And planetChance < 34 Then moonClass = 10 'earthtype moonType = "Sub Terrain" noTextures = Val(optForm.texDeser.Text) noCloudTex = Val(optForm.texDeserC.Text) End If If moon = 4 And starTemp > 5000 And starTemp < 6500 And planetChance < 34 Then moonClass = 3 'earthtype moonType = "Terrain" noTextures = Val(optForm.texEarth.Text) noCloudTex = Val(optForm.texEarthC.Text) End If End If If moonClass = 0 Then moonRadius = (Rnd(1) * 50000) + 50000 If moonClass = 1 Then moonRadius = (Rnd(1) * 1000) + 500 If moonClass = 2 Then moonRadius = (Rnd(1) * 500) + 500 If moonClass = 3 Then moonRadius = (Rnd(1) * 5000) + 3000 If moonClass = 4 Then moonRadius = (Rnd(1) * 1000) + 500 If moonClass = 7 Then moonRadius = (Rnd(1) * 100) + 100 If moonClass = 10 Then moonRadius = (Rnd(1) * 5000) + 3000 If moonClass = 11 Then moonRadius = (Rnd(1) * 10) + 2 If moon = 1 And moonRadius > (planetRadius / 6) Then moonRadius = moonRadius / 6 If moon > 1 And moonRadius > (planetRadius / 4) Then moonRadius = moonRadius / 4 moonAxis = (planetRadius * 8) * (moon * (moon / 1.75)) * (Rnd(1) + 1) period = ((planetRadius / moonRadius) / 100) * (Rnd(1) * moon + 1) If moonAxis > (planetRadius * 200) Then GoTo skipMoon planetScript = planetScript & "# " & moonType If custFlag = True Then planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(34) & "moon " & moon & " of " & planetType & Chr$(34) planetScript = planetScript & " " & Chr$(34) & "HIP " & (Val(hipText.Text) + i - 1) & "/" & _ planetType & Chr$(34) End If If custFlag = False Then planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(34) & "moon " & moon & " of " & Chr$(97 + j) & Chr$(34) planetScript = planetScript & " " & Chr$(34) & "HIP " & (Val(hipText.Text) + i - 1) & "/" & _ planetType & Chr$(97 + cntPlanet) & Chr$(34) End If planetScript = planetScript & Chr$(13) & Chr$(10) & "{" 'Texture planetChance = Int(Rnd(1) * noTextures) + 1 planetTexture = dataList.List(moonClass) & Format$(planetChance, "00") & ".jpg" planetBump = dataList.List(moonClass) & Format$(planetChance, "00") & "-bump.jpg" cnt = Int(Rnd(1) * noCloudTex) + 1 planetClouds = dataList.List(moonClass) & Format$(cnt, "00") & "-clouds.png" planetSpec = "" If moonClass = 0 Or moonClass = 3 Then planetSpec = dataList.List(moonClass) & Format$(planetChance, "00") & "-spec.jpg" End If If moonClass = 7 Then planetTexture = dataList.List(2) & Format$(planetChance, "00") & ".jpg" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Mesh " & Chr$(34) & "asteroid.cms" & Chr$(34) planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Class " & Chr$(34) & "asteroid" & Chr$(34) End If planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Texture " & Chr$(34) & planetTexture & Chr$(34) If moonClass < 5 Or planetClass > 8 Then planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "BumpMap " & Chr$(34) & planetBump & Chr$(34) planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "BumpHeight 2" End If If moonClass = 0 Or moonClass = 3 Then planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "SpecularTexture " & Chr$(34) & planetSpec & Chr$(34) planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "SpecularColor " & specColor planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "SpecularPower 45.0" End If planetColor = "Color [ " & Format$(Rnd(1) * 0.8, "0.00") & " " & Format$(Rnd(1) * 0.8, "0.00") planetColor = planetColor & " " & Format$(Rnd(1) * 0.8, "0.00") & " ]" redAt = Rnd(1) * 0.8 greenAt = Rnd(1) * 0.8 blueAt = Rnd(1) * 0.8 albedo = (redAt + greenAt + blueAt) / 3 planetColor = "Color [ " & Format$(redAt, "0.00") & " " & Format$(greenAt, "0.00") planetColor = planetColor & " " & Format$(blueAt, "0.00") & " ]" If semiAxis > (0.005 * starTemp) And planetClass <> 5 Then planetColor = "Color [ " & Format$(((Rnd(1) * 0.2) + 0.5), "0.00") planetColor = planetColor & " " & Format$(((Rnd(1) * 0.2) + 0.5), "0.00") planetColor = planetColor & " " & Format$(((Rnd(1) * 0.2) + 0.5), "0.00") planetColor = planetColor & " ]" End If If moonClass = 7 Or moonClass = 1 Or moonClass = 2 Or moonClass = 4 Then planetColor = "Color [ " & Format$(((Rnd(1) * 0.2) + 0.5), "0.00") planetColor = planetColor & " " & Format$(((Rnd(1) * 0.2) + 0.5), "0.00") planetColor = planetColor & " " & Format$(((Rnd(1) * 0.2) + 0.5), "0.00") planetColor = planetColor & " ]" End If planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & planetColor planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "BlendTexture true" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Radius " & Format$(moonRadius, "0.00") ' atmosphere code for moons planetChance = Int(Rnd(1) * 100) atmosphere = False If planetChance < 50 Then atmosphere = True If moonRadius < 1001 Then atmosphere = False If s = "Q" And moonClass <> 0 Then atmosphere = False If planetClass = 4 Or moonClass = 7 Then atmosphere = False If semiAxis > (0.005 * starTemp) Then atmosphere = False If moonClass = 0 Or moonClass = 3 Or moonClass = 10 Then atmosphere = True If moonClass = 11 Then atmosphere = False If atmosphere = True Then hazeColor = "[ " & Format$((Rnd(1) * albedo + 0.1), "0.00") & " " & Format$((Rnd(1) * albedo + 0.1), "0.00") & _ " " & Format$((Rnd(1) * albedo + 0.1), "0.00") & " ]" upColor = "[ " & Format$((Rnd(1) * albedo + 0.1), "0.00") & " " & Format$((Rnd(1) * albedo + 0.1), "0.00") & _ " " & Format$((Rnd(1) * albedo + 0.1), "0.00") & " ]" skyColor = "[ " & Format$((Rnd(1) * albedo + 0.1), "0.00") & " " & Format$((Rnd(1) * albedo + 0.1), "0.00") & _ " " & Format$((Rnd(1) * albedo + 0.1), "0.00") & " ]" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "HazeColor " & hazeColor planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "HazeDensity 0.5" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Atmosphere {" If moonClass < 11 And moonClass > 0 Then atHeight = moonRadius / ((Rnd(1) + 0.5) * 100) If moonClass = 0 Then atHeight = moonRadius / ((Rnd(1) + 0.5) * 50) planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Height " & Format$(atHeight, "0.00") planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Lower " & hazeColor planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Upper " & upColor planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Sky " & skyColor planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "CloudHeight " & Format$(atHeight / 10, "0.00") planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "CloudSpeed " & Format$(moonRadius / 133, "0.00") planetChance = Int(Rnd(1) * 100) If planetChance < 34 Then If moonClass = 1 Or moonClass = 2 Then cnt = Int(Rnd(1) * Val(optForm.texGener.Text)) + 1 planetClouds = "gc_gener_" & Format$(cnt, "00") & "-clouds.png" End If End If planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "CloudMap " & Chr$(34) & planetClouds & Chr$(34) planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "}" End If planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "EllipticalOrbit {" planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Period " & Format$(period, "0.0000") planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "SemiMajorAxis " & Format$(moonAxis, "0.0000") planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Eccentricity " & Format$(((Rnd(1) / 1000) * semiAxis), "0.0000") planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "Inclination " & Format$(((Rnd(1) / 100) * semiAxis), "0.0000") planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & Chr$(9) & "MeanAnomaly " & Format$((Rnd(1) * 360), "0.00") planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "}" If moonAxis > (planetRadius * 8.645) Then planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "RotationPeriod " & Format$((moonRadius / 250) * ((Rnd(1) * 2) + 1), "0.00") End If If moonClass = 11 Then planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "RotationPeriod " & Format$((Rnd(1) / 100) + 0.0001, "0.0000") End If If moonClass < 11 Then planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Obliquity " & Format$((Rnd(1) * 90) - (Rnd(1) * 90), "0.00") End If planetScript = planetScript & Chr$(13) & Chr$(10) & Chr$(9) & "Albedo " & Format$(albedo, "0.00") planetScript = planetScript & Chr$(13) & Chr$(10) & "}" & Chr$(13) & Chr$(10) If Len(planetScript) > 8000 Then planetBuffer = planetBuffer & planetScript planetScript = "" End If Next moon skipMoon: End If If custFlag = True Then custCount = custCount + 1 End If skipPlanets: Next j custFlag = False prgPlanet.Value = 0 End If custFlag = False End If custFlag = False Next i custFlag = False prgReport.Value = 0 prgPlanet.Value = 0 planetBuffer = planetBuffer & planetScript planetScript = "" starBuffer = starBuffer & starScript starScript = "" starData.Text = starBuffer planetData.Text = planetBuffer msgText = custCount & " custom planet[s] were placed." If noCust > 0 Then MsgBox msgText, , "Custom Planets" End If Exit Sub errorGenerate: errText = "Error " & Err.Description & "! May be due to one or more variables " & _ "defined in boxes R, D or d equal to zero. Please " & _ "check all variables and recompute." errBox.Visible = True errBox.errMsg.Caption = errText End Sub Private Sub cmdView_Click() edForm.Visible = True End Sub Private Sub Form_Load() On Error GoTo configError optForm.Visible = False errBox.Visible = False edForm.Visible = False tipsForm.Visible = False findForm.Visible = False custForm.Visible = False frmAbout.Visible = False breakFlag = False findString = "" optForm.texEarth.Text = "4" optForm.texLunar.Text = "4" optForm.texRocky.Text = "4" optForm.texGasgt.Text = "4" optForm.texFroze.Text = "4" optForm.texVulca.Text = "4" optForm.texDeser.Text = "4" optForm.texStar.Text = "1" optForm.texEarthC.Text = "4" optForm.texGasgtC.Text = "4" optForm.texGener.Text = "6" optForm.texRings.Text = "6" noCust = 0 cfgDir = App.Path logFilename = "" 'values at 1000 ly oTemp(0) = 50000: oTemp(1) = 50000: oTemp(2) = 50000: oTemp(3) = 50000: oTemp(4) = 47000 oTemp(5) = 44500: oTemp(6) = 41000: oTemp(7) = 38000: oTemp(8) = 35800: oTemp(9) = 33000 bTemp(0) = 30000: bTemp(1) = 25400: bTemp(2) = 22000: bTemp(3) = 18700: bTemp(4) = 17000 bTemp(5) = 15400: bTemp(6) = 14000: bTemp(7) = 13000: bTemp(8) = 11900: bTemp(9) = 10500 aTemp(0) = 9520: aTemp(1) = 9230: aTemp(2) = 8970: aTemp(3) = 8720: aTemp(4) = 8460 aTemp(5) = 8200: aTemp(6) = 8020: aTemp(7) = 7850: aTemp(8) = 7580: aTemp(9) = 7390 aTemp(0) = 9520: aTemp(1) = 9230: aTemp(2) = 8970: aTemp(3) = 8720: aTemp(4) = 8460 aTemp(5) = 8200: aTemp(6) = 8020: aTemp(7) = 7850: aTemp(8) = 7580: aTemp(9) = 7390 fTemp(0) = 7200: fTemp(1) = 7050: fTemp(2) = 6890: fTemp(3) = 6740: fTemp(4) = 6590 fTemp(5) = 6440: fTemp(6) = 6360: fTemp(7) = 6280: fTemp(8) = 6200: fTemp(9) = 6110 gTemp(0) = 6030: gTemp(1) = 5940: gTemp(2) = 5860: gTemp(3) = 5830: gTemp(4) = 5800 gTemp(5) = 5770: gTemp(6) = 5700: gTemp(7) = 5630: gTemp(8) = 5570: gTemp(9) = 5410 kTemp(0) = 5250: kTemp(1) = 5080: kTemp(2) = 4900: kTemp(3) = 4730: kTemp(4) = 4590 kTemp(5) = 4350: kTemp(6) = 4200: kTemp(7) = 4060: kTemp(8) = 3990: kTemp(9) = 3920 kTemp(0) = 5250: kTemp(1) = 5080: kTemp(2) = 4900: kTemp(3) = 4730: kTemp(4) = 4590 kTemp(5) = 4350: kTemp(6) = 4200: kTemp(7) = 4060: kTemp(8) = 3990: kTemp(9) = 3920 mTemp(0) = 3850: mTemp(1) = 3720: mTemp(2) = 3580: mTemp(3) = 3470: mTemp(4) = 3370 mTemp(5) = 3240: mTemp(6) = 3050: mTemp(7) = 2940: mTemp(8) = 2640: mTemp(9) = 2600 SOLAR_RADIUS = 696000 SOLAR_TEMP = 5860 SOLAR_ABSMAG = 4.83 LN_MAG = 1.085736 LY_PER_PARSEC = 3.26167 dataList.AddItem "gc_gasgt_" dataList.AddItem "gc_rocky_" dataList.AddItem "gc_moons_" dataList.AddItem "gc_earth_" dataList.AddItem "gc_froze_" dataList.AddItem "gc_subst_" dataList.AddItem "gc_stars_" dataList.AddItem "gc_aster_" dataList.AddItem "gc_epist_" dataList.AddItem "gc_vulca_" dataList.AddItem "gc_deser_" clusterLabel.Text = "(none)" starText.Text = "1000" hipText.Text = "110000" rahText.Text = "00" ramText.Text = "00" rasText.Text = "00.0" dechText.Text = "00" decmText.Text = "00" decsText.Text = "00.0" magText.Text = "20" varText.Text = "5" '13370 distText.Text = "10000" radText.Text = "100" chanceText.Text = "15" rText.Text = "2.75" dText.Text = "0.5" aText.Text = "1.0" cText.Text = "3.0" chanceText.Enabled = False prgReport.min = 0 prgReport.Max = 100 prgPlanet.min = 0 prgPlanet.Max = 100 Open cfgDir & "\global.cfg" For Input As #3 Input #3, cfgSeed Input #3, cfgStar Input #3, cfgCenter Input #3, cfgPlanet Input #3, cfgExplicit Input #3, cfgSeedText Input #3, cfgEarth Input #3, cfgRing Input #3, cfgVulca Input #3, cfgRocky Input #3, cfgFroze Input #3, cfgGasgt Input #3, cfgLunar Input #3, cfgDeser Input #3, cfgEarthC Input #3, cfgGener Input #3, cfgStarT Input #3, cfgGasgtC Input #3, cfgDeserC Close #3 optForm.chkSeed.Value = Val(LTrim(Str(cfgSeed))) optForm.chkStar.Value = Val(LTrim(Str(cfgStar))) optForm.chkCenter.Value = Val(LTrim(Str(cfgCenter))) optForm.chkPlanet.Value = Val(LTrim(Str(cfgPlanet))) optForm.chkExplicit.Value = Val(LTrim(Str(cfgExplicit))) optForm.seedText.Text = cfgSeedText optForm.texEarth.Text = cfgEarth optForm.texRings.Text = cfgRing optForm.texVulca.Text = cfgVulca optForm.texRocky.Text = cfgRocky optForm.texFroze.Text = cfgFroze optForm.texGasgt.Text = cfgGasgt optForm.texLunar.Text = cfgLunar optForm.texDeser.Text = cfgDeser optForm.texEarthC.Text = cfgEarthC optForm.texGener.Text = cfgGener optForm.texStar.Text = cfgStarT optForm.texGasgtC.Text = cfgGasgtC optForm.texDeserC.Text = cfgDeserC Exit Sub configError: Close #3 Open cfgDir & "\global.cfg" For Output As #3 Close #3 optForm.Visible = True End Sub Private Sub mnuAbout_Click() frmAbout.Visible = True End Sub Private Sub mnuCustPlan_Click() custForm.Visible = True End Sub Private Sub mnuExit_Click() Dim i As Integer ' MEMORY MANAGEMENT starScript = "" planetScript = "" starBuffer = "" planetBuffer = "" starValue = 0 raValue = 0 decValue = 0 distValue = 0 radiusValue = 0 areaValue = 0 magValue = 0 For i = 1 To 10 oTemp(i) = 0 bTemp(i) = 0 aTemp(i) = 0 fTemp(i) = 0 gTemp(i) = 0 kTemp(i) = 0 mTemp(i) = 0 Next i SOLAR_RADIUS = 0 SOLAR_TEMP = 0 SOLAR_ABSMAG = 0 LN_MAG = 0 specType = 0 For i = 0 To noCust custStarLabel(i) = 0 custSpec(i) = "" custBump(i) = "" custClouds(i) = "" custNight(i) = "" custAt(i) = "" custMean(i) = "" custEmiss(i) = "" custRings(i) = "" custName(i) = "" custTex(i) = "" custClass(i) = "" custModel(i) = "" custStar(i) = "" custSize(i) = "" Next i noCust = 0 findString = "" lfoundPos = 0: lfindLen = 0 cfgSeed = "": cfgStar = "": cfgCenter = "": cfgPlanet = "" cfgExplicit = "": cfgSeedText = "": cfgEarth = "": cfgRing = "": cfgDir = "" cfgDeser = "": cfgVulca = "": cfgGasgt = "": cfgFroze = "" cfgDeserC = "": cfgEarthC = "": cfgGasgtC = "": cfgStarT = "" cfgLunar = "": cfgRocky = "": cfgGener = "" logLabel = "": logStar = "": logHip = "": logRah = "": logRam = "": logRas = "" logDech = "": logDecm = "": logDecs = "": logMag = "": logVar = "": logDist = "": logRad = "" logChance = "": logR = "": logD = "": logA = "": logC = "" Unload starForm Unload edForm Unload errBox Unload frmAbout Unload optForm Unload tipsForm Unload custForm Unload findForm End End Sub Private Sub mnuLogLoad_Click() Dim X As Integer Dim num As String On Error GoTo skipLoadError cDialog.Filter = "LogFile|*.log" cDialog.DefaultExt = ".log" 'cDialog.FileName = clusterLabel.Text cDialog.InitDir = cfgDir & "\log" cDialog.Flags = cdlOFNPathMustExist Or cdlOFNOverwritePrompt cDialog.CancelError = True cDialog.ShowOpen If cDialog.FileName <> "" Then logFilename = cDialog.FileName Open cDialog.FileName For Input As #4 Input #4, logLabel Input #4, logStar Input #4, logHip Input #4, logRah Input #4, logRam Input #4, logRas Input #4, logDech Input #4, logDecm Input #4, logDecs Input #4, logMag Input #4, logVar Input #4, logDist Input #4, logRad Input #4, logChance Input #4, logR Input #4, logD Input #4, logA Input #4, logC Input #4, num noCust = Val(num) custForm.planPlanets.Clear If noCust > 0 Then For X = 0 To noCust - 1 Input #4, custName(X) custForm.planPlanets.AddItem custName(X) Input #4, custTex(X) Input #4, custSpec(X) Input #4, custBump(X) Input #4, custClouds(X) Input #4, custNight(X) Input #4, custAt(X) Input #4, custEmiss(X) Input #4, custSize(X) Input #4, custRings(X) Input #4, custStar(X) Input #4, custName(X) Input #4, custClass(X) Input #4, custModel(X) Next X End If Close #4 End If clusterLabel.Text = logLabel starText.Text = logStar hipText.Text = logHip rahText.Text = logRah ramText.Text = logRam rasText.Text = logRas dechText.Text = logDech decmText.Text = logDecm decsText.Text = logDecs magText.Text = logMag varText.Text = logVar distText.Text = logDist radText.Text = logRad chanceText.Text = logChance rText.Text = logR dText.Text = logD aText.Text = logA cText.Text = logC For X = 0 To noCust - 1 custBool(X) = False Next X 'cfgDir = Left$(cDialog.FileName, Len(cDialog.FileName) - Len(cDialog.FileTitle)) skipLoadError: Close #4 End Sub Private Sub mnuLogSave_Click() Dim X As Integer On Error GoTo skipSaveError logLabel = clusterLabel.Text logStar = starText.Text logHip = hipText.Text logRah = rahText.Text logRam = ramText.Text logRas = rasText.Text logDech = dechText.Text logDecm = decmText.Text logDecs = decsText.Text logMag = magText.Text logVar = varText.Text logDist = distText.Text logRad = radText.Text logChance = chanceText.Text logR = rText.Text logD = dText.Text logA = aText.Text logC = cText.Text cDialog.Filter = "LogFile|*.log" cDialog.DefaultExt = ".log" cDialog.FileName = clusterLabel.Text cDialog.InitDir = cfgDir & "\log" cDialog.Flags = cdlOFNPathMustExist Or cdlOFNOverwritePrompt cDialog.CancelError = True cDialog.ShowSave If cDialog.FileName <> "" Then Open cDialog.FileName For Output As #4 Print #4, logLabel Print #4, logStar Print #4, logHip Print #4, logRah Print #4, logRam Print #4, logRas Print #4, logDech Print #4, logDecm Print #4, logDecs Print #4, logMag Print #4, logVar Print #4, logDist Print #4, logRad Print #4, logChance Print #4, logR Print #4, logD Print #4, logA Print #4, logC Print #4, Str(noCust) If noCust > 0 Then For X = 0 To noCust - 1 Print #4, custName(X) Print #4, custTex(X) Print #4, custSpec(X) Print #4, custBump(X) Print #4, custClouds(X) Print #4, custNight(X) Print #4, custAt(X) Print #4, custEmiss(X) Print #4, custSize(X) Print #4, custRings(X) Print #4, custStar(X) Print #4, custName(X) Print #4, custClass(X) Print #4, custModel(X) Next X End If Close #4 End If 'cfgDir = Left$(cDialog.FileName, Len(cDialog.FileName) - Len(cDialog.FileTitle)) skipSaveError: Close #4 End Sub Private Sub mnuOpt_Click() On Error GoTo configError Open cfgDir & "\global.cfg" For Input As #3 Input #3, cfgSeed Input #3, cfgStar Input #3, cfgCenter Input #3, cfgPlanet Input #3, cfgExplicit Input #3, cfgSeedText Input #3, cfgEarth Input #3, cfgRing Input #3, cfgVulca Input #3, cfgRocky Input #3, cfgFroze Input #3, cfgGasgt Input #3, cfgLunar Input #3, cfgDeser Input #3, cfgEarthC Input #3, cfgGener Input #3, cfgStarT Input #3, cfgGasgtC Input #3, cfgDeserC Close #3 optForm.chkSeed.Value = Val(LTrim(Str(cfgSeed))) optForm.chkStar.Value = Val(LTrim(Str(cfgStar))) optForm.chkCenter.Value = Val(LTrim(Str(cfgCenter))) optForm.chkPlanet.Value = Val(LTrim(Str(cfgPlanet))) optForm.chkExplicit.Value = Val(LTrim(Str(cfgExplicit))) optForm.seedText.Text = cfgSeedText optForm.texEarth.Text = cfgEarth optForm.texRings.Text = cfgRing optForm.texVulca.Text = cfgVulca optForm.texRocky.Text = cfgRocky optForm.texFroze.Text = cfgFroze optForm.texGasgt.Text = cfgGasgt optForm.texLunar.Text = cfgLunar optForm.texDeser.Text = cfgDeser optForm.texEarthC.Text = cfgEarthC optForm.texGener.Text = cfgGener optForm.texStar.Text = cfgStarT optForm.texGasgtC.Text = cfgGasgtC optForm.texDeserC.Text = cfgDeserC optForm.Visible = True Exit Sub configError: Close #3 Open cfgDir & "\global.cfg" For Output As #3 Close #3 optForm.Visible = True End Sub Private Sub mnuReset_Click() breakFlag = False clusterLabel.Text = "(none)" starText.Text = "1000" hipText.Text = "110000" rahText.Text = "00" ramText.Text = "00" rasText.Text = "00.0" dechText.Text = "00" decmText.Text = "00" decsText.Text = "00.0" magText.Text = "20" varText.Text = "5" distText.Text = "10000" radText.Text = "100" chanceText.Text = "15" rText.Text = "2.75" dText.Text = "0.5" aText.Text = "1.0" cText.Text = "2.0" End Sub Private Sub mnuSave_Click() On Error GoTo errorSave cDialog.Filter = "StarCode|*.stc" cDialog.DefaultExt = ".stc" cDialog.FileName = clusterLabel.Text cDialog.InitDir = "c:\Program Files\Celestia\extras\" cDialog.Flags = cdlOFNPathMustExist Or cdlOFNOverwritePrompt cDialog.CancelError = True cDialog.ShowSave If cDialog.FileName <> "" Then Open cDialog.FileName For Output As #1 Print #1, starData.Text Close #1 End If If chkPlanet.Value = 1 Or chkBlack.Value = 1 Or chkPulsar.Value = 1 Then cDialog.Filter = "SolarSystemCode|*.ssc" cDialog.DefaultExt = ".ssc" cDialog.FileName = clusterLabel.Text cDialog.InitDir = "c:\Program Files\Celestia\extras\" cDialog.Flags = cdlOFNPathMustExist Or cdlOFNOverwritePrompt cDialog.CancelError = True cDialog.ShowSave If cDialog.FileName <> "" Then Open cDialog.FileName For Output As #2 Print #2, planetData.Text Close #2 End If End If Exit Sub errorSave: Close #2 End Sub Private Sub mnuTips_Click() tipsForm.Visible = True End Sub Private Sub mnuView_Click() edForm.Visible = True End Sub Function Log10(X As Double) As Double Log10 = Log(X) / Log(10) End Function Public Sub loadLog() Dim X, num As Integer On Error GoTo errorLog If logFilename <> "" Then Open logFilename For Input As #4 Input #4, logLabel Input #4, logStar Input #4, logHip Input #4, logRah Input #4, logRam Input #4, logRas Input #4, logDech Input #4, logDecm Input #4, logDecs Input #4, logMag Input #4, logVar Input #4, logDist Input #4, logRad Input #4, logChance Input #4, logR Input #4, logD Input #4, logA Input #4, logC Input #4, num noCust = Val(num) custForm.planPlanets.Clear If noCust > 0 Then For X = 0 To noCust - 1 Input #4, custName(X) custForm.planPlanets.AddItem custName(X) Input #4, custTex(X) Input #4, custSpec(X) Input #4, custBump(X) Input #4, custClouds(X) Input #4, custNight(X) Input #4, custAt(X) Input #4, custEmiss(X) Input #4, custSize(X) Input #4, custRings(X) Input #4, custStar(X) Input #4, custName(X) Input #4, custClass(X) Input #4, custModel(X) Next X End If Close #4 End If clusterLabel.Text = logLabel starText.Text = logStar hipText.Text = logHip rahText.Text = logRah ramText.Text = logRam rasText.Text = logRas dechText.Text = logDech decmText.Text = logDecm decsText.Text = logDecs magText.Text = logMag varText.Text = logVar distText.Text = logDist radText.Text = logRad chanceText.Text = logChance rText.Text = logR dText.Text = logD aText.Text = logA cText.Text = logC For X = 0 To noCust - 1 custBool(X) = False Next X errorLog: Close #4 End Sub