Code: Select all
this.postFrigates = function()
{
if(this.ship.hasHostileTarget) {return;}
if((!this.myF1) || (!this.myF1.isValid)) {this.shipIdentifiers();}
var vector000, vector120, vector240;
var F1_post, F2_post, F3_post;
var pi_by_3 = (Math.PI / 3), pi_by_n3 = (Math.PI / -3);
var cos_60 = Math.cos(pi_by_3);
var sin_60 = Math.sin(pi_by_3), sin_n60 = Math.sin(pi_by_n3);
var quat1 = [cos_60, 0, sin_60, 0];
var quat2 = [cos_60, 0, sin_n60, 0];
vector000 = this.ship.heading.direction();
vector120 = vector000.rotateBy(quat1);
vector240 = vector000.rotateBy(quat2);
F1_post = this.ship.position.add(vector000.multiply(10375));
F2_post = this.ship.position.add(vector240.multiply(10187.5));
F3_post = this.ship.position.add(vector120.multiply(10187.5));
if(this.myF1)
{
this.myF1.savedCoordinates = F1_post;
this.myF1.reactToAIMessage("POST");
log(this.name, "\n** " + this.myF1.displayName + " has been posted... **");
}
if(this.myF2)
{
this.myF2.savedCoordinates = F2_post;
this.myF2.reactToAIMessage("POST");
log(this.name, "\n** " + this.myF2.displayName + " has been posted... **");
}
if(this.myF3)
{
this.myF3.savedCoordinates = F3_post;
this.myF3.reactToAIMessage("POST");
log(this.name, "\n** " + this.myF3.displayName + " has been posted... **");
}
}
I had a small problem with the Behemoth wanting to change course a little whenever the lead Frigate jumped directly into his path. The fix was to reduce the Behemoth's scanner_range to 7,500 meters.
Many thanks to Professor Walch (without his BuoyRepair OXP, the answer would likely have eluded me forever!), and everyone else who offered assistance.