No worries
I've been tweaking for hours and finally got things how I want them:
Code: Select all
{
GLOBAL = {
ENTER = ();
"EXITED WITCHSPACE" = ("setStateTo: GO_TO_STATION");
EXIT = ();
UPDATE = ("setStateTo: CHOOSE_DESTINATION");
};
"CHOOSE_DESTINATION" = {
ENTER = ("rollD: 3");
"ROLL_1" = ("setStateTo: GO_TO_STATION");
"ROLL_2" = ("setStateTo: STEERING");
"ROLL_3" = ("setStateTo: STEERING");
EXIT = ();
UPDATE = ();
};
"STEERING" = {
ENTER = ("rollD: 10");
"ROLL_1" = ("setCoordinates: pwm 142653.45 -27832.78 57463.84", setDestinationFromCoordinates, "setDesiredRangeTo: 100.0", "setSpeedFactorTo: 0.9", performFlyToRangeFromDestination);
"ROLL_2" = ("setCoordinates: pwm 143166.81 -29220.01 59293.16", setDestinationFromCoordinates, "setDesiredRangeTo: 100.0", "setSpeedFactorTo: 0.9", performFlyToRangeFromDestination);
"ROLL_3" = ("setCoordinates: pwm 143971.92 -27108.34 58484.39", setDestinationFromCoordinates, "setDesiredRangeTo: 100.0", "setSpeedFactorTo: 0.9", performFlyToRangeFromDestination);
"ROLL_4" = ("setCoordinates: pwm 143581.45 -27807.32 59565.06", setDestinationFromCoordinates, "setDesiredRangeTo: 100.0", "setSpeedFactorTo: 0.9", performFlyToRangeFromDestination);
"ROLL_5" = ("setCoordinates: pwm 142959.56 -28632.24 57902.22", setDestinationFromCoordinates, "setDesiredRangeTo: 100.0", "setSpeedFactorTo: 0.9", performFlyToRangeFromDestination);
"ROLL_6" = ("setCoordinates: pwm 143780.75 -27055.29 59093.81", setDestinationFromCoordinates, "setDesiredRangeTo: 100.0", "setSpeedFactorTo: 0.9", performFlyToRangeFromDestination);
"ROLL_7" = ("setCoordinates: pwm 144091.70 -27321.55 57644.63", setDestinationFromCoordinates, "setDesiredRangeTo: 100.0", "setSpeedFactorTo: 0.9", performFlyToRangeFromDestination);
"ROLL_8" = ("setCoordinates: pwm 142990.44 -28428.13 59655.61", setDestinationFromCoordinates, "setDesiredRangeTo: 100.0", "setSpeedFactorTo: 0.9", performFlyToRangeFromDestination);
"ROLL_9" = ("setCoordinates: pwm 142287.39 -25442.38 52039.16", setDestinationFromCoordinates, "setDesiredRangeTo: 100.0", "setSpeedFactorTo: 0.9", performFlyToRangeFromDestination);
"ROLL_10" = ("setCoordinates: pwm 143891.75 -24652.42 53534.86", setDestinationFromCoordinates, "setDesiredRangeTo: 100.0", "setSpeedFactorTo: 0.9", performFlyToRangeFromDestination);
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: PREP_FOR_DEPARTURE");
"ACCEPT_DISTRESS_CALL" = (setTargetToFoundTarget, "setAITo: taranisTrafficFightAI.plist");
"OFFENCE_COMMITTED" = (setTargetToFoundTarget, "setAITo: taranisTrafficFightAI.plist");
"INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToPrimaryAggressor, broadcastDistressMessage, "setAITo: taranisTrafficFightAI.plist");
ATTACKED = (setTargetToPrimaryAggressor, broadcastDistressMessage, "setAITo: taranisTrafficFightAI.plist");
EXIT = ();
UPDATE = ();
RESTARTED = ("setStateTo: PREP_FOR_DEPARTURE");
};
The EXITED WITCHSPACE thing works as it should, and ships about to depart will turn to one of the ten sets of coordinates (all out of the "firing line" between the dock and the billboard) before heading out to jump range (which I've increased to 23.5km, as a couple of Morays, for some reason, were still getting stuck!). I removed some checkCourseToDestination/COURSE_OK/pauseAI stuff for the sake of smoothness; now ships slow to a near-stop, before turning again to head out. They always go in the direction of the sun - or rather, just to the side of it - which I guess is where Oolite likes its witchspace-entry coordinates to be!
Now to sort out the randomly appearing Frigate's "weapons testing" AI...