This signals that something needs to be created.This is the ID of what you create.This is the function that creates the planet.This is the ID of the celestial body around which it orbits, usually a star but you can use any ID.This is the name of the object as displayed to the player in-game.This is the ID of which object to use in relation to the "planets.json" file.The 4 numbers after all this is about the distance, size, etc of the object you want to create.
Distance as in distance from the object it orbits.
Size as in the size of the object itself.
I don't recall what the others did.
package data.scripts.world;
import java.awt.Color;
import com.fs.starfarer.api.campaign.FactionAPI;
import com.fs.starfarer.api.campaign.SectorAPI;
import com.fs.starfarer.api.campaign.SectorEntityToken;
import com.fs.starfarer.api.campaign.SectorGeneratorPlugin;
import com.fs.starfarer.api.campaign.StarSystemAPI;
@SuppressWarnings("unchecked")
public class SectorGen implements SectorGeneratorPlugin {
public void generate(SectorAPI sector) {
StarSystemAPI system = sector.createStarSystem("Corvus");
SectorEntityToken star = system.initStar("star_yellow", Color.white, 500f);
SectorEntityToken corvusI = system.addPlanet(star, "Corvus I", "desert", 55, 150, 3000, 100);
SectorEntityToken corvusII = system.addPlanet(star, "Corvus II", "jungle", 235, 200, 4500, 200);
system.addAsteroidBelt(star, 500, 5500, 1000, 150, 300);
SectorEntityToken corvusIII = system.addPlanet(star, "Corvus III", "gas_giant", 200, 300, 7500, 400);
SectorEntityToken corvusIIIA = system.addPlanet(corvusIII, "Corvus IIIA", "cryovolcanic", 235, 120, 800, 20);
system.addAsteroidBelt(corvusIII, 50, 1000, 200, 10, 45);
SectorEntityToken corvusIIIB = system.addPlanet(corvusIII, "Corvus IIIB", "barren", 235, 100, 1300, 60);
SectorEntityToken corvusIV = system.addPlanet(star, "Corvus IV", "barren", 0, 100, 10000, 700);
SectorEntityToken corvusV = system.addPlanet(star, "Corvus V", "frozen", 330, 175, 12000, 500);
initFactionRelationships(sector);
}
private void initFactionRelationships(SectorAPI sector) {
FactionAPI hegemony = sector.getFaction("hegemony");
FactionAPI tritachyon = sector.getFaction("tritachyon");
FactionAPI pirates = sector.getFaction("pirates");
FactionAPI independent = sector.getFaction("independent");
FactionAPI player = sector.getFaction("player");
player.setRelationship(hegemony.getId(), 0);
player.setRelationship(tritachyon.getId(), 0);
player.setRelationship(pirates.getId(), -1);
player.setRelationship(independent.getId(), 0);
hegemony.setRelationship(tritachyon.getId(), -1);
hegemony.setRelationship(pirates.getId(), -1);
tritachyon.setRelationship(pirates.getId(), -1);
tritachyon.setRelationship(independent.getId(), -1);
pirates.setRelationship(independent.getId(), -1);
// independent.setRelationship(hegemony.getId(), 0);
// independent.setRelationship(tritachyon.getId(), 0);
// independent.setRelationship(pirates.getId(), 0);
// independent.setRelationship(independent.getId(), 0);
// independent.setRelationship(player.getId(), 0);
}
}