Author Topic: How to make some planets visually larger?  (Read 627 times)

ibanix

  • Newbie
  • *
  • Posts: 30
  • Karma: +0/-0
    • View Profile
How to make some planets visually larger?
« on: March 23, 2013, 08:02:09 PM »
Hello! Hope SR modding isn't *that* dead.

Want to make certain planets (gas giants) look visually large, much more so than other planet sizes. Is this a script change (pRad / pVol) or a model change?

Thanks!
-ibanix

Jon Micheelsen

  • Contributor
  • Sentient
  • *
  • Posts: 76
  • Karma: +19/-0
    • View Profile
Re: How to make some planets visually larger?
« Reply #1 on: March 23, 2013, 09:00:28 PM »
It's in a script.

You're welcome ;)

ibanix

  • Newbie
  • *
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: How to make some planets visually larger?
« Reply #2 on: March 23, 2013, 11:57:08 PM »
Fffuuuuuu

 :)

Jon Micheelsen

  • Contributor
  • Sentient
  • *
  • Posts: 76
  • Karma: +19/-0
    • View Profile
Re: How to make some planets visually larger?
« Reply #3 on: March 26, 2013, 02:37:54 PM »
Find this in map generation:

Code: [Select]
// Planet radius
float pRad = randomf(minPlanetRadius, maxPlanetRadius), pVol = pRad * pRad * pRad * 4.189f;
plDesc.PlanetRadius = pRad;
plDesc.RandomConditions = false;

// Calculate planetary temperature
if (tempFalloff) {
int type = -1;
float temp = starDesc.Temperature / sqr(orbDesc.Radius / tempFalloffRadius);
float tp = randomf(1.f);

if (tp < 0.15f)
type = getRandomType(GasTypes);
else if (temp > 30000.f)
type = getRandomType(LavaTypes);
else if (temp > 17000.f)
type = getRandomType(WarmTypes);
else if (temp > 5000.f)
type = getRandomType(NormalTypes);
else
type = getRandomType(ColdTypes);

plDesc.setPlanetType(type);
}

And replace it with this:

Code: [Select]
// Planet radius
float pRad = randomf(minPlanetRadius, maxPlanetRadius), pVol = pRad * pRad * pRad * 4.189f;
plDesc.RandomConditions = false;

// Calculate planetary temperature
if (tempFalloff) {
int type = -1;
float temp = starDesc.Temperature / sqr(orbDesc.Radius / tempFalloffRadius);
float tp = randomf(1.f);

if (tp < 0.15f){
type = getRandomType(GasTypes);
pRad * randomf(3.f, 5.f); //this part makes only gas giants larger, while leaving the others. 3-5 are just and example.
}
else if (temp > 30000.f){
type = getRandomType(LavaTypes);
}
else if (temp > 17000.f){
type = getRandomType(WarmTypes);
}
else if (temp > 5000.f){
type = getRandomType(NormalTypes);
}
else{
type = getRandomType(ColdTypes);
}
plDesc.setPlanetType(type);
}
plDesc.PlanetRadius = pRad;

That should do it ;)