Fractal Softworks Forum

Starsector => Mods => Modding => Topic started by: Nivri on May 04, 2020, 10:42:58 AM

Title: Questions about creating and removing planets
Post by: Nivri on May 04, 2020, 10:42:58 AM
I installed the Console Commands Mod and I want to learn how to remove planets in a star system. As for creating planets, I found this code:
RunCode Global.getSector().getStarSystem("System_Name").addPlanet("Added_Planet_Name", Global.getSector().getStarSystem("System_Name").getStar(), "Added_Planet_Name", "Planet_type", Planet_Angle, Planet_Size, Planet_orbit_radius, Planet_Orbit_length)

I have questions about it like what is orbit radius and orbit length. I'm kind of new to these stuff but I really want to learn. Thank you in advance for anyone willing to answer
Title: Re: Questions about creating and removing planets
Post by: dead_hand on May 04, 2020, 10:57:28 AM
Orbit radius here means how far away your planet is from the star. Higher number -> further away from the star.

Orbit length, how fast does it circle around the chosen star. Higher value -> more time to take the circle around the star (iirc)
Title: Re: Questions about creating and removing planets
Post by: Nivri on May 04, 2020, 11:59:24 AM
Thank you so much. Do you know how to remove some of the planets by any chance?
Title: Re: Questions about creating and removing planets
Post by: dead_hand on May 04, 2020, 12:32:58 PM
Thank you so much. Do you know how to remove some of the planets by any chance?

I believe there is a removeEntity in the API, but I'm not sure if it will work. You would also want to probably ensure that the planet you are removing hasn't got a market etc.