Spawn points work like so:
You create a file called and put it in data/scripts/world, and in there you put all the information about how the spawn will work. You can even influence things other than the spawn in this - like say change the inventory of a station when a fleet despawns/docks at it. Then in a gen file (sectorgen or a custom gen file you make) you call up this file to create the spawn point, like so:
new NameOfSpawnPointFile(sector, system, daysinterval, maxfleets, spawnlocation);
All that information relates to the data in the spawn point file, so you could customize it. The spawn location is referred to as the anchor, and most ships are set to return to that point to despawn. It can be a planet, station, or simply a fixed point in space. The convoy spawns have a destination in addition to that. To actually add the point you just go
system.addSpawnPoint(new nameofspawnpointfile(sector, system, daysinterval, maxfleets, spawnlocation, destination));
Or if you wanted you could set the spawn point up first and then add it like this:
NameOfSpawnPointFile Spawn = new NameOfSpawnPointFile(sector, system, daysinterval, maxfleets, spawnlocation);
system.addSpawnPoint(Spawn);
So for a full example this is how I added the station and convoy spawn to the game for the TT station:
SectorEntityToken station2 = system.addOrbitalStation(corvusV, 45, 300, 50, "Orbital Headquarters", "tritachyon");
Here I add a station, referring to it simply as station2. Orbiting Corvus IV (reference to it is mislabeled CorvusV in default sector gen for some reason) at angle 45, radius 300, with a 50 day orbit, named Orbital Headquarters, and belonging to the tritachyon faction.
token = system.createToken(15000, -15000);
Here I create a invisible token in space at 15000,-15000 (which corresponds to the bottom right of the system map)
system.addSpawnPoint(new TConvoySpawnPoint(sector, system, 14, 1, token, station2));
And finally here I'm adding the spawn point, which references a file named TConvoySpawnPoint, with a 14 day interval, a 1 max limit for parties, at the location specified in token, with a destination set as station2.
Then inside the TConvoySpawnPoint file it spawns a fleet at the location, gives it cargo, and tells it to go deliver supplies to the station then return to the anchor location to despawn.