This code was made for something in Galaxy 8, at systems near Oresrati (whose system.ID = 162). But I'll toss in some other stuff just to hopefully make this useful to you.
&& = and
|| = or
() works the same in if statements as it does for algebra.
Basically the if statement says:
If the system's sun exists (= true) AND in galaxy 8 AND in either system 121 OR 9 AND there's fewer than 2 asp-pirate ships already...
Then add 40 asp-pirate ships around the witchpoint beacon (location 0 along the route). Location 1 along the route would probably be touching the planet's surface.
Code: Select all
this.shipWillLaunchFromStation = this.shipExitedWitchspace = function()
{
// galaxyNumber starts at 0 = galaxy 1, so 7 = galaxy 8
// the system.ID number should be: 121 = Aatedire ...but 9 may not be Leater!
if(system.sun && galaxyNumber == 7 && (system.ID == 121 || system.ID == 9) && system.countShipsWithRole("asp-pirate") <2)
{
system.addShipsToRoute("asp-pirate", 40, 0); // to be right near the witchpoint buoy
}
}
You could instead use:
system.addGroupToRoute("asp-pirate", 40, 0, "wp");
...If you wanted them to fight together as a more organized group, as opposed to 40 lone ships.