I'm in Raleor (G5, planet ID 50). Nearby systems are Anleis (ID 0) and Tiqu (ID 202).
If I launch from a station and run this code:
Code: Select all
var ships = system.addShips("[cobra3-trader]", 1, p.position.add(p.vectorForward.multiply(10000)), 1000);
ships[0].fuel = 7;
ships[0].setCargoType("PLENTIFUL_GOODS");
ships[0].homeSystem = system.ID;
ships[0].destinationSystem = 202;
But if I launch and run this code:
Code: Select all
var ships = system.addShips("[cobra3-trader]", 1, p.position.add(p.vectorForward.multiply(10000)), 1000);
ships[0].fuel = 7;
ships[0].setCargoType("PLENTIFUL_GOODS");
ships[0].homeSystem = system.ID;
ships[0].destinationSystem = 0;
Note that in both these cases the Cobra is created a short distance from the main station. I don't know if that plays a big part or not.
I suspect (and I'm not sure) that the AI logic that's working out whether to jump to witchspace is doing a check of the destinationSystem and if it's greater than zero then it will do the jump. But I think the check should be greater than or equal to zero.
Have I done something wrong here? The code seems pretty straightforward. Does anyone else see this on their systems?