Re: [RELEASE] Jaguar Company 2.4
Posted: Fri Feb 07, 2014 4:20 am
How about getting invited to join Jaguar Company ...
For information and discussion about Oolite.
https://bb.oolite.space/
Well... you kind of do get invited, just not told about it.Diogenese Senna wrote:How about getting invited to join Jaguar Company ...
The attacker flag is important because we can't rely solely on the attacker list stored: it uses the ship's personality to identify the attacker, and the player can change that with Ship Respray, or the whole ship with HyperSpaceHangar.Milo wrote: ↑Fri Jul 10, 2020 2:30 pmI agree, (a) is intended behavior, (b) seems like a bug. Although, if you actually killed some JC ships, they might very well hold a grudge even if you stop attacking them and starting helping, I think they should stop attacking you at that point as long as your legal status is clean.
phkb and I are collaborating on an update for this OXP so we can look at this too. What I would do here is keep the attacker flag (so they remember their grudge, and limit how "friendly" they can become with you) but have them not attack you if your legal status is clean.
Code: Select all
diff -Nuwr jaguarCompany-2.5.29/Scripts/jaguar_company.js jaguarCompany-2.5.30/Scripts/jaguar_company.js
--- jaguarCompany-2.5.29/Scripts/jaguar_company.js 2020-07-10 10:08:43.335754113 -0300
+++ jaguarCompany-2.5.30/Scripts/jaguar_company.js 2020-07-10 10:27:04.514610470 -0300
@@ -29,7 +29,7 @@
this.copyright = "© 2012-2013 Richard Thomas Harrison (Tricky)";
this.license = "CC BY-NC-SA 3.0";
this.description = "Script to initialise the Jaguar Company.";
- this.version = "2.5";
+ this.version = "2.5.30";
/* Private variables. */
var p_main = {},
@@ -375,6 +375,11 @@
missionVariables.jaguar_company = JSON.stringify(this.$playerVar);
}
+ if (this.$playerVar.attacker === true && this.$playerVar.reputation[galaxyNumber] >= this.$reputationHelper) {
+ // there was a bug in version <= 2.5.29 where the player ship was removed from the attackers list but the attacker flag wasn't cleared
+ this.$playerVar.attacker = false;
+ }
+
/* Setup the private main variable + some public variables. */
this.$setUp();
/* Remove join navy variable. */
diff -Nuwr jaguarCompany-2.5.29/Scripts/jaguar_company_ships.js jaguarCompany-2.5.30/Scripts/jaguar_company_ships.js
--- jaguarCompany-2.5.29/Scripts/jaguar_company_ships.js 2020-07-10 10:08:43.311754486 -0300
+++ jaguarCompany-2.5.30/Scripts/jaguar_company_ships.js 2020-07-10 10:16:41.256310021 -0300
@@ -1255,6 +1255,7 @@
if (p_ships.logging && p_ships.logExtra) {
logMsg += ", removing (player turned from the dark side)";
}
+ p_ships.mainScript.$playerVar.attacker = false;
/* Remove the player from the real attackers array. */
this.$removeAttacker(attackerKey);
Code: Select all
12:02:17.602 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (jaguar_company_patrol.js 1.10): TypeError: this.$friendList is undefined
12:02:17.602 [script.javaScript.exception.unexpectedType]: AddOns/jaguarCompany-2.5.30.oxz/Scripts/jaguar_company_ships.js, line 553.
I have a version that has been converted, but I have a bit more work to do on it to get it as up-to-date as I'd like.
Got these error messages when I ran it:
Code: Select all
10:53:14.281 [oxp-standards.deprecated] OOStandardsInternal (OODebugStandards.m:92): Old style sub-entity declarations are deprecated in jaguar_company_template
10:53:14.281 [oxp-standards.deprecated] OOStandardsInternal (OODebugStandards.m:92): Old style sub-entity declarations are deprecated in jaguar_company_template
10:53:14.281 [oxp-standards.deprecated] OOStandardsInternal (OODebugStandards.m:92): Old style sub-entity declarations are deprecated in jaguar_company_template
Any chance of seeing the updated script for GNN?
Code: Select all
/* NAME
* $sendNewsToSnoopers
*
* FUNCTION
* Send news to Snoopers (if available).
*
* INPUTS
* message - news to show
* agency - agency to use (optional)
*/
this.$sendNewsToSnoopers = function (message, agency) {
var news = {},
result,
index;
if (!worldScripts.snoopers) {
/* Snoopers not installed. */
return;
}
if (!agency || typeof agency !== "number") {
/* Random agency. [1, 2 or 3] */
agency = Math.floor(Math.random() * 3.0) + 1;
}
news.ID = this.name;
news.Message = message;
news.Agency = agency;
result = worldScripts.snoopers.insertNews(news);
index = result + 5;
if (result < 0) {
/* Save for later. Snoopers only allows one news item at a time. */
this.$playerVar.newsForSnoopers.push(news);
if (this.$logging && this.$logExtra) {
log(this.name, "$sendNewsToSnoopers::Saving news for later.\n" +
"* ID: '" + this.name + "'\n" +
"* Message: '" + message + "'\n" +
"* Agency: " + agency + "\n" +
"* result: " + result + (result >= -5 ? ") " + p_const.snoopersErrorCodes[index] : ""));
}
} else if (result > 0) {
/* Problem. */
log(this.name, "$sendNewsToSnoopers::Problem with news.\n" +
"* ID: '" + this.name + "'\n" +
"* Message: '" + message + "'\n" +
"* Agency: " + agency + "\n" +
"* result: " + result + (result <= 30 ? ") " + p_const.snoopersErrorCodes[index] : ""));
} else {
/* News inserted. */
if (this.$logging && this.$logExtra) {
log(this.name, "$sendNewsToSnoopers::News inserted.\n" +
"* ID: '" + this.name + "'\n" +
"* Message: '" + message + "'\n" +
"* Agency: " + agency + "\n" +
"* result: " + result + ") " + p_const.snoopersErrorCodes[index]);
}
}
};
/* NAME
* newsDisplayed
*
* FUNCTION
* Called by Snoopers when the news item has been displayed.
* Check for any more news available and send it.
*/
this.newsDisplayed = function () {
var news = this.$playerVar.newsForSnoopers.shift();
if (news) {
/* More news available. Send it to Snoopers. */
this.$sendNewsToSnoopers(news.Message, news.Agency);
}
};
}.bind(this)());