@Ahruman
I basically wanted to know whether I could use the shaders in Griff's Illuminated Docking Bay for my own station, and also how to create an "illumination map". I think I know what I'm doing now, but I've moved onto the AI side of things for the time being.
@Commander McLane
Nailed the rotation
Had to do some quaternion calculus:
Code: Select all
<key>rotating</key>
<true/>
<key>rotational_velocity</key>
<string>0.9987820251 0.0348782369 -0.0012179749 0.0348782369</string>
That makes it double-rotate just as the other ad boards/buoys do, only much slower, which I think is cool
@Eric Walsh
I bow to your knowledge - I didn't get a chance to do much tonight, but I'll insert pauses as you suggest.
I'm not really bothered about keeping the number of ships in the system constant (as long as it doesn't get ridiculous) - in fact, I'd prefer it if sometimes when you visit there's not much going on, and other times it's quite busy.
A big problem I've identified tonight is that the docking AI for my HQ's defence ships (which I essentially cribbed from the Behemoth OXP last year) isn't doing the job. I lured my test Frigate into hitting the HQ by mistake, thus triggering a response (that wouldn't be fatal to me!). After destroying the Frigate, the defence ship I was monitoring switched to the docking AI as intended, but promptly got stuck in "AWAIT_COORDS". Here's the AI in full (apologies for length of code):
Code: Select all
{
"AWAIT_COORDS" = {
ATTACKED = (setTargetToPrimaryAggressor, "setAITo: taranisDefenderAI.plist");
"INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToPrimaryAggressor, "setAITo: taranisDefenderAI.plist");
"APPROACH_START" = ("setStateTo: GO_TO_START");
"APPROACH_COORDINATES" = ("setStateTo: GO_TO_COORDS");
"APPROACH_STATION" = ("setStateTo: GO_TO_STATION");
"HOLD_POSITION" = (performIdle, "pauseAI: 10.0", "setStateTo: GLOBAL");
"DOCKING_ABORTED" = ("setStateTo: ABORT");
"TRY_AGAIN_LATER" = ("pauseAI: 30.0", "setStateTo: ABORT");
"COLLISION" = ("setStateTo: ABORT");
"GROUP_ATTACK_TARGET" = (setTargetToFoundTarget, "setAITo: taranisDefenderAI.plist");
"RESTART_DOCKING" = ("setStateTo: GLOBAL");
DOCKED = ("setStateTo: EXIT_SYSTEM");
ENTER = ();
EXIT = ();
UPDATE = ();
};
"EXIT_SYSTEM" = {ENTER = (performDocking, exitAI); EXIT = (); UPDATE = (); };
ABORT = {
ENTER = (abortDocking, "setSpeedFactorTo: 0.0", setDestinationToDockingAbort, "setDesiredRangeTo: 500.0", performFaceDestination);
"FACING_DESTINATION" = ("setSpeedFactorTo: 1.0", "setDesiredRangeTo: 500.0", performFlyToRangeFromDestination);
EXIT = ();
"RESTART_DOCKING" = ("setStateTo: GLOBAL");
"REACHED_SAFETY" = (performIdle, "setStateTo: GLOBAL");
"DESIRED_RANGE_ACHIEVED" = (performIdle, "setStateTo: GLOBAL");
ATTACKED = (setTargetToPrimaryAggressor, "setAITo: taranisDefenderAI.plist");
"INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToPrimaryAggressor, "setAITo: taranisDefenderAI.plist");
"GROUP_ATTACK_TARGET" = (setTargetToFoundTarget, "setAITo: taranisDefenderAI.plist");
UPDATE = ();
};
GLOBAL = {
ENTER = ("setSpeedTo: 0.0", "setDesiredRangeTo: 5.0", requestDockingCoordinates, "setStateTo: AWAIT_COORDS");
EXIT = ();
UPDATE = ();
};
"GO_TO_WAYPOINT" = {
ENTER = ("setDesiredRangeTo: 50.0", checkCourseToDestination);
"COURSE_OK" = ("setSpeedFactorTo: 0.85", performFlyToRangeFromDestination);
"WAYPOINT_SET" = ("setDesiredRangeTo: 50.0", checkCourseToDestination);
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: GO_TO_STATION");
ATTACKED = (setTargetToPrimaryAggressor, "setAITo: taranisDefenderAI.plist");
"INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToPrimaryAggressor, "setAITo: taranisDefenderAI.plist");
"GROUP_ATTACK_TARGET" = (setTargetToFoundTarget, "setAITo: taranisDefenderAI.plist");
EXIT = ();
UPDATE = ();
};
"GO_TO_START" = {
ENTER = (
"setSpeedFactorTo: 0.05",
setDestinationFromCoordinates,
checkCourseToDestination
);
"WAYPOINT_SET" = ("setStateTo: GO_TO_WAYPOINT");
"COURSE_OK" = ("setSpeedFactorTo: 0.25", performFaceDestination);
"FACING_DESTINATION" = ("setDesiredRangeTo: 50.0", "setSpeedFactorTo: 0.85", performFlyToRangeFromDestination);
"DESIRED_RANGE_ACHIEVED" = (requestDockingCoordinates, "setStateTo: AWAIT_COORDS");
"DOCKING_ABORTED" = ("setStateTo: ABORT");
"COLLISION" = ("setStateTo: ABORT");
"RESTART_DOCKING" = ("setStateTo: GLOBAL");
ATTACKED = (setTargetToPrimaryAggressor, "setAITo: taranisDefenderAI.plist");
"INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToPrimaryAggressor, "setAITo: taranisDefenderAI.plist");
"GROUP_ATTACK_TARGET" = (setTargetToFoundTarget, "setAITo: taranisDefenderAI.plist");
EXIT = ();
UPDATE = ();
};
"GO_TO_COORDS" = {
ENTER = (
setDestinationFromCoordinates,
performFaceDestination
);
"FACING_DESTINATION" = ("setDesiredRangeTo: 50.0", "setSpeedTo: 100.0", performFlyToRangeFromDestination);
"DESIRED_RANGE_ACHIEVED" = (requestDockingCoordinates, "setStateTo: AWAIT_COORDS");
"DOCKING_ABORTED" = ("setStateTo: ABORT");
"COLLISION" = ("setStateTo: ABORT");
"RESTART_DOCKING" = ("setStateTo: GLOBAL");
ATTACKED = (setTargetToPrimaryAggressor, "setAITo: taranisDefenderAI.plist");
"INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToPrimaryAggressor, "setAITo: taranisDefenderAI.plist");
"GROUP_ATTACK_TARGET" = (setTargetToFoundTarget, "setAITo: taranisDefenderAI.plist");
EXIT = ();
UPDATE = ();
};
"GO_TO_STATION" = {
ENTER = (
setTargetToStation,
setDestinationFromCoordinates,
performFaceDestination
);
"FACING_DESTINATION" = ("setDesiredRangeTo: 10.0", "setSpeedTo: 50.0", performFlyToRangeFromDestination);
"DESIRED_RANGE_ACHIEVED" = (requestDockingCoordinates, "setStateTo: AWAIT_COORDS");
"DOCKING_ABORTED" = ("setStateTo: ABORT");
"RESTART_DOCKING" = ("setStateTo: GLOBAL");
"COLLISION" = ("setStateTo: ABORT");
EXIT = ();
UPDATE = ();
};
}
Anything dodgy in there? As previously mentioned, the HQ doesn't have the "station" role - but then neither does the Behemoth.