Re: [RELEASE] Jaguar Company 2.5r29
Posted: Mon Sep 04, 2023 6:10 pm
The changes were fairly small, because there weren't many format changes between Snoopers and GNN:
The text for the news flashes is in descriptions.plist: keys are "jaguar_company_help_news", "jaguar_company_help_news_quote", "jaguar_company_rescue_news", "jaguar_company_rescue_multiple_news", and "jaguar_company_rescue_news_quote".
I don't know if it helps, but here's the version I was working on (I think with dybal if memory serves): Jaguar_Company_2.6.0.zip
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 && !worldScripts.GNN) {
/* 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;
if (worldScripts.GNN) {
result = worldScripts.GNN.insertNews(news);
} else {
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)());
I don't know if it helps, but here's the version I was working on (I think with dybal if memory serves): Jaguar_Company_2.6.0.zip