Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- runcode String name = "Planet_Name";
- float Min = 100;
- float Max = 300;
- String PlanetType = "planet_terrain_type";
- float planetRadius = Min + new Random().nextFloat() * (Max - Min);
- SectorEntityToken fleet = Global.getSector().getPlayerFleet();
- StarSystemAPI sys = (StarSystemAPI)fleet.getContainingLocation();
- SectorEntityToken star = sys.getStar();
- float orbitRadius = com.fs.starfarer.api.util.Misc.getDistance(fleet, sys.getCenter());
- float orbitDays = orbitRadius / (20f + new Random().nextFloat() * 10f);
- float angle = com.fs.starfarer.api.util.Misc.getAngleInDegrees(sys.getCenter().getLocation(), fleet.getLocation());
- PlanetAPI world = sys.addPlanet( name, star, name, PlanetType,
- angle, planetRadius, orbitRadius, orbitDays);
- sys.updateAllOrbits();
- //Moon Spawning
- //to get Planet ID since we can't get the context market interacted with you will need to use devmode and do a memory dump
- runcode String id = "Planet_ID";
- String moonName = "Moon Name";
- String terrainType = "Planet Terrain";
- float Min = 90;
- float Max = 150;
- float moonRadius = Min + new Random().nextFloat() * (Max - Min);
- SectorEntityToken fleet = Global.getSector().getPlayerFleet();
- StarSystemAPI sys = (StarSystemAPI)fleet.getContainingLocation();
- SectorEntityToken star = sys.getEntityById(id);
- float orbitRadius = com.fs.starfarer.api.util.Misc.getDistance(fleet, star);
- float orbitDays = orbitRadius / (20f + new Random().nextFloat() * 10f);
- float angle = com.fs.starfarer.api.util.Misc.getAngleInDegrees(sys.getCenter().getLocation(), fleet.getLocation());
- PlanetAPI world = sys.addPlanet(moonName, star, moonName, terrainType,
- angle, moonRadius, orbitRadius, orbitDays);
- sys.updateAllOrbits();
- //Replace terrain_type with the following
- //terran = terran planet world
- //terran-eccentric = terran eccentric world
- //barren = barren world
- //cryovolcanic = cryovolcanic world
- //arid = arid world
- //barren-bombarded = barren bombarded world
- //water = water world
- //gas_giant = ordinary gas giant
- //ice_giant = ice giant
- //frozen = frozen world
- //lava = volcanic world
- //toxic = toxic world
- //desert = desert world
- //jungle = jungle world
- //tundra = tundra world
- //rocky_ice = rocky ice world
- //rocky_unstable = rocky unstable world
- //radiated = irridiated world
- //there are some planets that come in different texture flavors
- //barren1
- //barren2
- //barren3
- //barren_castiron
- //desert1
- //frozen1
- //frozen2
- //lava_minor
Add Comment
Please, Sign In to add comment