Re: p.s.torusEngaged & p.s.injectorsEngaged Booleans
Posted: Sun Feb 18, 2024 4:06 pm
For information and discussion about Oolite.
https://bb.oolite.space/
There is none that I'm aware of. And certainly none you're going to reach without heading away from the planet for a long way, and I mean a *really* long way.
Code: Select all
#if OO_VARIABLE_TORUS_SPEED
#define HYPERSPEED_FACTOR [PLAYER hyperspeedFactor]
#define MIN_HYPERSPEED_FACTOR 32.0
#define MAX_HYPERSPEED_FACTOR 1024.0
#else
#define HYPERSPEED_FACTOR 32.0
#endif
Thank you, Redspear. But, you know, a polite poster would have mentioned the name of the file he was quoting. I presume it's got some poetic title, like "player.m"?Redspear wrote: ↑Sun Feb 18, 2024 10:05 pmMight it be this? (4th line)
If not, then it would be one less line of code for me to tweak when rescaling...Code: Select all
#if OO_VARIABLE_TORUS_SPEED #define HYPERSPEED_FACTOR [PLAYER hyperspeedFactor] #define MIN_HYPERSPEED_FACTOR 32.0 #define MAX_HYPERSPEED_FACTOR 1024.0 #else #define HYPERSPEED_FACTOR 32.0 #endif
Code: Select all
"use strict";
this.name = "Bullet Drive";
this.version = "1.0.3"; // Wildeblood, May 16th, 2013
/* ====================================================================================
MAINTAIN LOCKED HEADING AT HIGH SPEED
======================================================================================= */
this.$maintainHeading = function()
{
var self = player.ship;
if (self.status !== "STATUS_IN_FLIGHT" && self.status !== "STATUS_WITCHSPACE_COUNTDOWN")
{
removeFrameCallback(this.$monitor);
delete this.$monitor;
return;
}
if (self.speed <= (7 * self.maxSpeed))
{
if (this.$heading) delete this.$heading;
if (player.alertCondition != 1)
{
removeFrameCallback(this.$monitor);
delete this.$monitor;
}
return;
}
if (self.speed > (7 * self.maxSpeed)) // Exceeding injector speed, must be cheat button speed.
{
if (this.$heading)
{
var angle = self.heading.angleTo(this.$heading);
var cross = self.heading.cross(this.$heading).direction();
self.orientation = self.orientation.rotate(cross,-angle);
}
else this.$heading = self.heading;
}
}
/* ====================================================================================
STARTING $maintainHeading
======================================================================================= */
this.alertConditionChanged = function(newCondition, oldCondition)
{
if (newCondition == 1 && !this.$monitor)
{
this.$monitor = addFrameCallback(this.$maintainHeading.bind(this));
}
}
this.shipExitedWitchspace = function()
{
if (player.alertCondition == 1 && !this.$monitor)
{
this.$monitor = addFrameCallback(this.$maintainHeading.bind(this));
}
}
/* ====================================================================================
CHANGE LOG
1.0.3 (May 16th, 2013) Added this.shipExitedWitchspace check.
1.0.2 (December 19th, 2012) Changed < to <= in speed check.
1.0.1 (December 18th, 2012) Comment removed.
1.0 (December 18th, 2012) Created.
======================================================================================= */
Apologies if I didn't meet your standards...Wildeblood wrote: ↑Sun Feb 18, 2024 10:24 pmThank you, Redspear. But, you know, a polite poster would have mentioned the name of the file he was quoting
I don't understand that remark. Have I offended you?Redspear wrote: ↑Sun Feb 18, 2024 10:47 pmApologies if I didn't meet your standards...Wildeblood wrote: ↑Sun Feb 18, 2024 10:24 pmThank you, Redspear. But, you know, a polite poster would have mentioned the name of the file he was quoting
And that's not sarcasm on my part, rather it's to do with the nature of politeness itself.
No and furthermore my apology was genuine. What's considered polite tends to vary somewhat however so consider that my defence, if you will.
It seems it doesn't actually check for 32 x maxSpeed anywhere, just speed > 7 x maxSpeed, so - assuming injectors speed hasn't also been changed - it should still work fine. No need to change anything.Wildeblood wrote: ↑Sun Feb 18, 2024 10:24 pmAnyway, below is the entirety of Bullet Drive.Code: Select all
"use strict"; this.name = "Bullet Drive"; this.version = "1.0.3"; // Wildeblood, May 16th, 2013 /* ==================================================================================== MAINTAIN LOCKED HEADING AT HIGH SPEED ======================================================================================= */ this.$maintainHeading = function() { var self = player.ship; if (self.status !== "STATUS_IN_FLIGHT" && self.status !== "STATUS_WITCHSPACE_COUNTDOWN") { removeFrameCallback(this.$monitor); delete this.$monitor; return; } if (self.speed <= (7 * self.maxSpeed)) { if (this.$heading) delete this.$heading; if (player.alertCondition != 1) { removeFrameCallback(this.$monitor); delete this.$monitor; } return; } if (self.speed > (7 * self.maxSpeed)) // Exceeding injector speed, must be cheat button speed. { if (this.$heading) { var angle = self.heading.angleTo(this.$heading); var cross = self.heading.cross(this.$heading).direction(); self.orientation = self.orientation.rotate(cross,-angle); } else this.$heading = self.heading; } } /* ==================================================================================== STARTING $maintainHeading ======================================================================================= */ this.alertConditionChanged = function(newCondition, oldCondition) { if (newCondition == 1 && !this.$monitor) { this.$monitor = addFrameCallback(this.$maintainHeading.bind(this)); } } this.shipExitedWitchspace = function() { if (player.alertCondition == 1 && !this.$monitor) { this.$monitor = addFrameCallback(this.$maintainHeading.bind(this)); } } /* ==================================================================================== CHANGE LOG 1.0.3 (May 16th, 2013) Added this.shipExitedWitchspace check. 1.0.2 (December 19th, 2012) Changed < to <= in speed check. 1.0.1 (December 18th, 2012) Comment removed. 1.0 (December 18th, 2012) Created. ======================================================================================= */
Only took about 10-12 minutes to build up from 32x to 1024x.