Welp I've tried basically doing a copy of Askonia and renaming it, but it doesn't appear on the hyperspace map as expected, so now I'm digging through how to actually add my system in, what other file do I need to modify in order to add in a system.
I've seen how Mshadowy does it, but replicating that method seems ill advised since i don't actually know how it'll turn out lol.
in a gen file ? or something cause idk I'm just lost lol.
package data.scripts.world.systems;
import java.awt.Color;
import java.util.List;
import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.campaign.CargoAPI;
import com.fs.starfarer.api.campaign.JumpPointAPI;
import com.fs.starfarer.api.campaign.LocationAPI;
import com.fs.starfarer.api.campaign.OrbitAPI;
import com.fs.starfarer.api.campaign.PlanetAPI;
import com.fs.starfarer.api.campaign.SectorAPI;
import com.fs.starfarer.api.campaign.SectorEntityToken;
import com.fs.starfarer.api.campaign.StarSystemAPI;
import com.fs.starfarer.api.campaign.CargoAPI.CrewXPLevel;
import com.fs.starfarer.api.fleet.FleetMemberType;
public class CoronaAustralis {
public void generate(SectorAPI sector) {
StarSystemAPI system = sector.createStarSystem("Corona Australis");
LocationAPI hyper = Global.getSector().getHyperspace();
system.setBackgroundTextureFilename("graphics/backgrounds/CoronaAustralis.jpg");
// create the star and generate the hyperspace anchor for this system
PlanetAPI CoronaAustralis = system.initStar("neut_star_neutron", // id in planets.json
200f, // radius (in pixels at default zoom)
2500, 3000); // location in hyperspace
system.setLightColor(new Color(255, 255, 255)); // light color in entire system, affects all entities
/*
* addPlanet() parameters:
* 1. What the planet orbits (orbit is always circular)
* 2. Name
* 3. Planet type id in planets.json
* 4. Starting angle in orbit, i.e. 0 = to the right of the star
* 5. Planet radius, pixels at default zoom
* 6. Orbit radius, pixels at default zoom
* 7. Days it takes to complete an orbit. 1 day = 10 seconds.
*/
PlanetAPI p1 = system.addPlanet(CoronaAustralis, "Deadworld IS7", "neut_rocky_unstable", 0, 150, 2500, 100);
//PlanetAPI a2 = system.addPlanet(star, "Salus", "gas_giant", 230, 350, 7000, 250);
//PlanetAPI a21 = system.addPlanet(a2, "Cruor", "rocky_unstable", 45, 80, 800, 25);
//PlanetAPI a22 = system.addPlanet(a2, "Volturn", "water", 110, 120, 1400, 45);
//PlanetAPI a3 = system.addPlanet(star, "Umbra", "rocky_ice", 280, 150, 12000, 650);
p1.setCustomDescriptionId("neut_planet_IS7");
//a2.setCustomDescriptionId("planet_salus");
//a21.setCustomDescriptionId("planet_cruor");
//a22.setCustomDescriptionId("planet_volturn");
//a3.setCustomDescriptionId("planet_umbra");
p1.getSpec().setPlanetColor(new Color(255,215,190,255));
p1.getSpec().setAtmosphereColor(new Color(160,110,45,140));
p1.getSpec().setCloudColor(new Color(255,164,96,200));
p1.getSpec().setTilt(10);
p1.applySpecChanges();
/*
* addAsteroidBelt() parameters:
* 1. What the belt orbits
* 2. Number of asteroids
* 3. Orbit radius
* 4. Belt width
* 6/7. Range of days to complete one orbit. Value picked randomly for each asteroid.
*/
system.addAsteroidBelt(p1, 50, 1100, 128, 40, 80);
/*
* addRingBand() parameters:
* 1. What it orbits
* 2. Category under "graphics" in settings.json
* 3. Key in category
* 4. Width of band within the texture
* 5. Index of band
* 6. Color to apply to band
* 7. Width of band (in the game)
* 8. Orbit radius (of the middle of the band)
* 9. Orbital period, in days
*/
system.addRingBand(CoronaAustralis, "misc", "rings1", 256f, 2, Color.white, 256f, 1400, 40f);
system.addRingBand(CoronaAustralis, "misc", "rings1", 256f, 2, Color.white, 256f, 1450, 60f);
system.addRingBand(CoronaAustralis, "misc", "rings1", 256f, 2, Color.white, 256f, 1500, 80f);
system.addRingBand(CoronaAustralis, "misc", "rings1", 256f, 3, Color.white, 256f, 1750, 70f);
system.addRingBand(CoronaAustralis, "misc", "rings1", 256f, 3, Color.white, 256f, 1800, 90f);
system.addRingBand(CoronaAustralis, "misc", "rings1", 256f, 3, Color.white, 256f, 1850, 110f);
system.addRingBand(CoronaAustralis, "misc", "rings1", 256f, 0, Color.white, 256f, 2100, 50f);
system.addRingBand(CoronaAustralis, "misc", "rings1", 256f, 0, Color.white, 256f, 2150, 70f);
system.addRingBand(CoronaAustralis, "misc", "rings1", 256f, 0, Color.white, 256f, 2200, 80f);
system.addRingBand(CoronaAustralis, "misc", "rings1", 256f, 1, Color.white, 256f, 2250, 90f);
system.addRingBand(p1, "misc", "rings1", 256f, 2, Color.white, 256f, 1400, 40f);
system.addRingBand(p1, "misc", "rings1", 256f, 2, Color.white, 256f, 1450, 60f);
system.addRingBand(p1, "misc", "rings1", 256f, 2, Color.white, 256f, 1500, 80f);
system.addRingBand(p1, "misc", "rings1", 256f, 3, Color.white, 256f, 1750, 70f);
system.addRingBand(p1, "misc", "rings1", 256f, 3, Color.white, 256f, 1800, 90f);
system.addRingBand(p1, "misc", "rings1", 256f, 3, Color.white, 256f, 1850, 110f);
JumpPointAPI jumpPoint = Global.getFactory().createJumpPoint("Jump Point Alpha");
OrbitAPI orbit = Global.getFactory().createCircularOrbit(p1, 0, 400, 40);
jumpPoint.setOrbit(orbit);
jumpPoint.setRelatedPlanet(p1);
jumpPoint.setStandardWormholeToHyperspaceVisual();
system.addEntity(jumpPoint);
/*
* addPlanet() parameters:
* 1. What the planet orbits (orbit is always circular)
* 2. Name
* 3. Planet type id in planets.json
* 4. Starting angle in orbit, i.e. 0 = to the right of the star
* 5. Planet radius, pixels at default zoom
* 6. Orbit radius, pixels at default zoom
* 7. Days it takes to complete an orbit. 1 day = 10 seconds.
*/
SectorEntityToken NCstation1 = system.addOrbitalStation(CoronaAustralis, 200, 700, 90, "Small Extraction Drill", "neutrinocorp");
SectorEntityToken NCstation2 = system.addOrbitalStation(CoronaAustralis, 200, 1600, 90, "Large Processing Dock", "neutrinocorp");
SectorEntityToken NCstation3 = system.addOrbitalStation(p1, 45, 300, 50, "Small Research Station", "neutrinocorp");
initStationCargo(NCstation1);
initStationCargo(NCstation2);
initStationCargo(NCstation3);
// example of using custom visuals below
// a1.setCustomInteractionDialogImageVisual(new InteractionDialogImageVisual("illustrations", "hull_breach", 800, 800));
// jumpPoint.setCustomInteractionDialogImageVisual(new InteractionDialogImageVisual("illustrations", "space_wreckage", 1200, 1200));
// station.setCustomInteractionDialogImageVisual(new InteractionDialogImageVisual("illustrations", "cargo_loading", 1200, 1200));
// generates hyperspace destinations for in-system jump points
system.autogenerateHyperspaceJumpPoints(true, true);
system.addSpawnPoint(new neutrinoConvoySpawnPoint(sector, system, 7, 1, token, NCstation2));
neutrinoSpawnPoint NCSpawn1 = new neutrinoSpawnPoint(sector, system, 2, 2, NCstation1);
neutrinoSpawnPoint NCSpawn2 = new neutrinoSpawnPoint(sector, system, 2, 3, NCstation2);
neutrinoSpawnPoint NCSpawn3 = new neutrinoSpawnPoint(sector, system, 2, 1, NCstation3);
system.addSpawnPoint(NCSpawn1);
for (int i = 0; i < 2; i++) NCSpawn1.spawnFleet();
system.addSpawnPoint(NCSpawn2);
for (int i = 0; i < 2; i++) NCSpawn2.spawnFleet();
system.addSpawnPoint(NCSpawn3);
for (int i = 0; i < 2; i++) NCSpawn3.spawnFleet();
system.addScript(new IndependentTraderSpawnPoint(sector, hyper, 1, 10, hyper.createToken(-6000, 2000), NCstation2));
}
private void initStationCargo(SectorEntityToken NCstation2) {
CargoAPI cargo = NCstation2.getCargo();
addRandomWeapons(cargo, 3);
cargo.addCrew(CrewXPLevel.VETERAN, 20);
cargo.addCrew(CrewXPLevel.REGULAR, 500);
cargo.addMarines(80);
cargo.addSupplies(2000);
cargo.addFuel(500);
cargo.getMothballedShips().addFleetMember(Global.getFactory().createFleetMember(FleetMemberType.SHIP, "conquest_Hull"));
cargo.getMothballedShips().addFleetMember(Global.getFactory().createFleetMember(FleetMemberType.SHIP, "crig_Hull"));
cargo.getMothballedShips().addFleetMember(Global.getFactory().createFleetMember(FleetMemberType.FIGHTER_WING, "gladius_wing"));
}
private void initStationCargo(SectorEntityToken NCstation3) {
CargoAPI cargo = NCstation3.getCargo();
addRandomWeapons(cargo, 5);
cargo.addCrew(CrewXPLevel.VETERAN, 69);
cargo.addCrew(CrewXPLevel.ELITE, 25);
cargo.addMarines(200);
cargo.addSupplies(600);
cargo.addFuel(200);
cargo.getMothballedShips().addFleetMember(Global.getFactory().createFleetMember(FleetMemberType.SHIP, "conquest_Hull"));
cargo.getMothballedShips().addFleetMember(Global.getFactory().createFleetMember(FleetMemberType.SHIP, "crig_Hull"));
cargo.getMothballedShips().addFleetMember(Global.getFactory().createFleetMember(FleetMemberType.FIGHTER_WING, "gladius_wing"));
}
private void addRandomWeapons(CargoAPI cargo, int count) {
List weaponIds = Global.getSector().getAllWeaponIds();
for (int i = 0; i < count; i++) {
String weaponId = (String) weaponIds.get((int) (weaponIds.size() * Math.random()));
int quantity = (int)(Math.random() * 4f + 2f);
cargo.addWeapons(weaponId, quantity);
}
}
}